@dxc-technology/halstack-react 0.0.0-9e54008 → 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 +54 -144
- package/HalstackContext.js +11 -36
- 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/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.d.ts +1 -1
- package/button/Button.js +68 -100
- package/button/Button.stories.tsx +35 -135
- package/button/Button.test.js +19 -16
- package/button/types.d.ts +9 -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 +41 -24
- 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 +15 -59
- 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 +30 -67
- 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 +73 -103
- package/footer/Footer.stories.tsx +76 -8
- package/footer/Footer.test.js +21 -33
- package/footer/Icons.d.ts +3 -2
- package/footer/Icons.js +53 -22
- package/footer/types.d.ts +26 -22
- package/grid/Grid.d.ts +1 -1
- package/grid/Grid.js +2 -17
- package/grid/Grid.stories.tsx +38 -38
- 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 +35 -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.js +46 -36
- package/number-input/NumberInput.stories.tsx +42 -26
- package/number-input/NumberInput.test.js +859 -412
- package/number-input/NumberInputContext.d.ts +3 -4
- package/number-input/NumberInputContext.js +3 -14
- 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 +58 -127
- package/password-input/PasswordInput.stories.tsx +1 -33
- package/password-input/PasswordInput.test.js +157 -140
- 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 +221 -326
- 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 +90 -109
- package/toggle-group/ToggleGroup.stories.tsx +10 -7
- package/toggle-group/ToggleGroup.test.js +68 -87
- package/toggle-group/types.d.ts +28 -19
- 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/number-input/numberInputContextTypes.d.ts +0 -19
- package/paginator/Icons.d.ts +0 -5
- package/paginator/Icons.js +0 -54
- 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/{number-input/numberInputContextTypes.js → breadcrumbs/types.js} +0 -0
- /package/spinner/{Spinner.stories.jsx → Spinner.stories.tsx} +0 -0
package/file-input/FileInput.js
CHANGED
|
@@ -1,249 +1,178 @@
|
|
|
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
|
-
var _uuid = require("uuid");
|
|
31
|
-
|
|
32
18
|
var _variables = require("../common/variables");
|
|
33
|
-
|
|
34
19
|
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
35
|
-
|
|
36
20
|
var _useTranslatedLabels = _interopRequireDefault(require("../useTranslatedLabels"));
|
|
37
|
-
|
|
38
21
|
var _Button = _interopRequireDefault(require("../button/Button"));
|
|
39
|
-
|
|
40
22
|
var _FileItem = _interopRequireDefault(require("./FileItem"));
|
|
41
|
-
|
|
42
23
|
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;
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
var getFilePreview = /*#__PURE__*/function () {
|
|
29
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(file) {
|
|
30
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
if (!file.type.includes("video")) {
|
|
34
|
+
_context.next = 4;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
return _context.abrupt("return", "filled_movie");
|
|
38
|
+
case 4:
|
|
39
|
+
if (!file.type.includes("audio")) {
|
|
40
|
+
_context.next = 8;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return _context.abrupt("return", "music_video");
|
|
44
|
+
case 8:
|
|
45
|
+
if (!file.type.includes("image")) {
|
|
46
|
+
_context.next = 12;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
50
|
+
var reader = new FileReader();
|
|
51
|
+
reader.readAsDataURL(file);
|
|
52
|
+
reader.onload = function (e) {
|
|
53
|
+
resolve(e.target.result);
|
|
54
|
+
};
|
|
55
|
+
}));
|
|
56
|
+
case 12:
|
|
57
|
+
return _context.abrupt("return", "draft");
|
|
58
|
+
case 13:
|
|
59
|
+
case "end":
|
|
60
|
+
return _context.stop();
|
|
61
|
+
}
|
|
62
|
+
}, _callee);
|
|
63
|
+
}));
|
|
64
|
+
return function getFilePreview(_x) {
|
|
65
|
+
return _ref.apply(this, arguments);
|
|
66
|
+
};
|
|
67
|
+
}();
|
|
68
|
+
var isFileIncluded = function isFileIncluded(file, fileList) {
|
|
69
|
+
var fileListInfo = fileList.map(function (existingFile) {
|
|
70
|
+
return existingFile.file;
|
|
71
|
+
});
|
|
72
|
+
return fileListInfo.some(function (_ref2) {
|
|
73
|
+
var name = _ref2.name,
|
|
74
|
+
size = _ref2.size,
|
|
75
|
+
type = _ref2.type,
|
|
76
|
+
lastModified = _ref2.lastModified,
|
|
77
|
+
webkitRelativePath = _ref2.webkitRelativePath;
|
|
78
|
+
return name === file.file.name && size === file.file.size && type === file.file.type && lastModified === file.file.lastModified && webkitRelativePath === file.file.webkitRelativePath;
|
|
79
|
+
});
|
|
100
80
|
};
|
|
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
|
-
|
|
81
|
+
var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref3, ref) {
|
|
82
|
+
var _ref3$name = _ref3.name,
|
|
83
|
+
name = _ref3$name === void 0 ? "" : _ref3$name,
|
|
84
|
+
_ref3$mode = _ref3.mode,
|
|
85
|
+
mode = _ref3$mode === void 0 ? "file" : _ref3$mode,
|
|
86
|
+
_ref3$label = _ref3.label,
|
|
87
|
+
label = _ref3$label === void 0 ? "" : _ref3$label,
|
|
88
|
+
buttonLabel = _ref3.buttonLabel,
|
|
89
|
+
dropAreaLabel = _ref3.dropAreaLabel,
|
|
90
|
+
_ref3$helperText = _ref3.helperText,
|
|
91
|
+
helperText = _ref3$helperText === void 0 ? "" : _ref3$helperText,
|
|
92
|
+
accept = _ref3.accept,
|
|
93
|
+
minSize = _ref3.minSize,
|
|
94
|
+
maxSize = _ref3.maxSize,
|
|
95
|
+
_ref3$showPreview = _ref3.showPreview,
|
|
96
|
+
showPreview = _ref3$showPreview === void 0 ? false : _ref3$showPreview,
|
|
97
|
+
_ref3$multiple = _ref3.multiple,
|
|
98
|
+
multiple = _ref3$multiple === void 0 ? true : _ref3$multiple,
|
|
99
|
+
_ref3$disabled = _ref3.disabled,
|
|
100
|
+
disabled = _ref3$disabled === void 0 ? false : _ref3$disabled,
|
|
101
|
+
callbackFile = _ref3.callbackFile,
|
|
102
|
+
value = _ref3.value,
|
|
103
|
+
margin = _ref3.margin,
|
|
104
|
+
_ref3$tabIndex = _ref3.tabIndex,
|
|
105
|
+
tabIndex = _ref3$tabIndex === void 0 ? 0 : _ref3$tabIndex;
|
|
128
106
|
var _useState = (0, _react.useState)(false),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
107
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
108
|
+
isDragging = _useState2[0],
|
|
109
|
+
setIsDragging = _useState2[1];
|
|
133
110
|
var _useState3 = (0, _react.useState)([]),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
var _useState5 = (0, _react.useState)("file-input-".concat((0, _uuid.v4)())),
|
|
139
|
-
_useState6 = (0, _slicedToArray2["default"])(_useState5, 1),
|
|
140
|
-
fileInputId = _useState6[0];
|
|
141
|
-
|
|
111
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
112
|
+
files = _useState4[0],
|
|
113
|
+
setFiles = _useState4[1];
|
|
114
|
+
var fileInputId = "file-input-".concat((0, _react.useId)());
|
|
142
115
|
var colorsTheme = (0, _useTheme["default"])();
|
|
143
116
|
var translatedLabels = (0, _useTranslatedLabels["default"])();
|
|
144
|
-
|
|
145
117
|
var checkFileSize = function checkFileSize(file) {
|
|
146
118
|
if (file.size < minSize) return translatedLabels.fileInput.fileSizeGreaterThanErrorMessage;else if (file.size > maxSize) return translatedLabels.fileInput.fileSizeLessThanErrorMessage;
|
|
147
119
|
};
|
|
148
|
-
|
|
149
120
|
var getFilesToAdd = /*#__PURE__*/function () {
|
|
150
|
-
var
|
|
121
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(selectedFiles) {
|
|
151
122
|
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
|
-
});
|
|
123
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
124
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
125
|
+
case 0:
|
|
126
|
+
_context2.next = 2;
|
|
127
|
+
return Promise.all(selectedFiles.map(function (selectedFile) {
|
|
128
|
+
return getFilePreview(selectedFile);
|
|
129
|
+
})).then(function (previews) {
|
|
130
|
+
return selectedFiles.map(function (file, index) {
|
|
131
|
+
var fileInfo = {
|
|
132
|
+
file: file,
|
|
133
|
+
error: checkFileSize(file),
|
|
134
|
+
preview: previews[index]
|
|
135
|
+
};
|
|
136
|
+
return fileInfo;
|
|
168
137
|
});
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
138
|
+
});
|
|
139
|
+
case 2:
|
|
140
|
+
filesToAdd = _context2.sent;
|
|
141
|
+
return _context2.abrupt("return", filesToAdd.filter(function (file) {
|
|
142
|
+
return !isFileIncluded(file, files);
|
|
143
|
+
}));
|
|
144
|
+
case 4:
|
|
145
|
+
case "end":
|
|
146
|
+
return _context2.stop();
|
|
178
147
|
}
|
|
179
|
-
},
|
|
148
|
+
}, _callee2);
|
|
180
149
|
}));
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return _ref2.apply(this, arguments);
|
|
150
|
+
return function getFilesToAdd(_x2) {
|
|
151
|
+
return _ref4.apply(this, arguments);
|
|
184
152
|
};
|
|
185
153
|
}();
|
|
186
|
-
|
|
187
154
|
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
|
-
}
|
|
155
|
+
var _ref5 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(selectedFiles) {
|
|
156
|
+
var filesToAdd, finalFiles;
|
|
157
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
158
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
159
|
+
case 0:
|
|
160
|
+
_context3.next = 2;
|
|
161
|
+
return getFilesToAdd(multiple ? selectedFiles : selectedFiles.length === 1 ? selectedFiles : [selectedFiles[0]]);
|
|
162
|
+
case 2:
|
|
163
|
+
filesToAdd = _context3.sent;
|
|
164
|
+
finalFiles = multiple ? [].concat((0, _toConsumableArray2["default"])(files), (0, _toConsumableArray2["default"])(filesToAdd)) : filesToAdd;
|
|
165
|
+
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(finalFiles);
|
|
166
|
+
case 5:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context3.stop();
|
|
238
169
|
}
|
|
239
|
-
},
|
|
170
|
+
}, _callee3);
|
|
240
171
|
}));
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return _ref3.apply(this, arguments);
|
|
172
|
+
return function addFile(_x3) {
|
|
173
|
+
return _ref5.apply(this, arguments);
|
|
244
174
|
};
|
|
245
175
|
}();
|
|
246
|
-
|
|
247
176
|
var selectFiles = function selectFiles(e) {
|
|
248
177
|
var selectedFiles = e.target.files;
|
|
249
178
|
var filesArray = Object.keys(selectedFiles).map(function (key) {
|
|
@@ -252,7 +181,6 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
252
181
|
addFile(filesArray);
|
|
253
182
|
e.target.value = null;
|
|
254
183
|
};
|
|
255
|
-
|
|
256
184
|
var onDelete = (0, _react.useCallback)(function (fileName) {
|
|
257
185
|
var filesCopy = (0, _toConsumableArray2["default"])(files);
|
|
258
186
|
var fileToRemove = filesCopy.find(function (file) {
|
|
@@ -262,33 +190,26 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
262
190
|
filesCopy.splice(fileIndex, 1);
|
|
263
191
|
callbackFile === null || callbackFile === void 0 ? void 0 : callbackFile(filesCopy);
|
|
264
192
|
}, [files, callbackFile]);
|
|
265
|
-
|
|
266
193
|
var handleClick = function handleClick() {
|
|
267
194
|
document.getElementById(fileInputId).click();
|
|
268
195
|
};
|
|
269
|
-
|
|
270
196
|
var handleDrag = function handleDrag(e) {
|
|
271
197
|
e.preventDefault();
|
|
272
198
|
e.stopPropagation();
|
|
273
199
|
};
|
|
274
|
-
|
|
275
200
|
var handleDragIn = function handleDragIn(e) {
|
|
276
201
|
var _e$dataTransfer$items;
|
|
277
|
-
|
|
278
202
|
if (((_e$dataTransfer$items = e.dataTransfer.items) === null || _e$dataTransfer$items === void 0 ? void 0 : _e$dataTransfer$items.length) > 0) setIsDragging(true);
|
|
279
203
|
};
|
|
280
|
-
|
|
281
204
|
var handleDragOut = function handleDragOut(e) {
|
|
282
205
|
// only if dragged items leave container (outside, not to childs)
|
|
283
206
|
if (!e.currentTarget.contains(e.relatedTarget)) setIsDragging(false);
|
|
284
207
|
};
|
|
285
|
-
|
|
286
208
|
var handleDrop = function handleDrop(e) {
|
|
287
209
|
e.preventDefault();
|
|
288
210
|
e.stopPropagation();
|
|
289
211
|
setIsDragging(false);
|
|
290
212
|
var filesObject = e.dataTransfer.files;
|
|
291
|
-
|
|
292
213
|
if ((filesObject === null || filesObject === void 0 ? void 0 : filesObject.length) > 0) {
|
|
293
214
|
var filesArray = Object.keys(filesObject).map(function (key) {
|
|
294
215
|
return filesObject[key];
|
|
@@ -296,75 +217,60 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
296
217
|
addFile(filesArray);
|
|
297
218
|
}
|
|
298
219
|
};
|
|
299
|
-
|
|
300
220
|
(0, _react.useEffect)(function () {
|
|
301
221
|
var getFiles = /*#__PURE__*/function () {
|
|
302
|
-
var
|
|
222
|
+
var _ref6 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
303
223
|
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();
|
|
224
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
225
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
226
|
+
case 0:
|
|
227
|
+
if (!value) {
|
|
228
|
+
_context5.next = 5;
|
|
229
|
+
break;
|
|
230
|
+
}
|
|
231
|
+
_context5.next = 3;
|
|
232
|
+
return Promise.all(value.map( /*#__PURE__*/function () {
|
|
233
|
+
var _ref7 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(file) {
|
|
234
|
+
var preview;
|
|
235
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
236
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
237
|
+
case 0:
|
|
238
|
+
if (!file.preview) {
|
|
239
|
+
_context4.next = 4;
|
|
240
|
+
break;
|
|
341
241
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
return
|
|
358
|
-
|
|
242
|
+
return _context4.abrupt("return", file);
|
|
243
|
+
case 4:
|
|
244
|
+
_context4.next = 6;
|
|
245
|
+
return getFilePreview(file.file);
|
|
246
|
+
case 6:
|
|
247
|
+
preview = _context4.sent;
|
|
248
|
+
return _context4.abrupt("return", _objectSpread(_objectSpread({}, file), {}, {
|
|
249
|
+
preview: preview
|
|
250
|
+
}));
|
|
251
|
+
case 8:
|
|
252
|
+
case "end":
|
|
253
|
+
return _context4.stop();
|
|
254
|
+
}
|
|
255
|
+
}, _callee4);
|
|
256
|
+
}));
|
|
257
|
+
return function (_x4) {
|
|
258
|
+
return _ref7.apply(this, arguments);
|
|
259
|
+
};
|
|
260
|
+
}()));
|
|
261
|
+
case 3:
|
|
262
|
+
valueFiles = _context5.sent;
|
|
263
|
+
setFiles(valueFiles);
|
|
264
|
+
case 5:
|
|
265
|
+
case "end":
|
|
266
|
+
return _context5.stop();
|
|
359
267
|
}
|
|
360
|
-
},
|
|
268
|
+
}, _callee5);
|
|
361
269
|
}));
|
|
362
|
-
|
|
363
270
|
return function getFiles() {
|
|
364
|
-
return
|
|
271
|
+
return _ref6.apply(this, arguments);
|
|
365
272
|
};
|
|
366
273
|
}();
|
|
367
|
-
|
|
368
274
|
getFiles();
|
|
369
275
|
}, [value]);
|
|
370
276
|
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
@@ -446,7 +352,6 @@ var DxcFileInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
446
352
|
});
|
|
447
353
|
}))), mode === "file" && !multiple && files.length === 1 && files[0].error && /*#__PURE__*/_react["default"].createElement(ErrorMessage, null, files[0].error)));
|
|
448
354
|
});
|
|
449
|
-
|
|
450
355
|
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
356
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
452
357
|
}, function (props) {
|
|
@@ -458,7 +363,6 @@ var FileInputContainer = _styledComponents["default"].div(_templateObject || (_t
|
|
|
458
363
|
}, function (props) {
|
|
459
364
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
460
365
|
});
|
|
461
|
-
|
|
462
366
|
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
367
|
return props.disabled ? props.theme.disabledLabelFontColor : props.theme.labelFontColor;
|
|
464
368
|
}, function (props) {
|
|
@@ -470,7 +374,6 @@ var Label = _styledComponents["default"].label(_templateObject2 || (_templateObj
|
|
|
470
374
|
}, function (props) {
|
|
471
375
|
return props.theme.labelLineHeight;
|
|
472
376
|
});
|
|
473
|
-
|
|
474
377
|
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
378
|
return props.disabled ? props.theme.disabledHelperTextFontcolor : props.theme.helperTextFontColor;
|
|
476
379
|
}, function (props) {
|
|
@@ -482,17 +385,12 @@ var HelperText = _styledComponents["default"].span(_templateObject3 || (_templat
|
|
|
482
385
|
}, function (props) {
|
|
483
386
|
return props.theme.helperTextLineHeight;
|
|
484
387
|
});
|
|
485
|
-
|
|
486
388
|
var FileContainer = _styledComponents["default"].div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n ", "\n margin-top: 0.25rem;\n"])), function (props) {
|
|
487
389
|
return props.singleFileMode ? "flex-direction: row; column-gap: 0.25rem;" : "flex-direction: column; row-gap: 0.25rem;";
|
|
488
390
|
});
|
|
489
|
-
|
|
490
391
|
var ValueInput = _styledComponents["default"].input(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: none;\n"])));
|
|
491
|
-
|
|
492
392
|
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
393
|
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
394
|
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
395
|
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
396
|
}, function (props) {
|
|
@@ -510,7 +408,6 @@ var DragDropArea = _styledComponents["default"].div(_templateObject8 || (_templa
|
|
|
510
408
|
}, function (props) {
|
|
511
409
|
return props.disabled && "not-allowed";
|
|
512
410
|
});
|
|
513
|
-
|
|
514
411
|
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
412
|
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
516
413
|
}, function (props) {
|
|
@@ -520,7 +417,6 @@ var DropzoneLabel = _styledComponents["default"].div(_templateObject9 || (_templ
|
|
|
520
417
|
}, function (props) {
|
|
521
418
|
return props.theme.dropLabelFontWeight;
|
|
522
419
|
});
|
|
523
|
-
|
|
524
420
|
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
421
|
return props.disabled ? props.theme.disabledDropLabelFontColor : props.theme.dropLabelFontColor;
|
|
526
422
|
}, function (props) {
|
|
@@ -530,7 +426,6 @@ var FiledropLabel = _styledComponents["default"].span(_templateObject10 || (_tem
|
|
|
530
426
|
}, function (props) {
|
|
531
427
|
return props.theme.dropLabelFontWeight;
|
|
532
428
|
});
|
|
533
|
-
|
|
534
429
|
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
430
|
return props.theme.errorMessageFontColor;
|
|
536
431
|
}, function (props) {
|
|
@@ -542,6 +437,4 @@ var ErrorMessage = _styledComponents["default"].div(_templateObject11 || (_templ
|
|
|
542
437
|
}, function (props) {
|
|
543
438
|
return props.theme.errorMessageLineHeight;
|
|
544
439
|
});
|
|
545
|
-
|
|
546
|
-
var _default = DxcFileInput;
|
|
547
|
-
exports["default"] = _default;
|
|
440
|
+
var _default = exports["default"] = DxcFileInput;
|