@widergy/energy-ui 2.7.3 → 2.7.5
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/CHANGELOG.md +14 -0
- package/dist/components/EnergyThemeProvider/index.js +1 -2
- package/dist/components/Loading/constants.js +1 -2
- package/dist/components/Loading/index.js +1 -2
- package/dist/components/Loading/theme.js +2 -3
- package/dist/components/UTAlert/AlertHandler.js +1 -2
- package/dist/components/UTAlert/index.js +1 -2
- package/dist/components/UTAlert/theme.js +3 -5
- package/dist/components/UTAttachment/components/Preview/index.js +1 -2
- package/dist/components/UTAttachment/constants.js +7 -13
- package/dist/components/UTAttachment/index.js +65 -42
- package/dist/components/UTAttachment/layout.js +10 -6
- package/dist/components/UTAttachment/styles.module.scss +1 -1
- package/dist/components/UTAttachment/theme.js +2 -3
- package/dist/components/UTAttachment/utils.js +30 -32
- package/dist/components/UTAutocomplete/components/ListBox/index.js +1 -2
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +2 -3
- package/dist/components/UTAutocomplete/constants.js +12 -23
- package/dist/components/UTAutocomplete/index.js +8 -3
- package/dist/components/UTAutocomplete/theme.js +10 -12
- package/dist/components/UTAvatar/constants.js +52 -28
- package/dist/components/UTAvatar/index.js +1 -2
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +1 -2
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -2
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +1 -2
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -6
- package/dist/components/UTBarChart/components/Bars/index.js +1 -2
- package/dist/components/UTBarChart/components/Legend/constants.js +4 -7
- package/dist/components/UTBarChart/components/Legend/index.js +4 -6
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -3
- package/dist/components/UTBarChart/components/Levels/index.js +1 -2
- package/dist/components/UTBarChart/components/Levels/utils.js +2 -3
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +3 -5
- package/dist/components/UTBarChart/components/LinearPlot/index.js +1 -2
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +3 -5
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -2
- package/dist/components/UTBarChart/components/Pagination/index.js +2 -3
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -4
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/index.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/index.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/utils.js +3 -5
- package/dist/components/UTBarChart/constants.js +4 -8
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +1 -2
- package/dist/components/UTBarChart/index.js +1 -2
- package/dist/components/UTBarChart/theme.js +2 -3
- package/dist/components/UTBarChart/types.js +10 -19
- package/dist/components/UTBarChart/utils.js +12 -23
- package/dist/components/UTBreadcrumbs/constants.js +7 -13
- package/dist/components/UTBreadcrumbs/index.js +1 -2
- package/dist/components/UTBreadcrumbs/theme.js +2 -3
- package/dist/components/UTButton/constants.js +6 -12
- package/dist/components/UTButton/index.js +2 -3
- package/dist/components/UTButton/styles.module.scss +6 -0
- package/dist/components/UTButton/theme.js +3 -5
- package/dist/components/UTCBUInput/index.js +1 -2
- package/dist/components/UTCBUInput/theme.js +2 -3
- package/dist/components/UTCaptcha/index.js +1 -2
- package/dist/components/UTCard/components/UTCardFooter/index.js +1 -2
- package/dist/components/UTCard/index.js +1 -2
- package/dist/components/UTCard/theme.js +2 -3
- package/dist/components/UTCard/types.js +2 -3
- package/dist/components/UTCarousel/components/Button/index.js +1 -2
- package/dist/components/UTCarousel/components/Legend/index.js +1 -2
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +1 -2
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -10
- package/dist/components/UTCarousel/components/Slider/index.js +1 -2
- package/dist/components/UTCarousel/components/Slider/layout.js +1 -2
- package/dist/components/UTCarousel/index.js +1 -2
- package/dist/components/UTCarousel/theme.js +2 -3
- package/dist/components/UTCheckList/constants.js +1 -2
- package/dist/components/UTCheckList/index.js +1 -2
- package/dist/components/UTCheckList/theme.js +7 -9
- package/dist/components/UTCheckbox/constants.js +2 -3
- package/dist/components/UTCheckbox/index.js +1 -2
- package/dist/components/UTCheckbox/theme.js +4 -6
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +1 -2
- package/dist/components/UTConsumptionBar/constants.js +3 -6
- package/dist/components/UTConsumptionBar/index.js +1 -2
- package/dist/components/UTCuit/index.js +1 -2
- package/dist/components/UTCuit/theme.js +4 -5
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -2
- package/dist/components/UTDatePicker/components/Day/index.js +1 -2
- package/dist/components/UTDatePicker/constants.js +11 -21
- package/dist/components/UTDatePicker/index.js +7 -3
- package/dist/components/UTDatePicker/theme.js +10 -8
- package/dist/components/UTDatePicker/types.js +2 -3
- package/dist/components/UTDatePicker/utils.js +3 -5
- package/dist/components/UTDialog/constants.js +2 -4
- package/dist/components/UTDialog/index.js +1 -2
- package/dist/components/UTDialog/theme.js +2 -3
- package/dist/components/UTDialog/types.js +2 -3
- package/dist/components/UTDotMenu/index.js +1 -2
- package/dist/components/UTEmojiPicker/constants.js +6 -11
- package/dist/components/UTEmojiPicker/index.js +1 -2
- package/dist/components/UTEmojiPicker/theme.js +2 -3
- package/dist/components/UTEmojiPicker/utils.js +3 -5
- package/dist/components/UTExternalLink/constants.js +3 -5
- package/dist/components/UTExternalLink/index.js +1 -2
- package/dist/components/UTExternalLink/theme.js +3 -5
- package/dist/components/UTFileInput/constants.js +2 -4
- package/dist/components/UTFileInput/index.js +1 -2
- package/dist/components/UTFileInput/layout.js +1 -2
- package/dist/components/UTIconButton/index.js +1 -2
- package/dist/components/UTIconButton/theme.js +2 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +1 -2
- package/dist/components/UTImageRadio/constants.js +3 -6
- package/dist/components/UTImageRadio/index.js +1 -2
- package/dist/components/UTImageRadio/theme.js +2 -3
- package/dist/components/UTImageRadio/types.js +2 -3
- package/dist/components/UTImageRadio/utils.js +3 -5
- package/dist/components/UTLabel/constants.js +9 -17
- package/dist/components/UTLabel/index.js +1 -2
- package/dist/components/UTLabel/theme.js +4 -7
- package/dist/components/UTList/index.js +1 -2
- package/dist/components/UTLoading/index.js +1 -2
- package/dist/components/UTMap/components/GoogleMaps/constants.js +3 -5
- package/dist/components/UTMap/components/GoogleMaps/index.js +1 -2
- package/dist/components/UTMap/components/GoogleMaps/styles.js +2 -3
- package/dist/components/UTMap/constants.js +6 -12
- package/dist/components/UTMap/index.js +1 -2
- package/dist/components/UTMap/types.js +3 -5
- package/dist/components/UTMap/utils.js +7 -13
- package/dist/components/UTMap/withGoogleMapScript.js +1 -2
- package/dist/components/UTMenu/index.js +50 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +5 -9
- package/dist/components/UTModal/constants.js +4 -8
- package/dist/components/UTModal/index.js +1 -2
- package/dist/components/UTModal/theme.js +2 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +1 -2
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +2 -3
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +1 -2
- package/dist/components/UTPagination/components/Pagination/index.js +1 -2
- package/dist/components/UTPagination/components/Pagination/utils.js +2 -3
- package/dist/components/UTPagination/constants.js +3 -6
- package/dist/components/UTPagination/index.js +1 -2
- package/dist/components/UTPagination/theme.js +2 -3
- package/dist/components/UTPanel/index.js +1 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +1 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +1 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +1 -2
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +1 -2
- package/dist/components/UTPasswordField/index.js +1 -2
- package/dist/components/UTPasswordField/theme.js +2 -3
- package/dist/components/UTPhoneInput/constants.js +3 -6
- package/dist/components/UTPhoneInput/index.js +1 -2
- package/dist/components/UTPhoneInput/theme.js +6 -8
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -8
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +1 -2
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -6
- package/dist/components/UTPieChart/components/Legend/index.js +1 -2
- package/dist/components/UTPieChart/constants.js +13 -26
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +1 -2
- package/dist/components/UTPieChart/index.js +1 -2
- package/dist/components/UTPieChart/theme.js +2 -3
- package/dist/components/UTPieChart/utils.js +2 -3
- package/dist/components/UTProgressBar/constants.js +2 -4
- package/dist/components/UTProgressBar/index.js +1 -2
- package/dist/components/UTProgressBar/theme.js +2 -3
- package/dist/components/UTProgressBar/types.js +2 -3
- package/dist/components/UTRadioGroup/index.js +1 -2
- package/dist/components/UTRadioGroup/theme.js +5 -7
- package/dist/components/UTRating/components/Circle/index.js +1 -2
- package/dist/components/UTRating/components/Star/index.js +1 -2
- package/dist/components/UTRating/constants.js +4 -8
- package/dist/components/UTRating/index.js +1 -2
- package/dist/components/UTRating/theme.js +2 -3
- package/dist/components/UTRipple/Ripple.js +1 -2
- package/dist/components/UTRipple/index.js +1 -2
- package/dist/components/UTSelect/components/Option/index.js +1 -2
- package/dist/components/UTSelect/constants.js +4 -8
- package/dist/components/UTSelect/index.js +2 -3
- package/dist/components/UTSelect/stylesJS.js +2 -3
- package/dist/components/UTSelect/theme.js +6 -8
- package/dist/components/UTSelect/utils.js +2 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +14 -10
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +1 -2
- package/dist/components/UTSidebar/components/LogosContainer/index.js +1 -2
- package/dist/components/UTSidebar/components/Option/constants.js +2 -3
- package/dist/components/UTSidebar/components/Option/index.js +1 -2
- package/dist/components/UTSidebar/components/Toggler/index.js +1 -2
- package/dist/components/UTSidebar/index.js +2 -3
- package/dist/components/UTSidebar/theme.js +2 -3
- package/dist/components/UTSidebar/types.js +5 -10
- package/dist/components/UTSkeleton/index.js +1 -2
- package/dist/components/UTStatus/constants.js +5 -9
- package/dist/components/UTStatus/index.js +1 -2
- package/dist/components/UTStatus/theme.js +5 -9
- package/dist/components/UTSwitch/constants.js +3 -6
- package/dist/components/UTSwitch/index.js +1 -2
- package/dist/components/UTSwitch/theme.js +2 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -2
- package/dist/components/UTTable/components/ActionIcons/index.js +2 -3
- package/dist/components/UTTable/components/ActionIcons/styles.module.scss +7 -5
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +1 -2
- package/dist/components/UTTable/components/Cell/index.js +1 -2
- package/dist/components/UTTable/components/HeaderCell/constants.js +2 -3
- package/dist/components/UTTable/components/HeaderCell/index.js +1 -2
- package/dist/components/UTTable/components/HeaderCell/utils.js +2 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +1 -2
- package/dist/components/UTTable/components/ResponsiveCell/index.js +1 -2
- package/dist/components/UTTable/components/Status/index.js +1 -2
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +1 -2
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +2 -3
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +1 -2
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +1 -2
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +2 -3
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -2
- package/dist/components/UTTable/components/TableFooter/index.js +1 -2
- package/dist/components/UTTable/components/TableHeader/index.js +2 -3
- package/dist/components/UTTable/components/TableHeader/styles.module.scss +5 -0
- package/dist/components/UTTable/components/TableRow/constants.js +2 -3
- package/dist/components/UTTable/components/TableRow/index.js +1 -2
- package/dist/components/UTTable/constants.js +19 -38
- package/dist/components/UTTable/hook.js +2 -3
- package/dist/components/UTTable/index.js +1 -2
- package/dist/components/UTTable/theme.js +16 -9
- package/dist/components/UTTable/types.js +4 -8
- package/dist/components/UTTable/utils.js +10 -19
- package/dist/components/UTTabs/components/TooltipTab/index.js +1 -2
- package/dist/components/UTTabs/constants.js +4 -8
- package/dist/components/UTTabs/index.js +1 -2
- package/dist/components/UTTabs/theme.js +2 -3
- package/dist/components/UTTabs/utils.js +2 -3
- package/dist/components/UTTextArea/constants.js +2 -3
- package/dist/components/UTTextArea/index.js +6 -5
- package/dist/components/UTTextArea/theme.js +4 -5
- package/dist/components/UTTextInput/constants.js +2 -3
- package/dist/components/UTTextInput/index.js +1 -2
- package/dist/components/UTTextInput/theme.js +6 -8
- package/dist/components/UTThirdPartyCookieChecker/index.js +1 -2
- package/dist/components/UTToggle/components/ToggleOption/index.js +1 -2
- package/dist/components/UTToggle/index.js +1 -2
- package/dist/components/UTToggle/theme.js +2 -3
- package/dist/components/UTTooltip/index.js +1 -2
- package/dist/components/UTTooltip/theme.js +2 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +1 -2
- package/dist/components/UTTopbar/components/UserMenu/index.js +3 -3
- package/dist/components/UTTopbar/index.js +9 -8
- package/dist/components/UTTopbar/theme.js +36 -45
- package/dist/components/UTTopbar/types.js +5 -9
- package/dist/components/UTTouchableWithoutFeedback/index.js +1 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +1 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +2 -3
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -12
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +1 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +1 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +1 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +8 -15
- package/dist/components/UTVirtualizedList/constants.js +4 -8
- package/dist/components/UTVirtualizedList/index.js +1 -2
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +1 -2
- package/dist/components/UTWorkflowContainer/constants.js +4 -12
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +2 -3
- package/dist/components/UTWorkflowContainer/index.js +8 -12
- package/dist/components/UTWorkflowContainer/styles.module.scss +1 -1
- package/dist/components/UTWorkflowContainer/theme.js +2 -3
- package/dist/components/UTWorkflowContainer/types.js +2 -3
- package/dist/components/WithLoading/index.js +1 -2
- package/dist/components/WithTheme/index.js +1 -2
- package/dist/components/WithTheme/layout.js +1 -2
- package/dist/components/WithTouch/index.js +1 -2
- package/dist/constants/UTTable.js +2 -3
- package/dist/theme.js +3 -6
- package/dist/types/commonTypes.js +3 -5
- package/dist/types/consumptionTypes.js +3 -5
- package/dist/types/formTypes.js +7 -10
- package/dist/types/tableTypes.js +2 -3
- package/dist/utils/classesUtils.js +3 -5
- package/dist/utils/componentUtils.js +2 -3
- package/dist/utils/helperFunctions.js +2 -3
- package/dist/utils/shadowUtils.js +2 -3
- package/dist/utils/useScreenSize.js +2 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [2.7.5](https://github.com/widergy/energy-ui/compare/v2.7.4...v2.7.5) (2023-10-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* fixes on error labels + utsidebar ([#346](https://github.com/widergy/energy-ui/issues/346)) ([45641ce](https://github.com/widergy/energy-ui/commit/45641cea1a2f3091ca842b47c20a2ed9088b1b9e))
|
|
7
|
+
|
|
8
|
+
## [2.7.4](https://github.com/widergy/energy-ui/compare/v2.7.3...v2.7.4) (2023-09-20)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add prepublish hook ([#381](https://github.com/widergy/energy-ui/issues/381)) ([e6a6f84](https://github.com/widergy/energy-ui/commit/e6a6f84a33eb583c959a2a813943f7502931c52e))
|
|
14
|
+
|
|
1
15
|
## [2.7.3](https://github.com/widergy/energy-ui/compare/v2.7.2...v2.7.3) (2023-09-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DEFAULT_LOADING_TEXT = void 0;
|
|
7
|
-
var DEFAULT_LOADING_TEXT = 'Cargando';
|
|
8
|
-
exports.DEFAULT_LOADING_TEXT = DEFAULT_LOADING_TEXT;
|
|
7
|
+
var DEFAULT_LOADING_TEXT = exports.DEFAULT_LOADING_TEXT = 'Cargando';
|
|
@@ -43,5 +43,4 @@ Loading.propTypes = {
|
|
|
43
43
|
className: _propTypes.string,
|
|
44
44
|
textClassName: _propTypes.string
|
|
45
45
|
};
|
|
46
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(Loading);
|
|
47
|
-
exports.default = _default;
|
|
46
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(Loading);
|
|
@@ -7,7 +7,7 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var retrieveStyle = function retrieveStyle(_ref) {
|
|
10
|
+
var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
11
11
|
var theme = _ref.theme;
|
|
12
12
|
return {
|
|
13
13
|
base: {
|
|
@@ -18,5 +18,4 @@ var retrieveStyle = function retrieveStyle(_ref) {
|
|
|
18
18
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['Loading', 'text', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium']))
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
};
|
|
22
|
-
exports.retrieveStyle = retrieveStyle;
|
|
21
|
+
};
|
|
@@ -155,5 +155,4 @@ UTAlert.defaultProps = {
|
|
|
155
155
|
},
|
|
156
156
|
classes: {}
|
|
157
157
|
};
|
|
158
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTAlert);
|
|
159
|
-
exports.default = _default;
|
|
158
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTAlert);
|
|
@@ -8,7 +8,7 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var retrieveStyle = function retrieveStyle(_ref) {
|
|
11
|
+
var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
12
12
|
var _theme$Palette, _theme$Palette2, _theme$Palette3, _theme$Palette4;
|
|
13
13
|
var theme = _ref.theme;
|
|
14
14
|
return {
|
|
@@ -37,8 +37,7 @@ var retrieveStyle = function retrieveStyle(_ref) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
|
-
exports.
|
|
41
|
-
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
40
|
+
var retrieveMuiTheme = exports.retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
42
41
|
return (0, _styles.createTheme)({
|
|
43
42
|
typography: {
|
|
44
43
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
@@ -74,5 +73,4 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
});
|
|
77
|
-
};
|
|
78
|
-
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
76
|
+
};
|
|
@@ -5,19 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.previewPropType = exports.SIZE_ERROR_TEXT = exports.FORMAT_ERROR_TEXT = exports.DEFAULT_UPLOADING_TEXT = exports.DEFAULT_ATTACHMENT_NAME = exports.ASPECT_RATIO_ERROR_TEXT = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
var FORMAT_ERROR_TEXT = 'El formato de archivo es inválido';
|
|
9
|
-
exports.
|
|
10
|
-
var
|
|
11
|
-
exports.
|
|
12
|
-
var
|
|
13
|
-
exports.
|
|
14
|
-
var DEFAULT_UPLOADING_TEXT = 'Cargando';
|
|
15
|
-
exports.DEFAULT_UPLOADING_TEXT = DEFAULT_UPLOADING_TEXT;
|
|
16
|
-
var DEFAULT_ATTACHMENT_NAME = 'Adjunto';
|
|
17
|
-
exports.DEFAULT_ATTACHMENT_NAME = DEFAULT_ATTACHMENT_NAME;
|
|
18
|
-
var previewPropType = (0, _propTypes.shape)({
|
|
8
|
+
var FORMAT_ERROR_TEXT = exports.FORMAT_ERROR_TEXT = 'El formato de archivo es inválido';
|
|
9
|
+
var SIZE_ERROR_TEXT = exports.SIZE_ERROR_TEXT = 'El archivo excede el tamaño máximo de ';
|
|
10
|
+
var ASPECT_RATIO_ERROR_TEXT = exports.ASPECT_RATIO_ERROR_TEXT = 'El formato de archivo es inválido. (Válidos:';
|
|
11
|
+
var DEFAULT_UPLOADING_TEXT = exports.DEFAULT_UPLOADING_TEXT = 'Cargando';
|
|
12
|
+
var DEFAULT_ATTACHMENT_NAME = exports.DEFAULT_ATTACHMENT_NAME = 'Adjunto';
|
|
13
|
+
var previewPropType = exports.previewPropType = (0, _propTypes.shape)({
|
|
19
14
|
audio: _propTypes.object,
|
|
20
15
|
image: _propTypes.object,
|
|
21
16
|
video: _propTypes.object
|
|
22
|
-
});
|
|
23
|
-
exports.previewPropType = previewPropType;
|
|
17
|
+
});
|
|
@@ -39,7 +39,6 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
39
39
|
_inherits(AttachmentContainer, _Component);
|
|
40
40
|
var _super = _createSuper(AttachmentContainer);
|
|
41
41
|
function AttachmentContainer() {
|
|
42
|
-
var _ref, _ref2;
|
|
43
42
|
var _this;
|
|
44
43
|
_classCallCheck(this, AttachmentContainer);
|
|
45
44
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -98,8 +97,8 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
98
97
|
var input = _this.props.input;
|
|
99
98
|
return input.value && _typeof(input.value) === 'object' && (0, _utils.isValidFile)(input.value.file);
|
|
100
99
|
});
|
|
101
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (
|
|
102
|
-
|
|
100
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", /*#__PURE__*/function () {
|
|
101
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ev) {
|
|
103
102
|
var _this$props$allowedPD;
|
|
104
103
|
var file, _this$props3, resizeConfig, disableResize, fileErrorTexts, validation;
|
|
105
104
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -118,65 +117,83 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
118
117
|
error: false
|
|
119
118
|
});
|
|
120
119
|
if (!file) {
|
|
121
|
-
_context.next =
|
|
120
|
+
_context.next = 33;
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
_context.t0 = !_this.props.customValidation;
|
|
124
|
+
if (_context.t0) {
|
|
125
|
+
_context.next = 10;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
_context.next = 9;
|
|
129
|
+
return _this.props.customValidation(file, _this.onFailValidation);
|
|
130
|
+
case 9:
|
|
131
|
+
_context.t0 = _context.sent;
|
|
132
|
+
case 10:
|
|
133
|
+
validation = _context.t0;
|
|
134
|
+
if (!validation) {
|
|
135
|
+
_context.next = 33;
|
|
122
136
|
break;
|
|
123
137
|
}
|
|
124
|
-
_context.next =
|
|
138
|
+
_context.next = 14;
|
|
125
139
|
return (0, _validate.fileSignatureValidation)(file, _this.props.fieldTypes, file.type);
|
|
126
|
-
case
|
|
140
|
+
case 14:
|
|
127
141
|
validation = _context.sent;
|
|
128
142
|
if (!validation) {
|
|
129
|
-
_context.next =
|
|
143
|
+
_context.next = 32;
|
|
130
144
|
break;
|
|
131
145
|
}
|
|
132
146
|
if (!_this.props.sanitize) {
|
|
133
|
-
_context.next =
|
|
147
|
+
_context.next = 20;
|
|
134
148
|
break;
|
|
135
149
|
}
|
|
136
|
-
_context.next =
|
|
150
|
+
_context.next = 19;
|
|
137
151
|
return _this.props.sanitize(file);
|
|
138
|
-
case
|
|
152
|
+
case 19:
|
|
139
153
|
file = _context.sent;
|
|
140
|
-
case
|
|
154
|
+
case 20:
|
|
141
155
|
validation = (0, _validate.fileSizeValidation)(file, _this.props.maxFileSize);
|
|
142
156
|
if (!(validation && (0, _utils.isPDF)(file) && !(0, _array.isEmpty)(_this.props.allowedPDFUploadSizes))) {
|
|
143
|
-
_context.next =
|
|
157
|
+
_context.next = 26;
|
|
144
158
|
break;
|
|
145
159
|
}
|
|
146
|
-
_context.next =
|
|
160
|
+
_context.next = 24;
|
|
147
161
|
return (0, _utils.pdfAspectRatioValidation)(file, _this.props.allowedPDFUploadSizes);
|
|
148
|
-
case
|
|
162
|
+
case 24:
|
|
149
163
|
validation = _context.sent;
|
|
150
164
|
return _context.abrupt("return", validation ? _this.setFile(file) : _this.onFailValidation(fileErrorTexts.aspectRatioError));
|
|
151
|
-
case
|
|
165
|
+
case 26:
|
|
152
166
|
if (!(!validation && !disableResize && (0, _utils.isImage)(file) && !(0, _browser.isIE)())) {
|
|
153
|
-
_context.next =
|
|
167
|
+
_context.next = 31;
|
|
154
168
|
break;
|
|
155
169
|
}
|
|
156
|
-
_context.next =
|
|
170
|
+
_context.next = 29;
|
|
157
171
|
return (0, _image.resizeImage)(file, resizeConfig);
|
|
158
|
-
case
|
|
172
|
+
case 29:
|
|
159
173
|
file = _context.sent;
|
|
160
174
|
validation = (0, _validate.fileSizeValidation)(file, _this.props.maxFileSize);
|
|
161
|
-
case
|
|
175
|
+
case 31:
|
|
162
176
|
return _context.abrupt("return", validation ? _this.setFile(file) : _this.onFailValidation(fileErrorTexts.sizeError));
|
|
163
|
-
case
|
|
177
|
+
case 32:
|
|
164
178
|
_this.onFailValidation(fileErrorTexts.formatError);
|
|
165
|
-
case
|
|
179
|
+
case 33:
|
|
166
180
|
case "end":
|
|
167
181
|
return _context.stop();
|
|
168
182
|
}
|
|
169
183
|
}, _callee);
|
|
170
|
-
}))
|
|
171
|
-
|
|
184
|
+
}));
|
|
185
|
+
return function (_x) {
|
|
186
|
+
return _ref.apply(this, arguments);
|
|
187
|
+
};
|
|
188
|
+
}());
|
|
172
189
|
_defineProperty(_assertThisInitialized(_this), "onFailValidation", function (errorMessage) {
|
|
173
190
|
return _this.setState({
|
|
174
191
|
error: true,
|
|
175
192
|
errorText: errorMessage
|
|
176
193
|
});
|
|
177
194
|
});
|
|
178
|
-
_defineProperty(_assertThisInitialized(_this), "setFile", function (
|
|
179
|
-
|
|
195
|
+
_defineProperty(_assertThisInitialized(_this), "setFile", /*#__PURE__*/function () {
|
|
196
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(file) {
|
|
180
197
|
var _this$props4, onChange, onLoaded;
|
|
181
198
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
182
199
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -199,8 +216,11 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
199
216
|
return _context2.stop();
|
|
200
217
|
}
|
|
201
218
|
}, _callee2);
|
|
202
|
-
}))
|
|
203
|
-
|
|
219
|
+
}));
|
|
220
|
+
return function (_x2) {
|
|
221
|
+
return _ref2.apply(this, arguments);
|
|
222
|
+
};
|
|
223
|
+
}());
|
|
204
224
|
_defineProperty(_assertThisInitialized(_this), "buildPreview", function (file) {
|
|
205
225
|
var reader = new FileReader();
|
|
206
226
|
reader.onload = function (e) {
|
|
@@ -227,6 +247,7 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
227
247
|
key: "render",
|
|
228
248
|
value: function render() {
|
|
229
249
|
var _this$props5 = this.props,
|
|
250
|
+
acceptedFileTypes = _this$props5.acceptedFileTypes,
|
|
230
251
|
classes = _this$props5.classes,
|
|
231
252
|
containerClassname = _this$props5.containerClassname,
|
|
232
253
|
disabled = _this$props5.disabled,
|
|
@@ -247,31 +268,33 @@ var AttachmentContainer = /*#__PURE__*/function (_Component) {
|
|
|
247
268
|
errorText = _this$state.errorText;
|
|
248
269
|
var loadingDefaultValue = this.hasDefaultValueToLoad() && !name;
|
|
249
270
|
return /*#__PURE__*/_react.default.createElement(_layout.default, {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
name: name || this.getDefaultAttachment(input.value),
|
|
253
|
-
previewClassname: previewClassname,
|
|
271
|
+
acceptedFileTypes: acceptedFileTypes,
|
|
272
|
+
classes: classes,
|
|
254
273
|
containerClassname: containerClassname,
|
|
255
|
-
|
|
256
|
-
onChange: this.onChange,
|
|
257
|
-
onClick: this.removeValue,
|
|
274
|
+
disabled: disabled,
|
|
258
275
|
error: error,
|
|
276
|
+
errorClassname: errorClassname,
|
|
259
277
|
errorText: errorText,
|
|
260
278
|
fieldTypes: fieldTypes,
|
|
279
|
+
icon: icon,
|
|
280
|
+
loading: loading || loadingDefaultValue,
|
|
261
281
|
loadingTextClassname: loadingTextClassname,
|
|
262
|
-
|
|
263
|
-
|
|
282
|
+
name: name || this.getDefaultAttachment(input.value),
|
|
283
|
+
preview: preview,
|
|
284
|
+
previewClassname: previewClassname,
|
|
285
|
+
previewProps: previewProps,
|
|
286
|
+
onChange: this.onChange,
|
|
287
|
+
onClick: this.removeValue,
|
|
264
288
|
removeFileClassname: removeFileClassname,
|
|
265
|
-
icon: icon,
|
|
266
|
-
disabled: disabled,
|
|
267
289
|
RemoveIcon: RemoveIcon,
|
|
268
|
-
|
|
290
|
+
uploadingText: loadingDefaultValue ? _constants.DEFAULT_UPLOADING_TEXT : ''
|
|
269
291
|
});
|
|
270
292
|
}
|
|
271
293
|
}]);
|
|
272
294
|
return AttachmentContainer;
|
|
273
295
|
}(_react.Component);
|
|
274
296
|
AttachmentContainer.propTypes = {
|
|
297
|
+
acceptedFileTypes: _propTypes.string,
|
|
275
298
|
allowedPDFUploadSizes: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
276
299
|
name: _propTypes.string,
|
|
277
300
|
heightInPt: _propTypes.number,
|
|
@@ -280,10 +303,11 @@ AttachmentContainer.propTypes = {
|
|
|
280
303
|
})),
|
|
281
304
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
282
305
|
containerClassname: _propTypes.string,
|
|
306
|
+
customValidation: _propTypes.func,
|
|
283
307
|
disabled: _propTypes.bool,
|
|
284
308
|
disableResize: _propTypes.bool,
|
|
285
309
|
errorClassname: _propTypes.string,
|
|
286
|
-
fieldTypes: (0, _propTypes.arrayOf)(_propTypes.string)
|
|
310
|
+
fieldTypes: (0, _propTypes.arrayOf)(_propTypes.string),
|
|
287
311
|
icon: _propTypes.node,
|
|
288
312
|
input: (0, _propTypes.shape)({
|
|
289
313
|
value: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.shape)({
|
|
@@ -309,5 +333,4 @@ AttachmentContainer.propTypes = {
|
|
|
309
333
|
AttachmentContainer.defaultProps = {
|
|
310
334
|
maxFileSize: 99999999
|
|
311
335
|
};
|
|
312
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(AttachmentContainer);
|
|
313
|
-
exports.default = _default;
|
|
336
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(AttachmentContainer);
|
|
@@ -16,7 +16,8 @@ var _constants = require("./constants");
|
|
|
16
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
var Attachment = function Attachment(_ref) {
|
|
19
|
-
var
|
|
19
|
+
var acceptedFileTypes = _ref.acceptedFileTypes,
|
|
20
|
+
name = _ref.name,
|
|
20
21
|
preview = _ref.preview,
|
|
21
22
|
loading = _ref.loading,
|
|
22
23
|
containerClassname = _ref.containerClassname,
|
|
@@ -35,7 +36,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
35
36
|
uploadingText = _ref.uploadingText,
|
|
36
37
|
RemoveIcon = _ref.RemoveIcon,
|
|
37
38
|
previewProps = _ref.previewProps;
|
|
38
|
-
var fieldType = fieldTypes.map(function (type) {
|
|
39
|
+
var fieldType = acceptedFileTypes || fieldTypes.map(function (type) {
|
|
39
40
|
return _files.inputFiles[type].inputType;
|
|
40
41
|
}).join();
|
|
41
42
|
var Icon = RemoveIcon || _DeleteForever.default;
|
|
@@ -51,10 +52,13 @@ var Attachment = function Attachment(_ref) {
|
|
|
51
52
|
variant: "small",
|
|
52
53
|
className: _stylesModule.default.name
|
|
53
54
|
}, name), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
54
|
-
|
|
55
|
+
classNames: {
|
|
56
|
+
root: "".concat(_stylesModule.default.removeIconContainer, " ").concat(removeFileClassname)
|
|
57
|
+
},
|
|
58
|
+
disabled: disabled,
|
|
55
59
|
Icon: Icon,
|
|
56
60
|
onClick: onClick,
|
|
57
|
-
|
|
61
|
+
size: "small",
|
|
58
62
|
variant: "text"
|
|
59
63
|
}))) : /*#__PURE__*/_react.default.createElement(_UTFileInput.default, {
|
|
60
64
|
onChange: onChange,
|
|
@@ -72,6 +76,7 @@ var Attachment = function Attachment(_ref) {
|
|
|
72
76
|
});
|
|
73
77
|
};
|
|
74
78
|
Attachment.propTypes = {
|
|
79
|
+
acceptedFileTypes: _propTypes.string,
|
|
75
80
|
name: _propTypes.string,
|
|
76
81
|
preview: (0, _propTypes.shape)({
|
|
77
82
|
src: _propTypes.string,
|
|
@@ -95,5 +100,4 @@ Attachment.propTypes = {
|
|
|
95
100
|
RemoveIcon: _propTypes.elementType,
|
|
96
101
|
previewProps: _constants.previewPropType
|
|
97
102
|
};
|
|
98
|
-
var _default = Attachment;
|
|
99
|
-
exports.default = _default;
|
|
103
|
+
var _default = exports.default = Attachment;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var retrieveStyle = function retrieveStyle(_ref) {
|
|
8
|
+
var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
9
9
|
var theme = _ref.theme;
|
|
10
10
|
return {
|
|
11
11
|
container: {
|
|
@@ -20,5 +20,4 @@ var retrieveStyle = function retrieveStyle(_ref) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
};
|
|
24
|
-
exports.retrieveStyle = retrieveStyle;
|
|
23
|
+
};
|
|
@@ -5,14 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.pdfAspectRatioValidation = exports.isVideo = exports.isValidFile = exports.isPDF = exports.isNewFile = exports.isImage = exports.isHTML = exports.isAudio = exports.hasPreview = exports.getBlobFromUrl = void 0;
|
|
7
7
|
var _files = require("@widergy/web-utils/lib/constants/files");
|
|
8
|
-
var _ref, _ref2, _ref3;
|
|
9
8
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
9
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
11
10
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
11
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
12
|
if (window['pdfjs-dist/build/pdf']) window['pdfjs-dist/build/pdf'].GlobalWorkerOptions.workerSrc = "//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(window['pdfjs-dist/build/pdf'].version, "/pdf.worker.js");
|
|
14
|
-
var getImage = function
|
|
15
|
-
|
|
13
|
+
var getImage = /*#__PURE__*/function () {
|
|
14
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(imageUrl) {
|
|
16
15
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
17
16
|
while (1) switch (_context.prev = _context.next) {
|
|
18
17
|
case 0:
|
|
@@ -26,11 +25,14 @@ var getImage = function getImage(_x) {
|
|
|
26
25
|
return _context.stop();
|
|
27
26
|
}
|
|
28
27
|
}, _callee);
|
|
29
|
-
}))
|
|
30
|
-
|
|
28
|
+
}));
|
|
29
|
+
return function getImage(_x) {
|
|
30
|
+
return _ref.apply(this, arguments);
|
|
31
|
+
};
|
|
32
|
+
}(); // eslint-disable-line no-console
|
|
31
33
|
|
|
32
|
-
var getBlobFromUrl = function
|
|
33
|
-
|
|
34
|
+
var getBlobFromUrl = exports.getBlobFromUrl = /*#__PURE__*/function () {
|
|
35
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(imageUrl, callback) {
|
|
34
36
|
var response;
|
|
35
37
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
36
38
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -53,9 +55,11 @@ var getBlobFromUrl = function getBlobFromUrl(_x2, _x3) {
|
|
|
53
55
|
return _context2.stop();
|
|
54
56
|
}
|
|
55
57
|
}, _callee2);
|
|
56
|
-
}))
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
}));
|
|
59
|
+
return function getBlobFromUrl(_x2, _x3) {
|
|
60
|
+
return _ref2.apply(this, arguments);
|
|
61
|
+
};
|
|
62
|
+
}();
|
|
59
63
|
var lengthMatches = function lengthMatches(length1, length2, toleranceInPercentage) {
|
|
60
64
|
var delta = length1 * (toleranceInPercentage / 100);
|
|
61
65
|
return Math.abs(length1 - length2) < delta;
|
|
@@ -68,8 +72,8 @@ var pageMatches = function pageMatches(page, allowedPDFUploadSizes) {
|
|
|
68
72
|
return lengthMatches(size.heightInPt, viewport.height, size.toleranceInPercentage) && lengthMatches(size.widthInPt, viewport.width, size.toleranceInPercentage) || lengthMatches(size.heightInPt, viewport.width, size.toleranceInPercentage) && lengthMatches(size.widthInPt, viewport.height, size.toleranceInPercentage);
|
|
69
73
|
});
|
|
70
74
|
};
|
|
71
|
-
var pdfAspectRatioValidation = function
|
|
72
|
-
|
|
75
|
+
var pdfAspectRatioValidation = exports.pdfAspectRatioValidation = /*#__PURE__*/function () {
|
|
76
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(file, allowedPDFUploadSizes) {
|
|
73
77
|
var documentLoadingTask, document, totalPages, getPagePromises, pageNumber, pages;
|
|
74
78
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
75
79
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -96,38 +100,33 @@ var pdfAspectRatioValidation = function pdfAspectRatioValidation(_x4, _x5) {
|
|
|
96
100
|
return _context3.stop();
|
|
97
101
|
}
|
|
98
102
|
}, _callee3);
|
|
99
|
-
}))
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
+
}));
|
|
104
|
+
return function pdfAspectRatioValidation(_x4, _x5) {
|
|
105
|
+
return _ref3.apply(this, arguments);
|
|
106
|
+
};
|
|
107
|
+
}();
|
|
108
|
+
var isImage = exports.isImage = function isImage(file) {
|
|
103
109
|
return _files.inputFiles.image.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
104
110
|
};
|
|
105
|
-
exports.
|
|
106
|
-
var isPDF = function isPDF(file) {
|
|
111
|
+
var isPDF = exports.isPDF = function isPDF(file) {
|
|
107
112
|
return _files.inputFiles.pdf.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
108
113
|
};
|
|
109
|
-
exports.
|
|
110
|
-
var isAudio = function isAudio(file) {
|
|
114
|
+
var isAudio = exports.isAudio = function isAudio(file) {
|
|
111
115
|
return _files.inputFiles.audio.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
112
116
|
};
|
|
113
|
-
exports.
|
|
114
|
-
var isVideo = function isVideo(file) {
|
|
117
|
+
var isVideo = exports.isVideo = function isVideo(file) {
|
|
115
118
|
return _files.inputFiles.video.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
116
119
|
};
|
|
117
|
-
exports.
|
|
118
|
-
var isHTML = function isHTML(file) {
|
|
120
|
+
var isHTML = exports.isHTML = function isHTML(file) {
|
|
119
121
|
return _files.inputFiles.html.validType.includes(file === null || file === void 0 ? void 0 : file.type);
|
|
120
122
|
};
|
|
121
|
-
exports.
|
|
122
|
-
var hasPreview = function hasPreview(file) {
|
|
123
|
+
var hasPreview = exports.hasPreview = function hasPreview(file) {
|
|
123
124
|
return isImage(file) || isAudio(file) || isVideo(file);
|
|
124
125
|
};
|
|
125
|
-
exports.
|
|
126
|
-
var isValidFile = function isValidFile(file) {
|
|
126
|
+
var isValidFile = exports.isValidFile = function isValidFile(file) {
|
|
127
127
|
return hasPreview(file) || isPDF(file) || isHTML(file);
|
|
128
128
|
};
|
|
129
|
-
exports.
|
|
130
|
-
var isNewFile = function isNewFile(newFile, oldFile) {
|
|
129
|
+
var isNewFile = exports.isNewFile = function isNewFile(newFile, oldFile) {
|
|
131
130
|
var _newFile$file, _oldFile$file;
|
|
132
131
|
if (!newFile && !oldFile) return false;
|
|
133
132
|
if (!newFile || !oldFile) return true;
|
|
@@ -136,5 +135,4 @@ var isNewFile = function isNewFile(newFile, oldFile) {
|
|
|
136
135
|
if (newFileType !== oldFileType) return true;
|
|
137
136
|
if (newFileType === 'string') return newFile !== oldFile;
|
|
138
137
|
return ((_newFile$file = newFile.file) === null || _newFile$file === void 0 ? void 0 : _newFile$file.lastModified) !== ((_oldFile$file = oldFile.file) === null || _oldFile$file === void 0 ? void 0 : _oldFile$file.lastModified);
|
|
139
|
-
};
|
|
140
|
-
exports.isNewFile = isNewFile;
|
|
138
|
+
};
|
|
@@ -46,5 +46,4 @@ var Listbox = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
46
46
|
Listbox.propTypes = {
|
|
47
47
|
fixedSizeListProps: _propTypes.object
|
|
48
48
|
};
|
|
49
|
-
var _default = /*#__PURE__*/(0, _react.memo)(Listbox);
|
|
50
|
-
exports.default = _default;
|
|
49
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(Listbox);
|
|
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
15
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
-
var renderRow = function renderRow(_ref) {
|
|
16
|
+
var renderRow = exports.renderRow = function renderRow(_ref) {
|
|
17
17
|
var data = _ref.data,
|
|
18
18
|
index = _ref.index,
|
|
19
19
|
style = _ref.style;
|
|
@@ -21,5 +21,4 @@ var renderRow = function renderRow(_ref) {
|
|
|
21
21
|
style: _objectSpread({}, style),
|
|
22
22
|
className: "".concat(data[index].props.className, " ").concat(_stylesModule.default.rowRender)
|
|
23
23
|
});
|
|
24
|
-
};
|
|
25
|
-
exports.renderRow = renderRow;
|
|
24
|
+
};
|
|
@@ -4,29 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ROW_HEIGHT = exports.OPEN_TEXT = exports.MIN_ROW_HEIGHT_FACTOR = exports.MAX_HEIGHT = exports.LIST_BOX_DEFAULT_PROPS = exports.INVALID_OPTION = exports.ERROR_EMPTY_OPTIONS = exports.DEFAULT_VALUE_KEY = exports.DEFAULT_LABEL_KEY = exports.CLOSE_TEXT = exports.CLEAR_TEXT = void 0;
|
|
7
|
-
var INVALID_OPTION = 'El texto ingresado no corresponde a una opción valida';
|
|
8
|
-
exports.
|
|
9
|
-
var
|
|
10
|
-
exports.
|
|
11
|
-
var
|
|
12
|
-
exports.
|
|
13
|
-
var
|
|
14
|
-
exports.
|
|
15
|
-
var
|
|
16
|
-
exports.
|
|
17
|
-
var
|
|
18
|
-
exports.DEFAULT_VALUE_KEY = DEFAULT_VALUE_KEY;
|
|
19
|
-
var DEFAULT_LABEL_KEY = 'name';
|
|
20
|
-
exports.DEFAULT_LABEL_KEY = DEFAULT_LABEL_KEY;
|
|
21
|
-
var ROW_HEIGHT = 40;
|
|
22
|
-
exports.ROW_HEIGHT = ROW_HEIGHT;
|
|
23
|
-
var MAX_HEIGHT = 300;
|
|
24
|
-
exports.MAX_HEIGHT = MAX_HEIGHT;
|
|
25
|
-
var MIN_ROW_HEIGHT_FACTOR = 8;
|
|
26
|
-
exports.MIN_ROW_HEIGHT_FACTOR = MIN_ROW_HEIGHT_FACTOR;
|
|
27
|
-
var LIST_BOX_DEFAULT_PROPS = {
|
|
7
|
+
var INVALID_OPTION = exports.INVALID_OPTION = 'El texto ingresado no corresponde a una opción valida';
|
|
8
|
+
var ERROR_EMPTY_OPTIONS = exports.ERROR_EMPTY_OPTIONS = 'No se cargaron opciones';
|
|
9
|
+
var CLEAR_TEXT = exports.CLEAR_TEXT = 'Borrar selección';
|
|
10
|
+
var OPEN_TEXT = exports.OPEN_TEXT = 'Ver opciones';
|
|
11
|
+
var CLOSE_TEXT = exports.CLOSE_TEXT = 'Cerrar menu';
|
|
12
|
+
var DEFAULT_VALUE_KEY = exports.DEFAULT_VALUE_KEY = 'value';
|
|
13
|
+
var DEFAULT_LABEL_KEY = exports.DEFAULT_LABEL_KEY = 'name';
|
|
14
|
+
var ROW_HEIGHT = exports.ROW_HEIGHT = 40;
|
|
15
|
+
var MAX_HEIGHT = exports.MAX_HEIGHT = 300;
|
|
16
|
+
var MIN_ROW_HEIGHT_FACTOR = exports.MIN_ROW_HEIGHT_FACTOR = 8;
|
|
17
|
+
var LIST_BOX_DEFAULT_PROPS = exports.LIST_BOX_DEFAULT_PROPS = {
|
|
28
18
|
height: 250,
|
|
29
19
|
innerElementType: 'ul',
|
|
30
20
|
overscanCount: 5
|
|
31
|
-
};
|
|
32
|
-
exports.LIST_BOX_DEFAULT_PROPS = LIST_BOX_DEFAULT_PROPS;
|
|
21
|
+
};
|