@elliemae/ds-uploader 2.0.0-next.1 → 2.0.0-next.11
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/cjs/DSUploader.js +51 -37
- package/cjs/propTypes.js +2 -6
- package/esm/DSUploader.js +49 -34
- package/esm/propTypes.js +1 -1
- package/package.json +6 -4
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSUploader.js
CHANGED
|
@@ -5,14 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
13
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
14
|
require('react');
|
|
9
15
|
var reactDesc = require('react-desc');
|
|
10
16
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var DSButton = require('@elliemae/ds-
|
|
17
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
18
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
19
|
+
var DSButton = require('@elliemae/ds-button');
|
|
14
20
|
var reactDropzone = require('react-dropzone');
|
|
15
|
-
var DSTooltip = require('@elliemae/ds-
|
|
21
|
+
var DSTooltip = require('@elliemae/ds-tooltip');
|
|
16
22
|
var propTypes = require('./propTypes.js');
|
|
17
23
|
var jsxRuntime = require('react/jsx-runtime');
|
|
18
24
|
|
|
@@ -21,7 +27,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
21
27
|
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
22
28
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
29
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
24
|
-
var UploadFile__default = /*#__PURE__*/_interopDefaultLegacy(UploadFile);
|
|
25
30
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
26
31
|
var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
|
|
27
32
|
|
|
@@ -35,36 +40,45 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
35
40
|
|
|
36
41
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
37
42
|
const blockName = 'uploader';
|
|
38
|
-
const blockNameInfo =
|
|
39
|
-
const blockNameDragActive =
|
|
40
|
-
const blockNameWrapper =
|
|
41
|
-
const UploaderWrapper = dsClassnames.aggregatedClasses('div')(blockNameWrapper, null,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
const blockNameInfo = "".concat(blockName, "-info");
|
|
44
|
+
const blockNameDragActive = "".concat(blockName, "-drag-active");
|
|
45
|
+
const blockNameWrapper = "".concat(blockName, "-wrapper");
|
|
46
|
+
const UploaderWrapper = dsClassnames.aggregatedClasses('div')(blockNameWrapper, null, _ref => {
|
|
47
|
+
let {
|
|
48
|
+
disabled
|
|
49
|
+
} = _ref;
|
|
50
|
+
return {
|
|
51
|
+
disabled
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const Uploader = dsClassnames.aggregatedClasses('div')(blockName, null, _ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
isDragActive
|
|
57
|
+
} = _ref2;
|
|
58
|
+
return {
|
|
59
|
+
'drag-active': isDragActive
|
|
60
|
+
};
|
|
61
|
+
});
|
|
51
62
|
const UploaderDragActive = dsClassnames.aggregatedClasses('div')(blockNameDragActive);
|
|
52
|
-
const UploaderIconArea = dsClassnames.aggregatedClasses('div')(
|
|
63
|
+
const UploaderIconArea = dsClassnames.aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
53
64
|
const UploaderInfo = dsClassnames.aggregatedClasses('div')(blockNameInfo);
|
|
54
65
|
const InfoText = dsClassnames.aggregatedClasses('span')(blockNameInfo, 'text');
|
|
55
66
|
const UploaderActions = dsClassnames.aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
56
67
|
const AcceptedTypes = dsClassnames.aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
57
|
-
const DividerVertical = dsClassnames.aggregatedClasses('div')('divider', null,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
const DividerVertical = dsClassnames.aggregatedClasses('div')('divider', null, _ref3 => {
|
|
69
|
+
let {
|
|
70
|
+
vertical
|
|
71
|
+
} = _ref3;
|
|
72
|
+
return {
|
|
73
|
+
vertical
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
function ActionButton(_ref4) {
|
|
64
78
|
let {
|
|
65
79
|
labelText
|
|
66
|
-
} =
|
|
67
|
-
otherProps = _objectWithoutProperties__default["default"](
|
|
80
|
+
} = _ref4,
|
|
81
|
+
otherProps = _objectWithoutProperties__default["default"](_ref4, _excluded);
|
|
68
82
|
|
|
69
83
|
return /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
70
84
|
buttonType: "text",
|
|
@@ -74,16 +88,16 @@ function ActionButton(_ref) {
|
|
|
74
88
|
|
|
75
89
|
const noop = () => null;
|
|
76
90
|
|
|
77
|
-
const DSUploader =
|
|
91
|
+
const DSUploader = _ref5 => {
|
|
78
92
|
let {
|
|
79
93
|
containerProps = {},
|
|
80
94
|
label = 'Browse',
|
|
81
95
|
// todo: i18n
|
|
82
|
-
icon: UploadFileIcon =
|
|
96
|
+
icon: UploadFileIcon = dsIcons.UploadFile,
|
|
83
97
|
defaultActionLabel = 'LOCAL DRIVE',
|
|
84
98
|
// todo: i18n
|
|
85
99
|
dragActiveInstructionalText = 'DROP FILES HERE',
|
|
86
|
-
dragActiveIcon: DragActiveIcon =
|
|
100
|
+
dragActiveIcon: DragActiveIcon = dsIcons.UploadFile,
|
|
87
101
|
altActionLabel = 'DOCUMENTS',
|
|
88
102
|
// todo: i18n
|
|
89
103
|
acceptedTypesText = 'JPG, JPEG, PNG, PDF',
|
|
@@ -98,8 +112,8 @@ const DSUploader = _ref2 => {
|
|
|
98
112
|
showAltAction = false,
|
|
99
113
|
defaultActionTooltipText,
|
|
100
114
|
altActionTooltipText
|
|
101
|
-
} =
|
|
102
|
-
dropzoneProps = _objectWithoutProperties__default["default"](
|
|
115
|
+
} = _ref5,
|
|
116
|
+
dropzoneProps = _objectWithoutProperties__default["default"](_ref5, _excluded2);
|
|
103
117
|
|
|
104
118
|
const {
|
|
105
119
|
getRootProps,
|
|
@@ -118,16 +132,16 @@ const DSUploader = _ref2 => {
|
|
|
118
132
|
const delfaultActionButton = /*#__PURE__*/_jsx2__default["default"](ActionButton, {
|
|
119
133
|
variant: disabledDefault && DSButton.BUTTON_VARIANT.DISABLED,
|
|
120
134
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
121
|
-
onClick: (
|
|
122
|
-
if (!disabledDefault)
|
|
135
|
+
onClick: function () {
|
|
136
|
+
if (!disabledDefault) dsUtilities.runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
123
137
|
}
|
|
124
138
|
});
|
|
125
139
|
|
|
126
140
|
const altActionButton = /*#__PURE__*/_jsx2__default["default"](ActionButton, {
|
|
127
141
|
variant: disabledAlt && DSButton.BUTTON_VARIANT.DISABLED,
|
|
128
142
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
129
|
-
onClick: (
|
|
130
|
-
if (!disabledAlt) onAltHandlerClick(...
|
|
143
|
+
onClick: function () {
|
|
144
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
131
145
|
}
|
|
132
146
|
});
|
|
133
147
|
|
package/cjs/propTypes.js
CHANGED
|
@@ -3,11 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var reactDesc = require('react-desc');
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var UploadFile__default = /*#__PURE__*/_interopDefaultLegacy(UploadFile);
|
|
6
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
11
7
|
|
|
12
8
|
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
13
9
|
|
|
@@ -22,7 +18,7 @@ const propTypes = {
|
|
|
22
18
|
multiple: reactDesc.PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),
|
|
23
19
|
accept: reactDesc.PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),
|
|
24
20
|
label: reactDesc.PropTypes.string.description('Uploader label.').defaultValue('Browse'),
|
|
25
|
-
icon: reactDesc.PropTypes.element.description('Uploader left icon.').defaultValue(
|
|
21
|
+
icon: reactDesc.PropTypes.element.description('Uploader left icon.').defaultValue(dsIcons.UploadFile),
|
|
26
22
|
actions: reactDesc.PropTypes.shape({
|
|
27
23
|
defaultAction: reactDesc.PropTypes.string,
|
|
28
24
|
altAction: reactDesc.PropTypes.string
|
package/esm/DSUploader.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
10
|
import 'react';
|
|
5
11
|
import { describe } from 'react-desc';
|
|
6
12
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
7
|
-
import { runAll } from '@elliemae/ds-utilities
|
|
8
|
-
import UploadFile from '@elliemae/ds-icons
|
|
9
|
-
import DSButton, { BUTTON_VARIANT } from '@elliemae/ds-
|
|
13
|
+
import { runAll } from '@elliemae/ds-utilities';
|
|
14
|
+
import { UploadFile } from '@elliemae/ds-icons';
|
|
15
|
+
import DSButton, { BUTTON_VARIANT } from '@elliemae/ds-button';
|
|
10
16
|
import { useDropzone } from 'react-dropzone';
|
|
11
|
-
import DSTooltip from '@elliemae/ds-
|
|
17
|
+
import DSTooltip from '@elliemae/ds-tooltip';
|
|
12
18
|
import { propTypes } from './propTypes.js';
|
|
13
19
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
14
20
|
|
|
@@ -22,36 +28,45 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
22
28
|
|
|
23
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24
30
|
const blockName = 'uploader';
|
|
25
|
-
const blockNameInfo =
|
|
26
|
-
const blockNameDragActive =
|
|
27
|
-
const blockNameWrapper =
|
|
28
|
-
const UploaderWrapper = aggregatedClasses('div')(blockNameWrapper, null,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
const blockNameInfo = "".concat(blockName, "-info");
|
|
32
|
+
const blockNameDragActive = "".concat(blockName, "-drag-active");
|
|
33
|
+
const blockNameWrapper = "".concat(blockName, "-wrapper");
|
|
34
|
+
const UploaderWrapper = aggregatedClasses('div')(blockNameWrapper, null, _ref => {
|
|
35
|
+
let {
|
|
36
|
+
disabled
|
|
37
|
+
} = _ref;
|
|
38
|
+
return {
|
|
39
|
+
disabled
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const Uploader = aggregatedClasses('div')(blockName, null, _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
isDragActive
|
|
45
|
+
} = _ref2;
|
|
46
|
+
return {
|
|
47
|
+
'drag-active': isDragActive
|
|
48
|
+
};
|
|
49
|
+
});
|
|
38
50
|
const UploaderDragActive = aggregatedClasses('div')(blockNameDragActive);
|
|
39
|
-
const UploaderIconArea = aggregatedClasses('div')(
|
|
51
|
+
const UploaderIconArea = aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
40
52
|
const UploaderInfo = aggregatedClasses('div')(blockNameInfo);
|
|
41
53
|
const InfoText = aggregatedClasses('span')(blockNameInfo, 'text');
|
|
42
54
|
const UploaderActions = aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
43
55
|
const AcceptedTypes = aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
44
|
-
const DividerVertical = aggregatedClasses('div')('divider', null,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
const DividerVertical = aggregatedClasses('div')('divider', null, _ref3 => {
|
|
57
|
+
let {
|
|
58
|
+
vertical
|
|
59
|
+
} = _ref3;
|
|
60
|
+
return {
|
|
61
|
+
vertical
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
function ActionButton(_ref4) {
|
|
51
66
|
let {
|
|
52
67
|
labelText
|
|
53
|
-
} =
|
|
54
|
-
otherProps = _objectWithoutProperties(
|
|
68
|
+
} = _ref4,
|
|
69
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded);
|
|
55
70
|
|
|
56
71
|
return /*#__PURE__*/jsx(DSButton, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
57
72
|
buttonType: "text",
|
|
@@ -61,7 +76,7 @@ function ActionButton(_ref) {
|
|
|
61
76
|
|
|
62
77
|
const noop = () => null;
|
|
63
78
|
|
|
64
|
-
const DSUploader =
|
|
79
|
+
const DSUploader = _ref5 => {
|
|
65
80
|
let {
|
|
66
81
|
containerProps = {},
|
|
67
82
|
label = 'Browse',
|
|
@@ -85,8 +100,8 @@ const DSUploader = _ref2 => {
|
|
|
85
100
|
showAltAction = false,
|
|
86
101
|
defaultActionTooltipText,
|
|
87
102
|
altActionTooltipText
|
|
88
|
-
} =
|
|
89
|
-
dropzoneProps = _objectWithoutProperties(
|
|
103
|
+
} = _ref5,
|
|
104
|
+
dropzoneProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
90
105
|
|
|
91
106
|
const {
|
|
92
107
|
getRootProps,
|
|
@@ -105,16 +120,16 @@ const DSUploader = _ref2 => {
|
|
|
105
120
|
const delfaultActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
106
121
|
variant: disabledDefault && BUTTON_VARIANT.DISABLED,
|
|
107
122
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
108
|
-
onClick: (
|
|
109
|
-
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...
|
|
123
|
+
onClick: function () {
|
|
124
|
+
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
110
125
|
}
|
|
111
126
|
});
|
|
112
127
|
|
|
113
128
|
const altActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
114
129
|
variant: disabledAlt && BUTTON_VARIANT.DISABLED,
|
|
115
130
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
116
|
-
onClick: (
|
|
117
|
-
if (!disabledAlt) onAltHandlerClick(...
|
|
131
|
+
onClick: function () {
|
|
132
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
118
133
|
}
|
|
119
134
|
});
|
|
120
135
|
|
package/esm/propTypes.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-uploader",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Uploader",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -40,9 +40,11 @@
|
|
|
40
40
|
"build": "node ../../scripts/build/build.js"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-basic": "2.0.0-next.
|
|
44
|
-
"@elliemae/ds-classnames": "2.0.0-next.
|
|
45
|
-
"@elliemae/ds-
|
|
43
|
+
"@elliemae/ds-basic": "2.0.0-next.11",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-next.11",
|
|
45
|
+
"@elliemae/ds-icons": "2.0.0-next.11",
|
|
46
|
+
"@elliemae/ds-utilities": "2.0.0-next.11",
|
|
47
|
+
"react-desc": "~4.1.3",
|
|
46
48
|
"react-dropzone": "~10.2.2"
|
|
47
49
|
},
|
|
48
50
|
"publishConfig": {
|
package/cjs/package.json
DELETED