@elliemae/ds-uploader 1.60.0 → 2.0.0-alpha.12
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 +117 -98
- package/cjs/index.d.js +0 -1
- package/cjs/index.js +1 -13
- package/cjs/propTypes.js +1 -2
- package/esm/DSUploader.js +109 -90
- package/esm/index.d.js +0 -1
- package/esm/index.js +0 -12
- package/esm/propTypes.js +1 -2
- package/package.json +45 -15
- package/types/DSUploader.d.ts +136 -0
- package/types/index.d.d.ts +26 -0
- package/types/index.d.ts +1 -0
- package/types/propTypes.d.ts +121 -0
- package/types/tests/DSUploader.test.d.ts +1 -0
- package/DSUploader/package.json +0 -10
- package/cjs/DSUploader.js.map +0 -1
- package/cjs/index.d.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/propTypes.js.map +0 -1
- package/esm/DSUploader.js.map +0 -1
- package/esm/index.d.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/propTypes.js.map +0 -1
- package/propTypes/package.json +0 -10
package/cjs/DSUploader.js
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _jsx2 = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
7
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
-
|
|
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');
|
|
14
|
+
require('react');
|
|
8
15
|
var reactDesc = require('react-desc');
|
|
9
16
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
10
17
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
@@ -13,122 +20,132 @@ var DSButton = require('@elliemae/ds-button');
|
|
|
13
20
|
var reactDropzone = require('react-dropzone');
|
|
14
21
|
var DSTooltip = require('@elliemae/ds-tooltip');
|
|
15
22
|
var propTypes = require('./propTypes.js');
|
|
23
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
24
|
|
|
17
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
26
|
|
|
19
|
-
var
|
|
27
|
+
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
28
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
29
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
30
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
23
31
|
var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
|
|
24
32
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
var _DividerVertical, _DividerVertical2;
|
|
34
|
+
|
|
35
|
+
const _excluded = ["labelText"],
|
|
36
|
+
_excluded2 = ["containerProps", "label", "icon", "defaultActionLabel", "dragActiveInstructionalText", "dragActiveIcon", "altActionLabel", "acceptedTypesText", "disabledDefault", "disabledAlt", "onDefaultHandlerClick", "onAltHandlerClick", "actions", "showAltAction", "defaultActionTooltipText", "altActionTooltipText"],
|
|
37
|
+
_excluded3 = ["onClick"];
|
|
38
|
+
|
|
39
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
40
|
+
|
|
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; }
|
|
42
|
+
const blockName = 'uploader';
|
|
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;
|
|
34
50
|
return {
|
|
35
|
-
disabled
|
|
51
|
+
disabled
|
|
36
52
|
};
|
|
37
53
|
});
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
const Uploader = dsClassnames.aggregatedClasses('div')(blockName, null, _ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
isDragActive
|
|
57
|
+
} = _ref2;
|
|
40
58
|
return {
|
|
41
59
|
'drag-active': isDragActive
|
|
42
60
|
};
|
|
43
61
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
const UploaderDragActive = dsClassnames.aggregatedClasses('div')(blockNameDragActive);
|
|
63
|
+
const UploaderIconArea = dsClassnames.aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
64
|
+
const UploaderInfo = dsClassnames.aggregatedClasses('div')(blockNameInfo);
|
|
65
|
+
const InfoText = dsClassnames.aggregatedClasses('span')(blockNameInfo, 'text');
|
|
66
|
+
const UploaderActions = dsClassnames.aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
67
|
+
const AcceptedTypes = dsClassnames.aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
68
|
+
const DividerVertical = dsClassnames.aggregatedClasses('div')('divider', null, _ref3 => {
|
|
69
|
+
let {
|
|
70
|
+
vertical
|
|
71
|
+
} = _ref3;
|
|
52
72
|
return {
|
|
53
|
-
vertical
|
|
73
|
+
vertical
|
|
54
74
|
};
|
|
55
75
|
});
|
|
56
76
|
|
|
57
77
|
function ActionButton(_ref4) {
|
|
58
|
-
|
|
59
|
-
|
|
78
|
+
let {
|
|
79
|
+
labelText
|
|
80
|
+
} = _ref4,
|
|
81
|
+
otherProps = _objectWithoutProperties__default["default"](_ref4, _excluded);
|
|
60
82
|
|
|
61
|
-
return /*#__PURE__*/
|
|
83
|
+
return /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
62
84
|
buttonType: "text",
|
|
63
85
|
labelText: labelText
|
|
64
86
|
}));
|
|
65
87
|
}
|
|
66
88
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
89
|
+
const noop = () => null;
|
|
90
|
+
|
|
91
|
+
const DSUploader = _ref5 => {
|
|
92
|
+
let {
|
|
93
|
+
containerProps = {},
|
|
94
|
+
label = 'Browse',
|
|
95
|
+
// todo: i18n
|
|
96
|
+
icon: UploadFileIcon = dsIcons.UploadFile,
|
|
97
|
+
defaultActionLabel = 'LOCAL DRIVE',
|
|
98
|
+
// todo: i18n
|
|
99
|
+
dragActiveInstructionalText = 'DROP FILES HERE',
|
|
100
|
+
dragActiveIcon: DragActiveIcon = dsIcons.UploadFile,
|
|
101
|
+
altActionLabel = 'DOCUMENTS',
|
|
102
|
+
// todo: i18n
|
|
103
|
+
acceptedTypesText = 'JPG, JPEG, PNG, PDF',
|
|
104
|
+
disabledDefault = false,
|
|
105
|
+
disabledAlt = false,
|
|
106
|
+
onDefaultHandlerClick = noop,
|
|
107
|
+
onAltHandlerClick = noop,
|
|
108
|
+
actions = {
|
|
109
|
+
defaultAction: 'LOCAL DRIVE',
|
|
110
|
+
altAction: 'DOCUMENTS'
|
|
111
|
+
},
|
|
112
|
+
showAltAction = false,
|
|
113
|
+
defaultActionTooltipText,
|
|
114
|
+
altActionTooltipText
|
|
115
|
+
} = _ref5,
|
|
116
|
+
dropzoneProps = _objectWithoutProperties__default["default"](_ref5, _excluded2);
|
|
117
|
+
|
|
118
|
+
const {
|
|
119
|
+
getRootProps,
|
|
120
|
+
getInputProps,
|
|
121
|
+
isDragActive
|
|
122
|
+
} = reactDropzone.useDropzone(dropzoneProps);
|
|
123
|
+
|
|
124
|
+
const _getRootProps = getRootProps(),
|
|
125
|
+
{
|
|
126
|
+
onClick: onOpenFile
|
|
127
|
+
} = _getRootProps,
|
|
128
|
+
rootProps = _objectWithoutProperties__default["default"](_getRootProps, _excluded3);
|
|
70
129
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
_ref5$label = _ref5.label,
|
|
75
|
-
label = _ref5$label === void 0 ? 'Browse' : _ref5$label,
|
|
76
|
-
_ref5$icon = _ref5.icon,
|
|
77
|
-
UploadFileIcon = _ref5$icon === void 0 ? dsIcons.UploadFile : _ref5$icon,
|
|
78
|
-
_ref5$defaultActionLa = _ref5.defaultActionLabel,
|
|
79
|
-
defaultActionLabel = _ref5$defaultActionLa === void 0 ? 'LOCAL DRIVE' : _ref5$defaultActionLa,
|
|
80
|
-
_ref5$dragActiveInstr = _ref5.dragActiveInstructionalText,
|
|
81
|
-
dragActiveInstructionalText = _ref5$dragActiveInstr === void 0 ? 'DROP FILES HERE' : _ref5$dragActiveInstr,
|
|
82
|
-
_ref5$dragActiveIcon = _ref5.dragActiveIcon,
|
|
83
|
-
DragActiveIcon = _ref5$dragActiveIcon === void 0 ? dsIcons.UploadFile : _ref5$dragActiveIcon,
|
|
84
|
-
_ref5$altActionLabel = _ref5.altActionLabel,
|
|
85
|
-
altActionLabel = _ref5$altActionLabel === void 0 ? 'DOCUMENTS' : _ref5$altActionLabel,
|
|
86
|
-
_ref5$acceptedTypesTe = _ref5.acceptedTypesText,
|
|
87
|
-
acceptedTypesText = _ref5$acceptedTypesTe === void 0 ? 'JPG, JPEG, PNG, PDF' : _ref5$acceptedTypesTe,
|
|
88
|
-
_ref5$disabledDefault = _ref5.disabledDefault,
|
|
89
|
-
disabledDefault = _ref5$disabledDefault === void 0 ? false : _ref5$disabledDefault,
|
|
90
|
-
_ref5$disabledAlt = _ref5.disabledAlt,
|
|
91
|
-
disabledAlt = _ref5$disabledAlt === void 0 ? false : _ref5$disabledAlt,
|
|
92
|
-
_ref5$onDefaultHandle = _ref5.onDefaultHandlerClick,
|
|
93
|
-
onDefaultHandlerClick = _ref5$onDefaultHandle === void 0 ? noop : _ref5$onDefaultHandle,
|
|
94
|
-
_ref5$onAltHandlerCli = _ref5.onAltHandlerClick,
|
|
95
|
-
onAltHandlerClick = _ref5$onAltHandlerCli === void 0 ? noop : _ref5$onAltHandlerCli,
|
|
96
|
-
_ref5$actions = _ref5.actions,
|
|
97
|
-
actions = _ref5$actions === void 0 ? {
|
|
98
|
-
defaultAction: 'LOCAL DRIVE',
|
|
99
|
-
altAction: 'DOCUMENTS'
|
|
100
|
-
} : _ref5$actions,
|
|
101
|
-
_ref5$showAltAction = _ref5.showAltAction,
|
|
102
|
-
showAltAction = _ref5$showAltAction === void 0 ? false : _ref5$showAltAction,
|
|
103
|
-
defaultActionTooltipText = _ref5.defaultActionTooltipText,
|
|
104
|
-
altActionTooltipText = _ref5.altActionTooltipText,
|
|
105
|
-
dropzoneProps = _objectWithoutProperties__default['default'](_ref5, _excluded2);
|
|
106
|
-
|
|
107
|
-
var _useDropzone = reactDropzone.useDropzone(dropzoneProps),
|
|
108
|
-
getRootProps = _useDropzone.getRootProps,
|
|
109
|
-
getInputProps = _useDropzone.getInputProps,
|
|
110
|
-
isDragActive = _useDropzone.isDragActive;
|
|
111
|
-
|
|
112
|
-
var _getRootProps = getRootProps(),
|
|
113
|
-
onOpenFile = _getRootProps.onClick,
|
|
114
|
-
rootProps = _objectWithoutProperties__default['default'](_getRootProps, _excluded3);
|
|
115
|
-
|
|
116
|
-
var disabledAll = disabledDefault && disabledAlt;
|
|
117
|
-
var delfaultActionButton = /*#__PURE__*/React__default['default'].createElement(ActionButton, {
|
|
130
|
+
const disabledAll = disabledDefault && disabledAlt;
|
|
131
|
+
|
|
132
|
+
const delfaultActionButton = /*#__PURE__*/_jsx2__default["default"](ActionButton, {
|
|
118
133
|
variant: disabledDefault && DSButton.BUTTON_VARIANT.DISABLED,
|
|
119
134
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
120
|
-
onClick: function
|
|
121
|
-
if (!disabledDefault) dsUtilities.runAll(onDefaultHandlerClick, onOpenFile)
|
|
135
|
+
onClick: function () {
|
|
136
|
+
if (!disabledDefault) dsUtilities.runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
122
137
|
}
|
|
123
138
|
});
|
|
124
|
-
|
|
139
|
+
|
|
140
|
+
const altActionButton = /*#__PURE__*/_jsx2__default["default"](ActionButton, {
|
|
125
141
|
variant: disabledAlt && DSButton.BUTTON_VARIANT.DISABLED,
|
|
126
142
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
127
|
-
onClick: function
|
|
128
|
-
if (!disabledAlt) onAltHandlerClick
|
|
143
|
+
onClick: function () {
|
|
144
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
129
145
|
}
|
|
130
146
|
});
|
|
131
|
-
|
|
147
|
+
|
|
148
|
+
const defaultAction = !defaultActionTooltipText ? delfaultActionButton : /*#__PURE__*/_jsx2__default["default"](DSTooltip__default["default"], {
|
|
132
149
|
containerProps: {
|
|
133
150
|
id: 'default-action-tooltip'
|
|
134
151
|
},
|
|
@@ -136,7 +153,7 @@ var DSUploader = function DSUploader(_ref5) {
|
|
|
136
153
|
title: defaultActionTooltipText,
|
|
137
154
|
triggerComponent: delfaultActionButton
|
|
138
155
|
});
|
|
139
|
-
|
|
156
|
+
const altAction = !altActionTooltipText ? altActionButton : /*#__PURE__*/_jsx2__default["default"](DSTooltip__default["default"], {
|
|
140
157
|
containerProps: {
|
|
141
158
|
id: 'alt-action-tooltip'
|
|
142
159
|
},
|
|
@@ -144,27 +161,29 @@ var DSUploader = function DSUploader(_ref5) {
|
|
|
144
161
|
title: altActionTooltipText,
|
|
145
162
|
triggerComponent: altActionButton
|
|
146
163
|
});
|
|
147
|
-
return /*#__PURE__*/
|
|
164
|
+
return /*#__PURE__*/jsxRuntime.jsxs(UploaderWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
148
165
|
classProps: {
|
|
149
166
|
disabled: disabledAll
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
167
|
+
},
|
|
168
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Uploader, _objectSpread(_objectSpread({}, rootProps), {}, {
|
|
169
|
+
classProps: {
|
|
170
|
+
isDragActive
|
|
171
|
+
},
|
|
172
|
+
children: [/*#__PURE__*/_jsx2__default["default"](UploaderIconArea, {}, void 0, /*#__PURE__*/_jsx2__default["default"](UploadFileIcon, {
|
|
173
|
+
size: "l"
|
|
174
|
+
})), _DividerVertical || (_DividerVertical = /*#__PURE__*/_jsx2__default["default"](DividerVertical, {})), /*#__PURE__*/_jsx2__default["default"](UploaderInfo, {}, void 0, /*#__PURE__*/_jsx2__default["default"](InfoText, {}, void 0, label), /*#__PURE__*/_jsx2__default["default"](UploaderActions, {}, void 0, actions.defaultAction && defaultAction, (actions.altAction || showAltAction) && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
175
|
+
children: [actions.defaultAction && (_DividerVertical2 || (_DividerVertical2 = /*#__PURE__*/_jsx2__default["default"](DividerVertical, {}))), altAction]
|
|
176
|
+
}))), !disabledAll && /*#__PURE__*/_jsx2__default["default"](UploaderDragActive, {}, void 0, /*#__PURE__*/_jsx2__default["default"](DragActiveIcon, {}), dragActiveInstructionalText), !disabledAll && /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread({}, getInputProps()))]
|
|
177
|
+
})), typeof acceptedTypesText === 'string' && /*#__PURE__*/_jsx2__default["default"](AcceptedTypes, {}, void 0, acceptedTypesText.toUpperCase())]
|
|
178
|
+
}));
|
|
158
179
|
};
|
|
159
180
|
|
|
160
181
|
DSUploader.actions = {
|
|
161
182
|
defaultAction: 'LOCAL DRIVE',
|
|
162
183
|
altAction: 'DOCUMENTS'
|
|
163
184
|
};
|
|
164
|
-
|
|
165
|
-
var UploaderWithSchema = reactDesc.describe(DSUploader);
|
|
185
|
+
const UploaderWithSchema = reactDesc.describe(DSUploader);
|
|
166
186
|
UploaderWithSchema.propTypes = propTypes.propTypes;
|
|
167
187
|
|
|
168
188
|
exports.UploaderWithSchema = UploaderWithSchema;
|
|
169
|
-
exports[
|
|
170
|
-
//# sourceMappingURL=DSUploader.js.map
|
|
189
|
+
exports["default"] = DSUploader;
|
package/cjs/index.d.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -3,20 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var DSUploader = require('./DSUploader.js');
|
|
6
|
-
require('@babel/runtime/helpers/extends');
|
|
7
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
-
require('react');
|
|
9
|
-
require('react-desc');
|
|
10
|
-
require('@elliemae/ds-classnames');
|
|
11
|
-
require('@elliemae/ds-utilities');
|
|
12
|
-
require('@elliemae/ds-icons');
|
|
13
|
-
require('@elliemae/ds-button');
|
|
14
|
-
require('react-dropzone');
|
|
15
|
-
require('@elliemae/ds-tooltip');
|
|
16
|
-
require('./propTypes.js');
|
|
17
6
|
|
|
18
7
|
|
|
19
8
|
|
|
20
9
|
exports.UploaderWithSchema = DSUploader.UploaderWithSchema;
|
|
21
|
-
exports
|
|
22
|
-
//# sourceMappingURL=index.js.map
|
|
10
|
+
exports["default"] = DSUploader["default"];
|
package/cjs/propTypes.js
CHANGED
|
@@ -7,7 +7,7 @@ var dsIcons = require('@elliemae/ds-icons');
|
|
|
7
7
|
|
|
8
8
|
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const propTypes = {
|
|
11
11
|
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container.'),
|
|
12
12
|
validator: reactDesc.PropTypes.func.description("Custom validator. It must return null if it's valid or an object `{ code: string, message: string }` if it's not."),
|
|
13
13
|
maxFiles: reactDesc.PropTypes.number.description('Number of files accepted.'),
|
|
@@ -40,4 +40,3 @@ var propTypes = {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
exports.propTypes = propTypes;
|
|
43
|
-
//# sourceMappingURL=propTypes.js.map
|
package/esm/DSUploader.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
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';
|
|
6
|
+
import _jsx2 from '@babel/runtime/helpers/esm/jsx';
|
|
7
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
8
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import
|
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
|
+
import 'react';
|
|
4
11
|
import { describe } from 'react-desc';
|
|
5
12
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
6
13
|
import { runAll } from '@elliemae/ds-utilities';
|
|
@@ -9,114 +16,124 @@ import DSButton, { BUTTON_VARIANT } from '@elliemae/ds-button';
|
|
|
9
16
|
import { useDropzone } from 'react-dropzone';
|
|
10
17
|
import DSTooltip from '@elliemae/ds-tooltip';
|
|
11
18
|
import { propTypes } from './propTypes.js';
|
|
19
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
12
20
|
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
var _DividerVertical, _DividerVertical2;
|
|
22
|
+
|
|
23
|
+
const _excluded = ["labelText"],
|
|
24
|
+
_excluded2 = ["containerProps", "label", "icon", "defaultActionLabel", "dragActiveInstructionalText", "dragActiveIcon", "altActionLabel", "acceptedTypesText", "disabledDefault", "disabledAlt", "onDefaultHandlerClick", "onAltHandlerClick", "actions", "showAltAction", "defaultActionTooltipText", "altActionTooltipText"],
|
|
25
|
+
_excluded3 = ["onClick"];
|
|
26
|
+
|
|
27
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
|
|
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; }
|
|
30
|
+
const blockName = 'uploader';
|
|
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;
|
|
22
38
|
return {
|
|
23
|
-
disabled
|
|
39
|
+
disabled
|
|
24
40
|
};
|
|
25
41
|
});
|
|
26
|
-
|
|
27
|
-
|
|
42
|
+
const Uploader = aggregatedClasses('div')(blockName, null, _ref2 => {
|
|
43
|
+
let {
|
|
44
|
+
isDragActive
|
|
45
|
+
} = _ref2;
|
|
28
46
|
return {
|
|
29
47
|
'drag-active': isDragActive
|
|
30
48
|
};
|
|
31
49
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
50
|
+
const UploaderDragActive = aggregatedClasses('div')(blockNameDragActive);
|
|
51
|
+
const UploaderIconArea = aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
52
|
+
const UploaderInfo = aggregatedClasses('div')(blockNameInfo);
|
|
53
|
+
const InfoText = aggregatedClasses('span')(blockNameInfo, 'text');
|
|
54
|
+
const UploaderActions = aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
55
|
+
const AcceptedTypes = aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
56
|
+
const DividerVertical = aggregatedClasses('div')('divider', null, _ref3 => {
|
|
57
|
+
let {
|
|
58
|
+
vertical
|
|
59
|
+
} = _ref3;
|
|
40
60
|
return {
|
|
41
|
-
vertical
|
|
61
|
+
vertical
|
|
42
62
|
};
|
|
43
63
|
});
|
|
44
64
|
|
|
45
65
|
function ActionButton(_ref4) {
|
|
46
|
-
|
|
66
|
+
let {
|
|
67
|
+
labelText
|
|
68
|
+
} = _ref4,
|
|
47
69
|
otherProps = _objectWithoutProperties(_ref4, _excluded);
|
|
48
70
|
|
|
49
|
-
return /*#__PURE__*/
|
|
71
|
+
return /*#__PURE__*/jsx(DSButton, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
50
72
|
buttonType: "text",
|
|
51
73
|
labelText: labelText
|
|
52
74
|
}));
|
|
53
75
|
}
|
|
54
76
|
|
|
55
|
-
|
|
56
|
-
return null;
|
|
57
|
-
};
|
|
77
|
+
const noop = () => null;
|
|
58
78
|
|
|
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
|
-
_ref5$actions = _ref5.actions,
|
|
85
|
-
actions = _ref5$actions === void 0 ? {
|
|
86
|
-
defaultAction: 'LOCAL DRIVE',
|
|
87
|
-
altAction: 'DOCUMENTS'
|
|
88
|
-
} : _ref5$actions,
|
|
89
|
-
_ref5$showAltAction = _ref5.showAltAction,
|
|
90
|
-
showAltAction = _ref5$showAltAction === void 0 ? false : _ref5$showAltAction,
|
|
91
|
-
defaultActionTooltipText = _ref5.defaultActionTooltipText,
|
|
92
|
-
altActionTooltipText = _ref5.altActionTooltipText,
|
|
79
|
+
const DSUploader = _ref5 => {
|
|
80
|
+
let {
|
|
81
|
+
containerProps = {},
|
|
82
|
+
label = 'Browse',
|
|
83
|
+
// todo: i18n
|
|
84
|
+
icon: UploadFileIcon = UploadFile,
|
|
85
|
+
defaultActionLabel = 'LOCAL DRIVE',
|
|
86
|
+
// todo: i18n
|
|
87
|
+
dragActiveInstructionalText = 'DROP FILES HERE',
|
|
88
|
+
dragActiveIcon: DragActiveIcon = UploadFile,
|
|
89
|
+
altActionLabel = 'DOCUMENTS',
|
|
90
|
+
// todo: i18n
|
|
91
|
+
acceptedTypesText = 'JPG, JPEG, PNG, PDF',
|
|
92
|
+
disabledDefault = false,
|
|
93
|
+
disabledAlt = false,
|
|
94
|
+
onDefaultHandlerClick = noop,
|
|
95
|
+
onAltHandlerClick = noop,
|
|
96
|
+
actions = {
|
|
97
|
+
defaultAction: 'LOCAL DRIVE',
|
|
98
|
+
altAction: 'DOCUMENTS'
|
|
99
|
+
},
|
|
100
|
+
showAltAction = false,
|
|
101
|
+
defaultActionTooltipText,
|
|
102
|
+
altActionTooltipText
|
|
103
|
+
} = _ref5,
|
|
93
104
|
dropzoneProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
94
105
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
const {
|
|
107
|
+
getRootProps,
|
|
108
|
+
getInputProps,
|
|
109
|
+
isDragActive
|
|
110
|
+
} = useDropzone(dropzoneProps);
|
|
111
|
+
|
|
112
|
+
const _getRootProps = getRootProps(),
|
|
113
|
+
{
|
|
114
|
+
onClick: onOpenFile
|
|
115
|
+
} = _getRootProps,
|
|
116
|
+
rootProps = _objectWithoutProperties(_getRootProps, _excluded3);
|
|
99
117
|
|
|
100
|
-
|
|
101
|
-
onOpenFile = _getRootProps.onClick,
|
|
102
|
-
rootProps = _objectWithoutProperties(_getRootProps, _excluded3);
|
|
118
|
+
const disabledAll = disabledDefault && disabledAlt;
|
|
103
119
|
|
|
104
|
-
|
|
105
|
-
var delfaultActionButton = /*#__PURE__*/React.createElement(ActionButton, {
|
|
120
|
+
const delfaultActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
106
121
|
variant: disabledDefault && BUTTON_VARIANT.DISABLED,
|
|
107
122
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
108
|
-
onClick: function
|
|
109
|
-
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)
|
|
123
|
+
onClick: function () {
|
|
124
|
+
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
110
125
|
}
|
|
111
126
|
});
|
|
112
|
-
|
|
127
|
+
|
|
128
|
+
const altActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
113
129
|
variant: disabledAlt && BUTTON_VARIANT.DISABLED,
|
|
114
130
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
115
|
-
onClick: function
|
|
116
|
-
if (!disabledAlt) onAltHandlerClick
|
|
131
|
+
onClick: function () {
|
|
132
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
117
133
|
}
|
|
118
134
|
});
|
|
119
|
-
|
|
135
|
+
|
|
136
|
+
const defaultAction = !defaultActionTooltipText ? delfaultActionButton : /*#__PURE__*/_jsx2(DSTooltip, {
|
|
120
137
|
containerProps: {
|
|
121
138
|
id: 'default-action-tooltip'
|
|
122
139
|
},
|
|
@@ -124,7 +141,7 @@ var DSUploader = function DSUploader(_ref5) {
|
|
|
124
141
|
title: defaultActionTooltipText,
|
|
125
142
|
triggerComponent: delfaultActionButton
|
|
126
143
|
});
|
|
127
|
-
|
|
144
|
+
const altAction = !altActionTooltipText ? altActionButton : /*#__PURE__*/_jsx2(DSTooltip, {
|
|
128
145
|
containerProps: {
|
|
129
146
|
id: 'alt-action-tooltip'
|
|
130
147
|
},
|
|
@@ -132,26 +149,28 @@ var DSUploader = function DSUploader(_ref5) {
|
|
|
132
149
|
title: altActionTooltipText,
|
|
133
150
|
triggerComponent: altActionButton
|
|
134
151
|
});
|
|
135
|
-
return /*#__PURE__*/
|
|
152
|
+
return /*#__PURE__*/jsxs(UploaderWrapper, _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
136
153
|
classProps: {
|
|
137
154
|
disabled: disabledAll
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
},
|
|
156
|
+
children: [/*#__PURE__*/jsxs(Uploader, _objectSpread(_objectSpread({}, rootProps), {}, {
|
|
157
|
+
classProps: {
|
|
158
|
+
isDragActive
|
|
159
|
+
},
|
|
160
|
+
children: [/*#__PURE__*/_jsx2(UploaderIconArea, {}, void 0, /*#__PURE__*/_jsx2(UploadFileIcon, {
|
|
161
|
+
size: "l"
|
|
162
|
+
})), _DividerVertical || (_DividerVertical = /*#__PURE__*/_jsx2(DividerVertical, {})), /*#__PURE__*/_jsx2(UploaderInfo, {}, void 0, /*#__PURE__*/_jsx2(InfoText, {}, void 0, label), /*#__PURE__*/_jsx2(UploaderActions, {}, void 0, actions.defaultAction && defaultAction, (actions.altAction || showAltAction) && /*#__PURE__*/jsxs(Fragment, {
|
|
163
|
+
children: [actions.defaultAction && (_DividerVertical2 || (_DividerVertical2 = /*#__PURE__*/_jsx2(DividerVertical, {}))), altAction]
|
|
164
|
+
}))), !disabledAll && /*#__PURE__*/_jsx2(UploaderDragActive, {}, void 0, /*#__PURE__*/_jsx2(DragActiveIcon, {}), dragActiveInstructionalText), !disabledAll && /*#__PURE__*/jsx("input", _objectSpread({}, getInputProps()))]
|
|
165
|
+
})), typeof acceptedTypesText === 'string' && /*#__PURE__*/_jsx2(AcceptedTypes, {}, void 0, acceptedTypesText.toUpperCase())]
|
|
166
|
+
}));
|
|
146
167
|
};
|
|
147
168
|
|
|
148
169
|
DSUploader.actions = {
|
|
149
170
|
defaultAction: 'LOCAL DRIVE',
|
|
150
171
|
altAction: 'DOCUMENTS'
|
|
151
172
|
};
|
|
152
|
-
|
|
153
|
-
var UploaderWithSchema = describe(DSUploader);
|
|
173
|
+
const UploaderWithSchema = describe(DSUploader);
|
|
154
174
|
UploaderWithSchema.propTypes = propTypes;
|
|
155
175
|
|
|
156
176
|
export { UploaderWithSchema, DSUploader as default };
|
|
157
|
-
//# sourceMappingURL=DSUploader.js.map
|
package/esm/index.d.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
1
|
export { UploaderWithSchema, default } from './DSUploader.js';
|
|
2
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
3
|
-
import '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import 'react';
|
|
5
|
-
import 'react-desc';
|
|
6
|
-
import '@elliemae/ds-classnames';
|
|
7
|
-
import '@elliemae/ds-utilities';
|
|
8
|
-
import '@elliemae/ds-icons';
|
|
9
|
-
import '@elliemae/ds-button';
|
|
10
|
-
import 'react-dropzone';
|
|
11
|
-
import '@elliemae/ds-tooltip';
|
|
12
|
-
import './propTypes.js';
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
package/esm/propTypes.js
CHANGED
|
@@ -3,7 +3,7 @@ import { UploadFile } from '@elliemae/ds-icons';
|
|
|
3
3
|
|
|
4
4
|
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const propTypes = {
|
|
7
7
|
containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),
|
|
8
8
|
validator: PropTypes.func.description("Custom validator. It must return null if it's valid or an object `{ code: string, message: string }` if it's not."),
|
|
9
9
|
maxFiles: PropTypes.number.description('Number of files accepted.'),
|
|
@@ -36,4 +36,3 @@ var propTypes = {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
export { propTypes };
|
|
39
|
-
//# sourceMappingURL=propTypes.js.map
|
package/package.json
CHANGED
|
@@ -1,14 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-uploader",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
5
|
+
"description": "ICE MT - Dimsum - Uploader",
|
|
6
|
+
"module": "./esm/index.js",
|
|
7
|
+
"main": "./cjs/index.js",
|
|
8
|
+
"types": "./types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./cjs/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./propTypes": {
|
|
15
|
+
"import": "./esm/propTypes.js",
|
|
16
|
+
"require": "./cjs/propTypes.js"
|
|
17
|
+
},
|
|
18
|
+
"./DSUploader": {
|
|
19
|
+
"import": "./esm/DSUploader.js",
|
|
20
|
+
"require": "./cjs/DSUploader.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
8
23
|
"sideEffects": [
|
|
9
24
|
"*.css",
|
|
10
25
|
"*.scss"
|
|
11
26
|
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"npm": ">=7",
|
|
33
|
+
"node": ">=14"
|
|
34
|
+
},
|
|
35
|
+
"author": "ICE MT",
|
|
12
36
|
"scripts": {
|
|
13
37
|
"dev": "cross-env NODE_ENV=development && node ../../scripts/build/build.js -w",
|
|
14
38
|
"prebuild": "exit 0",
|
|
@@ -16,20 +40,26 @@
|
|
|
16
40
|
"build": "node ../../scripts/build/build.js"
|
|
17
41
|
},
|
|
18
42
|
"dependencies": {
|
|
19
|
-
"@elliemae/ds-
|
|
20
|
-
"@elliemae/ds-classnames": "
|
|
21
|
-
"@elliemae/ds-icons": "
|
|
22
|
-
"@elliemae/ds-
|
|
23
|
-
"
|
|
43
|
+
"@elliemae/ds-button": "2.0.0-alpha.12",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.12",
|
|
45
|
+
"@elliemae/ds-icons": "2.0.0-alpha.12",
|
|
46
|
+
"@elliemae/ds-tooltip": "2.0.0-alpha.12",
|
|
47
|
+
"@elliemae/ds-utilities": "2.0.0-alpha.12",
|
|
48
|
+
"react-desc": "~4.1.3",
|
|
24
49
|
"react-dropzone": "~10.2.2"
|
|
25
50
|
},
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
53
|
+
"@testing-library/react": "~12.1.2"
|
|
29
54
|
},
|
|
30
55
|
"peerDependencies": {
|
|
31
|
-
"lodash": "^4.17.
|
|
32
|
-
"react": "~17.0.
|
|
33
|
-
"react-dom": "^17.0.
|
|
56
|
+
"lodash": "^4.17.21",
|
|
57
|
+
"react": "~17.0.2",
|
|
58
|
+
"react-dom": "^17.0.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public",
|
|
62
|
+
"directory": "dist",
|
|
63
|
+
"generateSubmodules": true
|
|
34
64
|
}
|
|
35
65
|
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
import type { DSUploaderPropsT } from './index.d';
|
|
4
|
+
declare const DSUploader: {
|
|
5
|
+
({ containerProps, label, icon: UploadFileIcon, defaultActionLabel, dragActiveInstructionalText, dragActiveIcon: DragActiveIcon, altActionLabel, acceptedTypesText, disabledDefault, disabledAlt, onDefaultHandlerClick, onAltHandlerClick, actions, showAltAction, defaultActionTooltipText, altActionTooltipText, ...dropzoneProps }: DSUploaderPropsT): JSX.Element;
|
|
6
|
+
actions: {
|
|
7
|
+
defaultAction: string;
|
|
8
|
+
altAction: string;
|
|
9
|
+
};
|
|
10
|
+
propTypes: {
|
|
11
|
+
containerProps: {
|
|
12
|
+
defaultValue<T = unknown>(arg: T): {
|
|
13
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
14
|
+
};
|
|
15
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
16
|
+
};
|
|
17
|
+
validator: {
|
|
18
|
+
defaultValue<T = unknown>(arg: T): {
|
|
19
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
20
|
+
};
|
|
21
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
22
|
+
};
|
|
23
|
+
maxFiles: {
|
|
24
|
+
defaultValue<T = unknown>(arg: T): {
|
|
25
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
26
|
+
};
|
|
27
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
minSize: {
|
|
30
|
+
defaultValue<T = unknown>(arg: T): {
|
|
31
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
32
|
+
};
|
|
33
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
maxSize: {
|
|
36
|
+
defaultValue<T = unknown>(arg: T): {
|
|
37
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
38
|
+
};
|
|
39
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
onDropRejected: {
|
|
42
|
+
defaultValue<T = unknown>(arg: T): {
|
|
43
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
45
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
46
|
+
};
|
|
47
|
+
disabled: {
|
|
48
|
+
defaultValue<T = unknown>(arg: T): {
|
|
49
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
50
|
+
};
|
|
51
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
52
|
+
};
|
|
53
|
+
multiple: {
|
|
54
|
+
defaultValue<T = unknown>(arg: T): {
|
|
55
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
58
|
+
};
|
|
59
|
+
accept: {
|
|
60
|
+
defaultValue<T = unknown>(arg: T): {
|
|
61
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
62
|
+
};
|
|
63
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
64
|
+
};
|
|
65
|
+
label: {
|
|
66
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
67
|
+
};
|
|
68
|
+
icon: {
|
|
69
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
+
};
|
|
71
|
+
actions: {
|
|
72
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
73
|
+
};
|
|
74
|
+
defaultActionLabel: {
|
|
75
|
+
defaultValue<T = unknown>(arg: T): {
|
|
76
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
78
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
79
|
+
};
|
|
80
|
+
showAltAction: {
|
|
81
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
82
|
+
};
|
|
83
|
+
altActionLabel: {
|
|
84
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
85
|
+
};
|
|
86
|
+
dragActiveInstructionalText: {
|
|
87
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
88
|
+
};
|
|
89
|
+
dragActiveIcon: {
|
|
90
|
+
defaultValue<T = unknown>(arg: T): {
|
|
91
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
92
|
+
};
|
|
93
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
94
|
+
};
|
|
95
|
+
acceptedTypesText: {
|
|
96
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
97
|
+
};
|
|
98
|
+
disabledDefault: {
|
|
99
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
100
|
+
};
|
|
101
|
+
disabledAlt: {
|
|
102
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
103
|
+
};
|
|
104
|
+
onDefaultHandlerClick: {
|
|
105
|
+
defaultValue<T = unknown>(arg: T): {
|
|
106
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
107
|
+
};
|
|
108
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
109
|
+
};
|
|
110
|
+
onAltHandlerClick: {
|
|
111
|
+
defaultValue<T = unknown>(arg: T): {
|
|
112
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
113
|
+
};
|
|
114
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
115
|
+
};
|
|
116
|
+
defaultActionTooltipText: {
|
|
117
|
+
defaultValue<T = unknown>(arg: T): {
|
|
118
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
119
|
+
};
|
|
120
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
121
|
+
};
|
|
122
|
+
altActionTooltipText: {
|
|
123
|
+
defaultValue<T = unknown>(arg: T): {
|
|
124
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
125
|
+
};
|
|
126
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
declare const UploaderWithSchema: {
|
|
131
|
+
(props?: DSUploaderPropsT | undefined): JSX.Element;
|
|
132
|
+
propTypes: unknown;
|
|
133
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
134
|
+
};
|
|
135
|
+
export { UploaderWithSchema };
|
|
136
|
+
export default DSUploader;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface DSUploaderPropsT {
|
|
3
|
+
containerProps?: Record<string, unknown>;
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: React.FC<{
|
|
6
|
+
size: string;
|
|
7
|
+
}>;
|
|
8
|
+
defaultActionLabel?: string;
|
|
9
|
+
dragActiveInstructionalText?: string;
|
|
10
|
+
dragActiveIcon?: React.FC;
|
|
11
|
+
altActionLabel?: string;
|
|
12
|
+
acceptedTypesText?: string;
|
|
13
|
+
disabledDefault?: boolean;
|
|
14
|
+
disabledAlt?: boolean;
|
|
15
|
+
onDefaultHandlerClick?: () => void | null;
|
|
16
|
+
onAltHandlerClick?: () => void | null;
|
|
17
|
+
actions?: Record<string, unknown>;
|
|
18
|
+
showAltAction?: boolean;
|
|
19
|
+
defaultActionTooltipText: string;
|
|
20
|
+
altActionTooltipText: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ActionButtonPropsT {
|
|
23
|
+
labelText: string;
|
|
24
|
+
variant: undefined | 'variant-disabled';
|
|
25
|
+
onClick: () => void | null;
|
|
26
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, UploaderWithSchema } from './DSUploader';
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
2
|
+
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
3
|
+
export declare const propTypes: {
|
|
4
|
+
containerProps: {
|
|
5
|
+
defaultValue<T = unknown>(arg: T): {
|
|
6
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
7
|
+
};
|
|
8
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
9
|
+
};
|
|
10
|
+
validator: {
|
|
11
|
+
defaultValue<T = unknown>(arg: T): {
|
|
12
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
13
|
+
};
|
|
14
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
15
|
+
};
|
|
16
|
+
maxFiles: {
|
|
17
|
+
defaultValue<T = unknown>(arg: T): {
|
|
18
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
19
|
+
};
|
|
20
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
21
|
+
};
|
|
22
|
+
minSize: {
|
|
23
|
+
defaultValue<T = unknown>(arg: T): {
|
|
24
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
25
|
+
};
|
|
26
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
27
|
+
};
|
|
28
|
+
maxSize: {
|
|
29
|
+
defaultValue<T = unknown>(arg: T): {
|
|
30
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
31
|
+
};
|
|
32
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
33
|
+
};
|
|
34
|
+
onDropRejected: {
|
|
35
|
+
defaultValue<T = unknown>(arg: T): {
|
|
36
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
38
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
39
|
+
};
|
|
40
|
+
disabled: {
|
|
41
|
+
defaultValue<T = unknown>(arg: T): {
|
|
42
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
43
|
+
};
|
|
44
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
45
|
+
};
|
|
46
|
+
multiple: {
|
|
47
|
+
defaultValue<T = unknown>(arg: T): {
|
|
48
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
49
|
+
};
|
|
50
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
51
|
+
};
|
|
52
|
+
accept: {
|
|
53
|
+
defaultValue<T = unknown>(arg: T): {
|
|
54
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
55
|
+
};
|
|
56
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
57
|
+
};
|
|
58
|
+
label: {
|
|
59
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
60
|
+
};
|
|
61
|
+
icon: {
|
|
62
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
63
|
+
};
|
|
64
|
+
actions: {
|
|
65
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
defaultActionLabel: {
|
|
68
|
+
defaultValue<T = unknown>(arg: T): {
|
|
69
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
+
};
|
|
71
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
72
|
+
};
|
|
73
|
+
showAltAction: {
|
|
74
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
75
|
+
};
|
|
76
|
+
altActionLabel: {
|
|
77
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
78
|
+
};
|
|
79
|
+
dragActiveInstructionalText: {
|
|
80
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
81
|
+
};
|
|
82
|
+
dragActiveIcon: {
|
|
83
|
+
defaultValue<T = unknown>(arg: T): {
|
|
84
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
85
|
+
};
|
|
86
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
87
|
+
};
|
|
88
|
+
acceptedTypesText: {
|
|
89
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
90
|
+
};
|
|
91
|
+
disabledDefault: {
|
|
92
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
93
|
+
};
|
|
94
|
+
disabledAlt: {
|
|
95
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
96
|
+
};
|
|
97
|
+
onDefaultHandlerClick: {
|
|
98
|
+
defaultValue<T = unknown>(arg: T): {
|
|
99
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
100
|
+
};
|
|
101
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
102
|
+
};
|
|
103
|
+
onAltHandlerClick: {
|
|
104
|
+
defaultValue<T = unknown>(arg: T): {
|
|
105
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
106
|
+
};
|
|
107
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
108
|
+
};
|
|
109
|
+
defaultActionTooltipText: {
|
|
110
|
+
defaultValue<T = unknown>(arg: T): {
|
|
111
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
112
|
+
};
|
|
113
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
114
|
+
};
|
|
115
|
+
altActionTooltipText: {
|
|
116
|
+
defaultValue<T = unknown>(arg: T): {
|
|
117
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
118
|
+
};
|
|
119
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/DSUploader/package.json
DELETED
package/cjs/DSUploader.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSUploader.js","sources":["../../src/DSUploader.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { runAll } from '@elliemae/ds-utilities';\nimport { UploadFile } from '@elliemae/ds-icons';\nimport DSButton, { BUTTON_VARIANT } from '@elliemae/ds-button';\nimport { useDropzone } from 'react-dropzone';\nimport DSTooltip from '@elliemae/ds-tooltip';\nimport { propTypes } from './propTypes';\nimport type { DSUploaderPropsT, ActionButtonPropsT } from './index.d';\n\nconst blockName = 'uploader';\nconst blockNameInfo = `${blockName}-info`;\nconst blockNameDragActive = `${blockName}-drag-active`;\nconst blockNameWrapper = `${blockName}-wrapper`;\n\nconst UploaderWrapper = aggregatedClasses('div')(blockNameWrapper, null, ({ disabled }) => ({ disabled }));\nconst Uploader = aggregatedClasses('div')(blockName, null, ({ isDragActive }) => ({ 'drag-active': isDragActive }));\nconst UploaderDragActive = aggregatedClasses('div')(blockNameDragActive);\nconst UploaderIconArea = aggregatedClasses('div')(`${blockName}-icon-wrapper`);\nconst UploaderInfo = aggregatedClasses('div')(blockNameInfo);\nconst InfoText = aggregatedClasses('span')(blockNameInfo, 'text');\nconst UploaderActions = aggregatedClasses('div')(blockNameInfo, 'actions');\nconst AcceptedTypes = aggregatedClasses('div')(blockNameWrapper, 'accepted-types');\n\nconst DividerVertical = aggregatedClasses('div')('divider', null, ({ vertical }) => ({ vertical }));\n\nfunction ActionButton({ labelText, ...otherProps }: ActionButtonPropsT): React.ReactElement {\n return <DSButton {...otherProps} buttonType=\"text\" labelText={labelText} />;\n}\n\nconst noop = () => null;\n\nconst DSUploader = ({\n containerProps = {},\n label = 'Browse', // todo: i18n\n icon: UploadFileIcon = UploadFile,\n defaultActionLabel = 'LOCAL DRIVE', // todo: i18n\n dragActiveInstructionalText = 'DROP FILES HERE',\n dragActiveIcon: DragActiveIcon = UploadFile,\n altActionLabel = 'DOCUMENTS', // todo: i18n\n acceptedTypesText = 'JPG, JPEG, PNG, PDF',\n disabledDefault = false,\n disabledAlt = false,\n onDefaultHandlerClick = noop,\n onAltHandlerClick = noop,\n actions = { defaultAction: 'LOCAL DRIVE', altAction: 'DOCUMENTS' },\n showAltAction = false,\n defaultActionTooltipText,\n altActionTooltipText,\n ...dropzoneProps\n}: DSUploaderPropsT): JSX.Element => {\n const { getRootProps, getInputProps, isDragActive } = useDropzone(dropzoneProps);\n const { onClick: onOpenFile, ...rootProps } = getRootProps();\n const disabledAll = disabledDefault && disabledAlt;\n\n const delfaultActionButton = (\n <ActionButton\n variant={disabledDefault && BUTTON_VARIANT.DISABLED}\n labelText={actions.defaultAction ? (actions.defaultAction as string) : defaultActionLabel}\n onClick={(...args) => {\n if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...args);\n }}\n />\n );\n\n const altActionButton = (\n <ActionButton\n variant={disabledAlt && BUTTON_VARIANT.DISABLED}\n labelText={actions.altAction ? (actions.altAction as string) : altActionLabel}\n onClick={(...args) => {\n if (!disabledAlt) onAltHandlerClick(...args);\n }}\n />\n );\n\n const defaultAction = !defaultActionTooltipText ? (\n delfaultActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'default-action-tooltip' }}\n interactionType=\"hover\"\n title={defaultActionTooltipText}\n triggerComponent={delfaultActionButton}\n />\n );\n\n const altAction = !altActionTooltipText ? (\n altActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'alt-action-tooltip' }}\n interactionType=\"hover\"\n title={altActionTooltipText}\n triggerComponent={altActionButton}\n />\n );\n\n return (\n <UploaderWrapper {...containerProps} classProps={{ disabled: disabledAll }}>\n <Uploader {...rootProps} classProps={{ isDragActive }}>\n <UploaderIconArea>\n <UploadFileIcon size=\"l\" />\n </UploaderIconArea>\n <DividerVertical />\n <UploaderInfo>\n <InfoText>{label}</InfoText>\n <UploaderActions>\n {actions.defaultAction && defaultAction}\n {(actions.altAction || showAltAction) && (\n <>\n {actions.defaultAction && <DividerVertical />}\n {altAction}\n </>\n )}\n </UploaderActions>\n </UploaderInfo>\n {!disabledAll && (\n <UploaderDragActive>\n <DragActiveIcon />\n {dragActiveInstructionalText}\n </UploaderDragActive>\n )}\n {!disabledAll && <input {...getInputProps()} />}\n </Uploader>\n {typeof acceptedTypesText === 'string' && <AcceptedTypes>{acceptedTypesText.toUpperCase()}</AcceptedTypes>}\n </UploaderWrapper>\n );\n};\n\nDSUploader.actions = {\n defaultAction: 'LOCAL DRIVE',\n altAction: 'DOCUMENTS',\n};\n\nDSUploader.propTypes = propTypes;\n\nconst UploaderWithSchema = describe(DSUploader);\nUploaderWithSchema.propTypes = propTypes;\n\nexport { UploaderWithSchema };\nexport default DSUploader;\n"],"names":["blockName","blockNameInfo","blockNameDragActive","blockNameWrapper","UploaderWrapper","aggregatedClasses","disabled","Uploader","isDragActive","UploaderDragActive","UploaderIconArea","UploaderInfo","InfoText","UploaderActions","AcceptedTypes","DividerVertical","vertical","ActionButton","labelText","otherProps","React","DSButton","noop","DSUploader","containerProps","label","icon","UploadFileIcon","UploadFile","defaultActionLabel","dragActiveInstructionalText","dragActiveIcon","DragActiveIcon","altActionLabel","acceptedTypesText","disabledDefault","disabledAlt","onDefaultHandlerClick","onAltHandlerClick","actions","defaultAction","altAction","showAltAction","defaultActionTooltipText","altActionTooltipText","dropzoneProps","useDropzone","getRootProps","getInputProps","onOpenFile","onClick","rootProps","disabledAll","delfaultActionButton","BUTTON_VARIANT","DISABLED","runAll","altActionButton","DSTooltip","id","toUpperCase","propTypes","UploaderWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,SAAS,G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AAX,GAAuBA,mBAAvB;IAEMC,kBAAkB,GAAGC,kBAAQ,CAACxC,UAAD;AACnCuC,kBAAkB,CAACD,SAAnB,GAA+BA,mBAA/B;;;;;"}
|
package/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/cjs/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/propTypes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { UploadFile } from '@elliemae/ds-icons';\n/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */\n\nexport const propTypes = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),\n validator: PropTypes.func.description(\n \"Custom validator. It must return null if it's valid or an object `{ code: string, message: string }` if it's not.\",\n ),\n maxFiles: PropTypes.number.description('Number of files accepted.'),\n minSize: PropTypes.number.description('Minimun file size accepted in bytes.'),\n maxSize: PropTypes.number.description('Maximum file size accepted in bytes.'),\n onDropRejected: PropTypes.func.description(\n 'Cb called when files are rejected using maxFiles, minSize or maxSize properties.',\n ),\n disabled: PropTypes.bool.description('Disables the DSUploader.'),\n multiple: PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),\n accept: PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),\n\n label: PropTypes.string.description('Uploader label.').defaultValue('Browse'),\n icon: PropTypes.element.description('Uploader left icon.').defaultValue(UploadFile),\n actions: PropTypes.shape({\n defaultAction: PropTypes.string,\n altAction: PropTypes.string,\n })\n .description('Uploader actions.')\n .defaultValue({ defaultAction: 'LOCAL DRIVE' }),\n defaultActionLabel: PropTypes.string.description('First action button label.'),\n showAltAction: PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),\n altActionLabel: PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),\n dragActiveInstructionalText: PropTypes.string\n .description('informative text when user drags a file over the uploader zone.')\n .defaultValue('DROP FILES HERE'),\n dragActiveIcon: PropTypes.string.description('Icon when user drags a file over the uploader zone.'),\n acceptedTypesText: PropTypes.string\n .description('Information text to show what types are supported.')\n .defaultValue('JPG, JPEG, PNG, PDF'),\n disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),\n disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),\n onDefaultHandlerClick: PropTypes.func.description('First action button click handler.'),\n onAltHandlerClick: PropTypes.func.description('Second action button click handler.'),\n defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button.'),\n altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button.'),\n};\n"],"names":["propTypes","containerProps","PropTypes","object","description","validator","func","maxFiles","number","minSize","maxSize","onDropRejected","disabled","bool","multiple","accept","string","label","defaultValue","icon","element","UploadFile","actions","shape","defaultAction","altAction","defaultActionLabel","showAltAction","altActionLabel","dragActiveInstructionalText","dragActiveIcon","acceptedTypesText","disabledDefault","disabledAlt","onDefaultHandlerClick","onAltHandlerClick","defaultActionTooltipText","altActionTooltipText"],"mappings":";;;;;;;AAEA;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,cAAc,EAAEC,mBAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mDAA7B,CADO;AAEvBC,EAAAA,SAAS,EAAEH,mBAAS,CAACI,IAAV,CAAeF,WAAf,CACT,mHADS,CAFY;AAKvBG,EAAAA,QAAQ,EAAEL,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,2BAA7B,CALa;AAMvBK,EAAAA,OAAO,EAAEP,mBAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sCAA7B,CANc;AAOvBM,EAAAA,OAAO,EAA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AA,2BAA2B,EAAE3B,mBAAS,CAACc,MAAV,CAC1BZ,WAD0B,CACd,iEADc,EAE1Bc,YAF0B,CAEb,iBAFa,CA1BN;AA6BvBY,EAAAA,cAAc,EAAE5B,mBAAS,CAACc,MAAV,CAAiBZ,WAAjB,CAA6B,qDAA7B,CA7BO;AA8BvB2B,EAAAA,iBAAiB,EAAE7B,mBAAS,CAACc,MAAV,CAChBZ,WADgB,CACJ,oDADI,EAEhBc,YAFgB,CAEH,qBAFG,CA9BI;AAiCvBc,EAAAA,eAAe,EAAE9B,mBAAS,CAACW,IAAV,CAAeT,WAAf,CAA2B,kDAA3B,EAA+Ec,YAA/E,CAA4F,KAA5F,CAjCM;AAkCvBe,EAAAA,WAAW,EAAE/B,mBAAS,CAACW,IAAV,CAAeT,WAAf,CAA2B,sDAA3B,EAAmFc,YAAnF,CAAgG,KAAhG,CAlCU;AAmCvBgB,EAAAA,qBAAqB,EAAEhC,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,oCAA3B,CAnCA;AAoCvB+B,EAAAA,iBAAiB,EAAEjC,mBAAS,CAACI,IAAV,CAAeF,WAAf,CAA2B,qCAA3B,CApCI;AAqCvBgC,EAAAA,wBAAwB,EAAElC,mBAAS,CAACc,MAAV,CAAiBZ,WAAjB,CAA6B,yCAA7B,CArCH;AAsCvBiC,EAAAA,oBAAoB,EAAEnC,mBAAS,CAACc,MAAV,CAAiBZ,WAAjB,CAA6B,2CAA7B;AAtCC;;;;"}
|
package/esm/DSUploader.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DSUploader.js","sources":["../../src/DSUploader.tsx"],"sourcesContent":["/* eslint-disable max-lines */\n/* eslint-disable complexity */\nimport React from 'react';\nimport { describe } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { runAll } from '@elliemae/ds-utilities';\nimport { UploadFile } from '@elliemae/ds-icons';\nimport DSButton, { BUTTON_VARIANT } from '@elliemae/ds-button';\nimport { useDropzone } from 'react-dropzone';\nimport DSTooltip from '@elliemae/ds-tooltip';\nimport { propTypes } from './propTypes';\nimport type { DSUploaderPropsT, ActionButtonPropsT } from './index.d';\n\nconst blockName = 'uploader';\nconst blockNameInfo = `${blockName}-info`;\nconst blockNameDragActive = `${blockName}-drag-active`;\nconst blockNameWrapper = `${blockName}-wrapper`;\n\nconst UploaderWrapper = aggregatedClasses('div')(blockNameWrapper, null, ({ disabled }) => ({ disabled }));\nconst Uploader = aggregatedClasses('div')(blockName, null, ({ isDragActive }) => ({ 'drag-active': isDragActive }));\nconst UploaderDragActive = aggregatedClasses('div')(blockNameDragActive);\nconst UploaderIconArea = aggregatedClasses('div')(`${blockName}-icon-wrapper`);\nconst UploaderInfo = aggregatedClasses('div')(blockNameInfo);\nconst InfoText = aggregatedClasses('span')(blockNameInfo, 'text');\nconst UploaderActions = aggregatedClasses('div')(blockNameInfo, 'actions');\nconst AcceptedTypes = aggregatedClasses('div')(blockNameWrapper, 'accepted-types');\n\nconst DividerVertical = aggregatedClasses('div')('divider', null, ({ vertical }) => ({ vertical }));\n\nfunction ActionButton({ labelText, ...otherProps }: ActionButtonPropsT): React.ReactElement {\n return <DSButton {...otherProps} buttonType=\"text\" labelText={labelText} />;\n}\n\nconst noop = () => null;\n\nconst DSUploader = ({\n containerProps = {},\n label = 'Browse', // todo: i18n\n icon: UploadFileIcon = UploadFile,\n defaultActionLabel = 'LOCAL DRIVE', // todo: i18n\n dragActiveInstructionalText = 'DROP FILES HERE',\n dragActiveIcon: DragActiveIcon = UploadFile,\n altActionLabel = 'DOCUMENTS', // todo: i18n\n acceptedTypesText = 'JPG, JPEG, PNG, PDF',\n disabledDefault = false,\n disabledAlt = false,\n onDefaultHandlerClick = noop,\n onAltHandlerClick = noop,\n actions = { defaultAction: 'LOCAL DRIVE', altAction: 'DOCUMENTS' },\n showAltAction = false,\n defaultActionTooltipText,\n altActionTooltipText,\n ...dropzoneProps\n}: DSUploaderPropsT): JSX.Element => {\n const { getRootProps, getInputProps, isDragActive } = useDropzone(dropzoneProps);\n const { onClick: onOpenFile, ...rootProps } = getRootProps();\n const disabledAll = disabledDefault && disabledAlt;\n\n const delfaultActionButton = (\n <ActionButton\n variant={disabledDefault && BUTTON_VARIANT.DISABLED}\n labelText={actions.defaultAction ? (actions.defaultAction as string) : defaultActionLabel}\n onClick={(...args) => {\n if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...args);\n }}\n />\n );\n\n const altActionButton = (\n <ActionButton\n variant={disabledAlt && BUTTON_VARIANT.DISABLED}\n labelText={actions.altAction ? (actions.altAction as string) : altActionLabel}\n onClick={(...args) => {\n if (!disabledAlt) onAltHandlerClick(...args);\n }}\n />\n );\n\n const defaultAction = !defaultActionTooltipText ? (\n delfaultActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'default-action-tooltip' }}\n interactionType=\"hover\"\n title={defaultActionTooltipText}\n triggerComponent={delfaultActionButton}\n />\n );\n\n const altAction = !altActionTooltipText ? (\n altActionButton\n ) : (\n <DSTooltip\n containerProps={{ id: 'alt-action-tooltip' }}\n interactionType=\"hover\"\n title={altActionTooltipText}\n triggerComponent={altActionButton}\n />\n );\n\n return (\n <UploaderWrapper {...containerProps} classProps={{ disabled: disabledAll }}>\n <Uploader {...rootProps} classProps={{ isDragActive }}>\n <UploaderIconArea>\n <UploadFileIcon size=\"l\" />\n </UploaderIconArea>\n <DividerVertical />\n <UploaderInfo>\n <InfoText>{label}</InfoText>\n <UploaderActions>\n {actions.defaultAction && defaultAction}\n {(actions.altAction || showAltAction) && (\n <>\n {actions.defaultAction && <DividerVertical />}\n {altAction}\n </>\n )}\n </UploaderActions>\n </UploaderInfo>\n {!disabledAll && (\n <UploaderDragActive>\n <DragActiveIcon />\n {dragActiveInstructionalText}\n </UploaderDragActive>\n )}\n {!disabledAll && <input {...getInputProps()} />}\n </Uploader>\n {typeof acceptedTypesText === 'string' && <AcceptedTypes>{acceptedTypesText.toUpperCase()}</AcceptedTypes>}\n </UploaderWrapper>\n );\n};\n\nDSUploader.actions = {\n defaultAction: 'LOCAL DRIVE',\n altAction: 'DOCUMENTS',\n};\n\nDSUploader.propTypes = propTypes;\n\nconst UploaderWithSchema = describe(DSUploader);\nUploaderWithSchema.propTypes = propTypes;\n\nexport { UploaderWithSchema };\nexport default DSUploader;\n"],"names":["blockName","blockNameInfo","blockNameDragActive","blockNameWrapper","UploaderWrapper","aggregatedClasses","disabled","Uploader","isDragActive","UploaderDragActive","UploaderIconArea","UploaderInfo","InfoText","UploaderActions","AcceptedTypes","DividerVertical","vertical","ActionButton","labelText","otherProps","noop","DSUploader","containerProps","label","icon","UploadFileIcon","UploadFile","defaultActionLabel","dragActiveInstructionalText","dragActiveIcon","DragActiveIcon","altActionLabel","acceptedTypesText","disabledDefault","disabledAlt","onDefaultHandlerClick","onAltHandlerClick","actions","defaultAction","altAction","showAltAction","defaultActionTooltipText","altActionTooltipText","dropzoneProps","useDropzone","getRootProps","getInputProps","onOpenFile","onClick","rootProps","disabledAll","delfaultActionButton","BUTTON_VARIANT","DISABLED","runAll","altActionButton","id","toUpperCase","propTypes","UploaderWithSchema","describe"],"mappings":";;;;;;;;;;;;;;;AAaA,IAAMA,SAAS,GAAG,UAAlB;AACA,IAAMC,aAAa,aAAMD,SAAN,UAAnB;AACA,IAAME,mBAAmB,aAAMF,SAAN,iBAAzB;AACA,IAAMG,gBAAgB,aAAMH,SAAN,aAAtB;AAEA,IAAMI,eAAe,GAAGC,iBAAiB,CAAC,KAAD,CAAjB,CAAyBF,gBAAzB,EAA2C,IAA3C,EAAiD;AAAA,MAAGG,QAAH,QAAGA,QAAH;AAAA,SAAmB;AAAEA,IAAAA,QAAQ,EAARA;AAAF,GAAnB;AAAA,CAAjD,CAAxB;AACA,IAAMC,QAAQ,GAAGF,iBAAiB,CAAC,KAAD,CAAjB,CAAyBL,SAAzB,EAAoC,IAApC,EAA0C;AAAA,MAAGQ,YAAH,SAAGA,YAAH;AAAA,SAAuB;AAAE,mB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AAC;AAArB,IADF,CADF,eAIE,oBAAC,eAAD,OAJF,eAKE,oBAAC,YAAD,qBACE,oBAAC,QAAD,QAAWe,KAAX,CADF,eAEE,oBAAC,eAAD,QACGc,OAAO,CAACC,aAAR,IAAyBA,aAD5B,EAEG,CAACD,OAAO,CAACE,SAAR,IAAqBC,aAAtB,kBACC,0CACGH,OAAO,CAACC,aAAR,iBAAyB,oBAAC,eAAD,OAD5B,EAEGC,SAFH,CAHJ,CAFF,CALF,EAiBG,CAACW,WAAD,iBACC,oBAAC,kBAAD,qBACE,oBAAC,cAAD,OADF,EAEGtB,2BAFH,CAlBJ,EAuBG,CAACsB,WAAD,iBAAgB,6BAAWJ,aAAa,EAAxB,CAvBnB,CADF,EA0BG,OAAOd,iBAAP,KAA6B,QAA7B,iBAAyC,oBAAC,aAAD,QAAgBA,iBAAiB,CAACyB,WAAlB,EAAhB,CA1B5C,CADF;AA8BD;;AAEDpC,UAAU,CAACgB,OAAX,GAAqB;AACnBC,EAAAA,aAAa,EAAE,aADI;AAEnBC,EAAAA,SAAS,EAAE;AAFQ,CAArB;AAKAlB,UAAU,CAACqC,SAAX,GAAuBA,SAAvB;IAEMC,kBAAkB,GAAGC,QAAQ,CAACvC,UAAD;AACnCsC,kBAAkB,CAACD,SAAnB,GAA+BA,SAA/B;;;;"}
|
package/esm/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/esm/propTypes.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"propTypes.js","sources":["../../src/propTypes.tsx"],"sourcesContent":["import { PropTypes } from 'react-desc';\nimport { UploadFile } from '@elliemae/ds-icons';\n/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */\n\nexport const propTypes = {\n containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),\n validator: PropTypes.func.description(\n \"Custom validator. It must return null if it's valid or an object `{ code: string, message: string }` if it's not.\",\n ),\n maxFiles: PropTypes.number.description('Number of files accepted.'),\n minSize: PropTypes.number.description('Minimun file size accepted in bytes.'),\n maxSize: PropTypes.number.description('Maximum file size accepted in bytes.'),\n onDropRejected: PropTypes.func.description(\n 'Cb called when files are rejected using maxFiles, minSize or maxSize properties.',\n ),\n disabled: PropTypes.bool.description('Disables the DSUploader.'),\n multiple: PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),\n accept: PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),\n\n label: PropTypes.string.description('Uploader label.').defaultValue('Browse'),\n icon: PropTypes.element.description('Uploader left icon.').defaultValue(UploadFile),\n actions: PropTypes.shape({\n defaultAction: PropTypes.string,\n altAction: PropTypes.string,\n })\n .description('Uploader actions.')\n .defaultValue({ defaultAction: 'LOCAL DRIVE' }),\n defaultActionLabel: PropTypes.string.description('First action button label.'),\n showAltAction: PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),\n altActionLabel: PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),\n dragActiveInstructionalText: PropTypes.string\n .description('informative text when user drags a file over the uploader zone.')\n .defaultValue('DROP FILES HERE'),\n dragActiveIcon: PropTypes.string.description('Icon when user drags a file over the uploader zone.'),\n acceptedTypesText: PropTypes.string\n .description('Information text to show what types are supported.')\n .defaultValue('JPG, JPEG, PNG, PDF'),\n disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),\n disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),\n onDefaultHandlerClick: PropTypes.func.description('First action button click handler.'),\n onAltHandlerClick: PropTypes.func.description('Second action button click handler.'),\n defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button.'),\n altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button.'),\n};\n"],"names":["propTypes","containerProps","PropTypes","object","description","validator","func","maxFiles","number","minSize","maxSize","onDropRejected","disabled","bool","multiple","accept","string","label","defaultValue","icon","element","UploadFile","actions","shape","defaultAction","altAction","defaultActionLabel","showAltAction","altActionLabel","dragActiveInstructionalText","dragActiveIcon","acceptedTypesText","disabledDefault","disabledAlt","onDefaultHandlerClick","onAltHandlerClick","defaultActionTooltipText","altActionTooltipText"],"mappings":";;;AAEA;;IAEaA,SAAS,GAAG;AACvBC,EAAAA,cAAc,EAAEC,SAAS,CAACC,MAAV,CAAiBC,WAAjB,CAA6B,mDAA7B,CADO;AAEvBC,EAAAA,SAAS,EAAEH,SAAS,CAACI,IAAV,CAAeF,WAAf,CACT,mHADS,CAFY;AAKvBG,EAAAA,QAAQ,EAAEL,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,2BAA7B,CALa;AAMvBK,EAAAA,OAAO,EAAEP,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sCAA7B,CANc;AAOvBM,EAAAA,OAAO,EAAER,SAAS,CAACM,MAAV,CAAiBJ,WAAjB,CAA6B,sCAA7B,CAPc;AAQvBO,EAAAA,cAAc,EAAET,SAAS,CAACI,IAAV,CAAeF,WAAf,CACd,kFADc,CARO;AAWvBQ,EAAAA,QAAQ,EAAEV,SAAS,CAACW,IAAV,CAAeT,WAAf,CAA2B,0BAA3B,CAXa;AAYvBU,EAAAA,QAAQ,EAAEZ,SAAS,CAACW,IAAV,CAAeT,WAAf,CAA2B,2DAA3B,CAZa;AAavBW,EAAAA,MAAM,EAAEb,SAAS,CAACc,MAAV,CAAiBZ,WAAjB,CAA6B,6DAA7B,CAbe;AAevBa,EAAAA,KAAK,EAAEf,SAAS,CAACc,MAAV,CAAiBZ,WAAjB,CAA6B,iBAA7B,EAAgDc,YAAhD,CAA6D,QAA7D,CAfgB;AAgBvBC,EAAAA,IAAI,EAAEjB,SAAS,CAACkB,OAAV,CAAkBhB,WA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