@elliemae/ds-uploader 2.0.0-alpha.1 → 2.0.0-alpha.13
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 +68 -78
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +1 -1
- package/cjs/propTypes.js +42 -0
- package/esm/DSUploader.js +54 -63
- package/esm/index.d.js +1 -0
- package/esm/propTypes.js +38 -0
- package/package.json +19 -8
- package/types/DSUploader.d.ts +125 -39
- package/types/index.d.d.ts +26 -0
- package/types/propTypes.d.ts +121 -0
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSUploader.js
CHANGED
|
@@ -5,14 +5,21 @@ 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');
|
|
22
|
+
var propTypes = require('./propTypes.js');
|
|
16
23
|
var jsxRuntime = require('react/jsx-runtime');
|
|
17
24
|
|
|
18
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -20,7 +27,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
27
|
var _jsx2__default = /*#__PURE__*/_interopDefaultLegacy(_jsx2);
|
|
21
28
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
29
|
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
23
|
-
var UploadFile__default = /*#__PURE__*/_interopDefaultLegacy(UploadFile);
|
|
24
30
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
25
31
|
var DSTooltip__default = /*#__PURE__*/_interopDefaultLegacy(DSTooltip);
|
|
26
32
|
|
|
@@ -32,40 +38,49 @@ const _excluded = ["labelText"],
|
|
|
32
38
|
|
|
33
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; }
|
|
34
40
|
|
|
35
|
-
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[
|
|
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; }
|
|
36
42
|
const blockName = 'uploader';
|
|
37
|
-
const blockNameInfo =
|
|
38
|
-
const blockNameDragActive =
|
|
39
|
-
const blockNameWrapper =
|
|
40
|
-
const UploaderWrapper = dsClassnames.aggregatedClasses('div')(blockNameWrapper, null,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
|
|
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
|
+
});
|
|
50
62
|
const UploaderDragActive = dsClassnames.aggregatedClasses('div')(blockNameDragActive);
|
|
51
|
-
const UploaderIconArea = dsClassnames.aggregatedClasses('div')(
|
|
63
|
+
const UploaderIconArea = dsClassnames.aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
52
64
|
const UploaderInfo = dsClassnames.aggregatedClasses('div')(blockNameInfo);
|
|
53
65
|
const InfoText = dsClassnames.aggregatedClasses('span')(blockNameInfo, 'text');
|
|
54
66
|
const UploaderActions = dsClassnames.aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
55
67
|
const AcceptedTypes = dsClassnames.aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
56
|
-
const DividerVertical = dsClassnames.aggregatedClasses('div')('divider', null,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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) {
|
|
63
78
|
let {
|
|
64
79
|
labelText
|
|
65
|
-
} =
|
|
66
|
-
otherProps = _objectWithoutProperties__default[
|
|
80
|
+
} = _ref4,
|
|
81
|
+
otherProps = _objectWithoutProperties__default["default"](_ref4, _excluded);
|
|
67
82
|
|
|
68
|
-
return /*#__PURE__*/jsxRuntime.jsx(DSButton__default[
|
|
83
|
+
return /*#__PURE__*/jsxRuntime.jsx(DSButton__default["default"], _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
69
84
|
buttonType: "text",
|
|
70
85
|
labelText: labelText
|
|
71
86
|
}));
|
|
@@ -73,16 +88,16 @@ function ActionButton(_ref) {
|
|
|
73
88
|
|
|
74
89
|
const noop = () => null;
|
|
75
90
|
|
|
76
|
-
const DSUploader =
|
|
91
|
+
const DSUploader = _ref5 => {
|
|
77
92
|
let {
|
|
78
93
|
containerProps = {},
|
|
79
94
|
label = 'Browse',
|
|
80
95
|
// todo: i18n
|
|
81
|
-
icon: UploadFileIcon =
|
|
96
|
+
icon: UploadFileIcon = dsIcons.UploadFile,
|
|
82
97
|
defaultActionLabel = 'LOCAL DRIVE',
|
|
83
98
|
// todo: i18n
|
|
84
99
|
dragActiveInstructionalText = 'DROP FILES HERE',
|
|
85
|
-
dragActiveIcon: DragActiveIcon =
|
|
100
|
+
dragActiveIcon: DragActiveIcon = dsIcons.UploadFile,
|
|
86
101
|
altActionLabel = 'DOCUMENTS',
|
|
87
102
|
// todo: i18n
|
|
88
103
|
acceptedTypesText = 'JPG, JPEG, PNG, PDF',
|
|
@@ -91,13 +106,14 @@ const DSUploader = _ref2 => {
|
|
|
91
106
|
onDefaultHandlerClick = noop,
|
|
92
107
|
onAltHandlerClick = noop,
|
|
93
108
|
actions = {
|
|
94
|
-
defaultAction: 'LOCAL DRIVE'
|
|
109
|
+
defaultAction: 'LOCAL DRIVE',
|
|
110
|
+
altAction: 'DOCUMENTS'
|
|
95
111
|
},
|
|
96
112
|
showAltAction = false,
|
|
97
113
|
defaultActionTooltipText,
|
|
98
114
|
altActionTooltipText
|
|
99
|
-
} =
|
|
100
|
-
dropzoneProps = _objectWithoutProperties__default[
|
|
115
|
+
} = _ref5,
|
|
116
|
+
dropzoneProps = _objectWithoutProperties__default["default"](_ref5, _excluded2);
|
|
101
117
|
|
|
102
118
|
const {
|
|
103
119
|
getRootProps,
|
|
@@ -109,27 +125,27 @@ const DSUploader = _ref2 => {
|
|
|
109
125
|
{
|
|
110
126
|
onClick: onOpenFile
|
|
111
127
|
} = _getRootProps,
|
|
112
|
-
rootProps = _objectWithoutProperties__default[
|
|
128
|
+
rootProps = _objectWithoutProperties__default["default"](_getRootProps, _excluded3);
|
|
113
129
|
|
|
114
130
|
const disabledAll = disabledDefault && disabledAlt;
|
|
115
131
|
|
|
116
|
-
const delfaultActionButton = /*#__PURE__*/_jsx2__default[
|
|
132
|
+
const delfaultActionButton = /*#__PURE__*/_jsx2__default["default"](ActionButton, {
|
|
117
133
|
variant: disabledDefault && DSButton.BUTTON_VARIANT.DISABLED,
|
|
118
134
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
119
|
-
onClick: (
|
|
120
|
-
if (!disabledDefault)
|
|
135
|
+
onClick: function () {
|
|
136
|
+
if (!disabledDefault) dsUtilities.runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
121
137
|
}
|
|
122
138
|
});
|
|
123
139
|
|
|
124
|
-
const altActionButton = /*#__PURE__*/_jsx2__default[
|
|
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: (
|
|
128
|
-
if (!disabledAlt) onAltHandlerClick(...
|
|
143
|
+
onClick: function () {
|
|
144
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
129
145
|
}
|
|
130
146
|
});
|
|
131
147
|
|
|
132
|
-
const defaultAction = !defaultActionTooltipText ? delfaultActionButton : /*#__PURE__*/_jsx2__default[
|
|
148
|
+
const defaultAction = !defaultActionTooltipText ? delfaultActionButton : /*#__PURE__*/_jsx2__default["default"](DSTooltip__default["default"], {
|
|
133
149
|
containerProps: {
|
|
134
150
|
id: 'default-action-tooltip'
|
|
135
151
|
},
|
|
@@ -137,7 +153,7 @@ const DSUploader = _ref2 => {
|
|
|
137
153
|
title: defaultActionTooltipText,
|
|
138
154
|
triggerComponent: delfaultActionButton
|
|
139
155
|
});
|
|
140
|
-
const altAction = !altActionTooltipText ? altActionButton : /*#__PURE__*/_jsx2__default[
|
|
156
|
+
const altAction = !altActionTooltipText ? altActionButton : /*#__PURE__*/_jsx2__default["default"](DSTooltip__default["default"], {
|
|
141
157
|
containerProps: {
|
|
142
158
|
id: 'alt-action-tooltip'
|
|
143
159
|
},
|
|
@@ -153,12 +169,12 @@ const DSUploader = _ref2 => {
|
|
|
153
169
|
classProps: {
|
|
154
170
|
isDragActive
|
|
155
171
|
},
|
|
156
|
-
children: [/*#__PURE__*/_jsx2__default[
|
|
172
|
+
children: [/*#__PURE__*/_jsx2__default["default"](UploaderIconArea, {}, void 0, /*#__PURE__*/_jsx2__default["default"](UploadFileIcon, {
|
|
157
173
|
size: "l"
|
|
158
|
-
})), _DividerVertical || (_DividerVertical = /*#__PURE__*/_jsx2__default[
|
|
159
|
-
children: [actions.defaultAction && (_DividerVertical2 || (_DividerVertical2 = /*#__PURE__*/_jsx2__default[
|
|
160
|
-
}))), !disabledAll && /*#__PURE__*/_jsx2__default[
|
|
161
|
-
})), typeof acceptedTypesText === 'string' && /*#__PURE__*/_jsx2__default[
|
|
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())]
|
|
162
178
|
}));
|
|
163
179
|
};
|
|
164
180
|
|
|
@@ -166,34 +182,8 @@ DSUploader.actions = {
|
|
|
166
182
|
defaultAction: 'LOCAL DRIVE',
|
|
167
183
|
altAction: 'DOCUMENTS'
|
|
168
184
|
};
|
|
169
|
-
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
170
|
-
|
|
171
|
-
const uploaderProps = {
|
|
172
|
-
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
|
|
173
|
-
dropzoneProps: reactDesc.PropTypes.object.description('props of react-dropzone https://react-dropzone.netlify.com/'),
|
|
174
|
-
label: reactDesc.PropTypes.string.description('Uploader label').defaultValue('Browse'),
|
|
175
|
-
icon: reactDesc.PropTypes.element.description('Uploader left icon').defaultValue(UploadFile__default['default']),
|
|
176
|
-
actions: reactDesc.PropTypes.shape({
|
|
177
|
-
defaultAction: reactDesc.PropTypes.string,
|
|
178
|
-
altAction: reactDesc.PropTypes.string
|
|
179
|
-
}).description('Uploader actions').defaultValue({
|
|
180
|
-
defaultAction: 'LOCAL DRIVE'
|
|
181
|
-
}),
|
|
182
|
-
defaultActionLabel: reactDesc.PropTypes.string.description('First action button label'),
|
|
183
|
-
showAltAction: reactDesc.PropTypes.bool.description('whether to show alternate action button or not').defaultValue(true),
|
|
184
|
-
altActionLabel: reactDesc.PropTypes.string.description('Second action button label').defaultValue('LOCAL DRIVE'),
|
|
185
|
-
dragActiveInstructionalText: reactDesc.PropTypes.string.description('informative text when user drags a file over the uploader zone').defaultValue('DROP FILES HERE'),
|
|
186
|
-
dragActiveIcon: reactDesc.PropTypes.string.description('Icon when user drags a file over the uploader zone'),
|
|
187
|
-
acceptedTypesText: reactDesc.PropTypes.string.description('Information text to show what types are supported').defaultValue('JPG, JPEG, PNG, PDF'),
|
|
188
|
-
disabledDefault: reactDesc.PropTypes.bool.description('Whether the default uploader is disabled or not').defaultValue(false),
|
|
189
|
-
disabledAlt: reactDesc.PropTypes.bool.description('Whether the alternative uploader is disabled or not').defaultValue(false),
|
|
190
|
-
onDefaultHandlerClick: reactDesc.PropTypes.func.description('First action button click handler'),
|
|
191
|
-
onAltHandlerClick: reactDesc.PropTypes.func.description('Second action button click handler'),
|
|
192
|
-
defaultActionTooltipText: reactDesc.PropTypes.string.description('shows tooltip in default action button'),
|
|
193
|
-
altActionTooltipText: reactDesc.PropTypes.string.description('Shows tooltip in alternate action button')
|
|
194
|
-
};
|
|
195
185
|
const UploaderWithSchema = reactDesc.describe(DSUploader);
|
|
196
|
-
UploaderWithSchema.propTypes =
|
|
186
|
+
UploaderWithSchema.propTypes = propTypes.propTypes;
|
|
197
187
|
|
|
198
188
|
exports.UploaderWithSchema = UploaderWithSchema;
|
|
199
|
-
exports[
|
|
189
|
+
exports["default"] = DSUploader;
|
package/cjs/index.d.js
ADDED
package/cjs/index.js
CHANGED
package/cjs/propTypes.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactDesc = require('react-desc');
|
|
6
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
7
|
+
|
|
8
|
+
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
9
|
+
|
|
10
|
+
const propTypes = {
|
|
11
|
+
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container.'),
|
|
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
|
+
maxFiles: reactDesc.PropTypes.number.description('Number of files accepted.'),
|
|
14
|
+
minSize: reactDesc.PropTypes.number.description('Minimun file size accepted in bytes.'),
|
|
15
|
+
maxSize: reactDesc.PropTypes.number.description('Maximum file size accepted in bytes.'),
|
|
16
|
+
onDropRejected: reactDesc.PropTypes.func.description('Cb called when files are rejected using maxFiles, minSize or maxSize properties.'),
|
|
17
|
+
disabled: reactDesc.PropTypes.bool.description('Disables the DSUploader.'),
|
|
18
|
+
multiple: reactDesc.PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),
|
|
19
|
+
accept: reactDesc.PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),
|
|
20
|
+
label: reactDesc.PropTypes.string.description('Uploader label.').defaultValue('Browse'),
|
|
21
|
+
icon: reactDesc.PropTypes.element.description('Uploader left icon.').defaultValue(dsIcons.UploadFile),
|
|
22
|
+
actions: reactDesc.PropTypes.shape({
|
|
23
|
+
defaultAction: reactDesc.PropTypes.string,
|
|
24
|
+
altAction: reactDesc.PropTypes.string
|
|
25
|
+
}).description('Uploader actions.').defaultValue({
|
|
26
|
+
defaultAction: 'LOCAL DRIVE'
|
|
27
|
+
}),
|
|
28
|
+
defaultActionLabel: reactDesc.PropTypes.string.description('First action button label.'),
|
|
29
|
+
showAltAction: reactDesc.PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),
|
|
30
|
+
altActionLabel: reactDesc.PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),
|
|
31
|
+
dragActiveInstructionalText: reactDesc.PropTypes.string.description('informative text when user drags a file over the uploader zone.').defaultValue('DROP FILES HERE'),
|
|
32
|
+
dragActiveIcon: reactDesc.PropTypes.string.description('Icon when user drags a file over the uploader zone.'),
|
|
33
|
+
acceptedTypesText: reactDesc.PropTypes.string.description('Information text to show what types are supported.').defaultValue('JPG, JPEG, PNG, PDF'),
|
|
34
|
+
disabledDefault: reactDesc.PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),
|
|
35
|
+
disabledAlt: reactDesc.PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),
|
|
36
|
+
onDefaultHandlerClick: reactDesc.PropTypes.func.description('First action button click handler.'),
|
|
37
|
+
onAltHandlerClick: reactDesc.PropTypes.func.description('Second action button click handler.'),
|
|
38
|
+
defaultActionTooltipText: reactDesc.PropTypes.string.description('shows tooltip in default action button.'),
|
|
39
|
+
altActionTooltipText: reactDesc.PropTypes.string.description('Shows tooltip in alternate action button.')
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.propTypes = propTypes;
|
package/esm/DSUploader.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
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
|
-
import {
|
|
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';
|
|
18
|
+
import { propTypes } from './propTypes.js';
|
|
12
19
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
13
20
|
|
|
14
21
|
var _DividerVertical, _DividerVertical2;
|
|
@@ -21,36 +28,45 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
28
|
|
|
22
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; }
|
|
23
30
|
const blockName = 'uploader';
|
|
24
|
-
const blockNameInfo =
|
|
25
|
-
const blockNameDragActive =
|
|
26
|
-
const blockNameWrapper =
|
|
27
|
-
const UploaderWrapper = aggregatedClasses('div')(blockNameWrapper, null,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
});
|
|
37
50
|
const UploaderDragActive = aggregatedClasses('div')(blockNameDragActive);
|
|
38
|
-
const UploaderIconArea = aggregatedClasses('div')(
|
|
51
|
+
const UploaderIconArea = aggregatedClasses('div')("".concat(blockName, "-icon-wrapper"));
|
|
39
52
|
const UploaderInfo = aggregatedClasses('div')(blockNameInfo);
|
|
40
53
|
const InfoText = aggregatedClasses('span')(blockNameInfo, 'text');
|
|
41
54
|
const UploaderActions = aggregatedClasses('div')(blockNameInfo, 'actions');
|
|
42
55
|
const AcceptedTypes = aggregatedClasses('div')(blockNameWrapper, 'accepted-types');
|
|
43
|
-
const DividerVertical = aggregatedClasses('div')('divider', null,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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) {
|
|
50
66
|
let {
|
|
51
67
|
labelText
|
|
52
|
-
} =
|
|
53
|
-
otherProps = _objectWithoutProperties(
|
|
68
|
+
} = _ref4,
|
|
69
|
+
otherProps = _objectWithoutProperties(_ref4, _excluded);
|
|
54
70
|
|
|
55
71
|
return /*#__PURE__*/jsx(DSButton, _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
56
72
|
buttonType: "text",
|
|
@@ -60,7 +76,7 @@ function ActionButton(_ref) {
|
|
|
60
76
|
|
|
61
77
|
const noop = () => null;
|
|
62
78
|
|
|
63
|
-
const DSUploader =
|
|
79
|
+
const DSUploader = _ref5 => {
|
|
64
80
|
let {
|
|
65
81
|
containerProps = {},
|
|
66
82
|
label = 'Browse',
|
|
@@ -78,13 +94,14 @@ const DSUploader = _ref2 => {
|
|
|
78
94
|
onDefaultHandlerClick = noop,
|
|
79
95
|
onAltHandlerClick = noop,
|
|
80
96
|
actions = {
|
|
81
|
-
defaultAction: 'LOCAL DRIVE'
|
|
97
|
+
defaultAction: 'LOCAL DRIVE',
|
|
98
|
+
altAction: 'DOCUMENTS'
|
|
82
99
|
},
|
|
83
100
|
showAltAction = false,
|
|
84
101
|
defaultActionTooltipText,
|
|
85
102
|
altActionTooltipText
|
|
86
|
-
} =
|
|
87
|
-
dropzoneProps = _objectWithoutProperties(
|
|
103
|
+
} = _ref5,
|
|
104
|
+
dropzoneProps = _objectWithoutProperties(_ref5, _excluded2);
|
|
88
105
|
|
|
89
106
|
const {
|
|
90
107
|
getRootProps,
|
|
@@ -103,16 +120,16 @@ const DSUploader = _ref2 => {
|
|
|
103
120
|
const delfaultActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
104
121
|
variant: disabledDefault && BUTTON_VARIANT.DISABLED,
|
|
105
122
|
labelText: actions.defaultAction ? actions.defaultAction : defaultActionLabel,
|
|
106
|
-
onClick: (
|
|
107
|
-
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...
|
|
123
|
+
onClick: function () {
|
|
124
|
+
if (!disabledDefault) runAll(onDefaultHandlerClick, onOpenFile)(...arguments);
|
|
108
125
|
}
|
|
109
126
|
});
|
|
110
127
|
|
|
111
128
|
const altActionButton = /*#__PURE__*/_jsx2(ActionButton, {
|
|
112
129
|
variant: disabledAlt && BUTTON_VARIANT.DISABLED,
|
|
113
130
|
labelText: actions.altAction ? actions.altAction : altActionLabel,
|
|
114
|
-
onClick: (
|
|
115
|
-
if (!disabledAlt) onAltHandlerClick(...
|
|
131
|
+
onClick: function () {
|
|
132
|
+
if (!disabledAlt) onAltHandlerClick(...arguments);
|
|
116
133
|
}
|
|
117
134
|
});
|
|
118
135
|
|
|
@@ -153,33 +170,7 @@ DSUploader.actions = {
|
|
|
153
170
|
defaultAction: 'LOCAL DRIVE',
|
|
154
171
|
altAction: 'DOCUMENTS'
|
|
155
172
|
};
|
|
156
|
-
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
157
|
-
|
|
158
|
-
const uploaderProps = {
|
|
159
|
-
containerProps: PropTypes.object.description('Set of Properties attached to the main container'),
|
|
160
|
-
dropzoneProps: PropTypes.object.description('props of react-dropzone https://react-dropzone.netlify.com/'),
|
|
161
|
-
label: PropTypes.string.description('Uploader label').defaultValue('Browse'),
|
|
162
|
-
icon: PropTypes.element.description('Uploader left icon').defaultValue(UploadFile),
|
|
163
|
-
actions: PropTypes.shape({
|
|
164
|
-
defaultAction: PropTypes.string,
|
|
165
|
-
altAction: PropTypes.string
|
|
166
|
-
}).description('Uploader actions').defaultValue({
|
|
167
|
-
defaultAction: 'LOCAL DRIVE'
|
|
168
|
-
}),
|
|
169
|
-
defaultActionLabel: PropTypes.string.description('First action button label'),
|
|
170
|
-
showAltAction: PropTypes.bool.description('whether to show alternate action button or not').defaultValue(true),
|
|
171
|
-
altActionLabel: PropTypes.string.description('Second action button label').defaultValue('LOCAL DRIVE'),
|
|
172
|
-
dragActiveInstructionalText: PropTypes.string.description('informative text when user drags a file over the uploader zone').defaultValue('DROP FILES HERE'),
|
|
173
|
-
dragActiveIcon: PropTypes.string.description('Icon when user drags a file over the uploader zone'),
|
|
174
|
-
acceptedTypesText: PropTypes.string.description('Information text to show what types are supported').defaultValue('JPG, JPEG, PNG, PDF'),
|
|
175
|
-
disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not').defaultValue(false),
|
|
176
|
-
disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not').defaultValue(false),
|
|
177
|
-
onDefaultHandlerClick: PropTypes.func.description('First action button click handler'),
|
|
178
|
-
onAltHandlerClick: PropTypes.func.description('Second action button click handler'),
|
|
179
|
-
defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button'),
|
|
180
|
-
altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button')
|
|
181
|
-
};
|
|
182
173
|
const UploaderWithSchema = describe(DSUploader);
|
|
183
|
-
UploaderWithSchema.propTypes =
|
|
174
|
+
UploaderWithSchema.propTypes = propTypes;
|
|
184
175
|
|
|
185
176
|
export { UploaderWithSchema, DSUploader as default };
|
package/esm/index.d.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
package/esm/propTypes.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
import { UploadFile } from '@elliemae/ds-icons';
|
|
3
|
+
|
|
4
|
+
/** Inherits the props of react-dropzone https://react-dropzone.netlify.com/ */
|
|
5
|
+
|
|
6
|
+
const propTypes = {
|
|
7
|
+
containerProps: PropTypes.object.description('Set of Properties attached to the main container.'),
|
|
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
|
+
maxFiles: PropTypes.number.description('Number of files accepted.'),
|
|
10
|
+
minSize: PropTypes.number.description('Minimun file size accepted in bytes.'),
|
|
11
|
+
maxSize: PropTypes.number.description('Maximum file size accepted in bytes.'),
|
|
12
|
+
onDropRejected: PropTypes.func.description('Cb called when files are rejected using maxFiles, minSize or maxSize properties.'),
|
|
13
|
+
disabled: PropTypes.bool.description('Disables the DSUploader.'),
|
|
14
|
+
multiple: PropTypes.bool.description('Set to false to restrict multiple files selection/upload.'),
|
|
15
|
+
accept: PropTypes.string.description('String containing the accepted MIME type for the DSUploader'),
|
|
16
|
+
label: PropTypes.string.description('Uploader label.').defaultValue('Browse'),
|
|
17
|
+
icon: PropTypes.element.description('Uploader left icon.').defaultValue(UploadFile),
|
|
18
|
+
actions: PropTypes.shape({
|
|
19
|
+
defaultAction: PropTypes.string,
|
|
20
|
+
altAction: PropTypes.string
|
|
21
|
+
}).description('Uploader actions.').defaultValue({
|
|
22
|
+
defaultAction: 'LOCAL DRIVE'
|
|
23
|
+
}),
|
|
24
|
+
defaultActionLabel: PropTypes.string.description('First action button label.'),
|
|
25
|
+
showAltAction: PropTypes.bool.description('whether to show alternate action button or not.').defaultValue(true),
|
|
26
|
+
altActionLabel: PropTypes.string.description('Second action button label.').defaultValue('LOCAL DRIVE'),
|
|
27
|
+
dragActiveInstructionalText: PropTypes.string.description('informative text when user drags a file over the uploader zone.').defaultValue('DROP FILES HERE'),
|
|
28
|
+
dragActiveIcon: PropTypes.string.description('Icon when user drags a file over the uploader zone.'),
|
|
29
|
+
acceptedTypesText: PropTypes.string.description('Information text to show what types are supported.').defaultValue('JPG, JPEG, PNG, PDF'),
|
|
30
|
+
disabledDefault: PropTypes.bool.description('Whether the default uploader is disabled or not.').defaultValue(false),
|
|
31
|
+
disabledAlt: PropTypes.bool.description('Whether the alternative uploader is disabled or not.').defaultValue(false),
|
|
32
|
+
onDefaultHandlerClick: PropTypes.func.description('First action button click handler.'),
|
|
33
|
+
onAltHandlerClick: PropTypes.func.description('Second action button click handler.'),
|
|
34
|
+
defaultActionTooltipText: PropTypes.string.description('shows tooltip in default action button.'),
|
|
35
|
+
altActionTooltipText: PropTypes.string.description('Shows tooltip in alternate action button.')
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { propTypes };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-uploader",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Uploader",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"import": "./esm/index.js",
|
|
12
12
|
"require": "./cjs/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./propTypes": {
|
|
15
|
+
"import": "./esm/propTypes.js",
|
|
16
|
+
"require": "./cjs/propTypes.js"
|
|
17
|
+
},
|
|
14
18
|
"./DSUploader": {
|
|
15
19
|
"import": "./esm/DSUploader.js",
|
|
16
20
|
"require": "./cjs/DSUploader.js"
|
|
@@ -36,19 +40,26 @@
|
|
|
36
40
|
"build": "node ../../scripts/build/build.js"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-
|
|
40
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
41
|
-
"@elliemae/ds-
|
|
43
|
+
"@elliemae/ds-button": "2.0.0-alpha.13",
|
|
44
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.13",
|
|
45
|
+
"@elliemae/ds-icons": "2.0.0-alpha.13",
|
|
46
|
+
"@elliemae/ds-tooltip": "2.0.0-alpha.13",
|
|
47
|
+
"@elliemae/ds-utilities": "2.0.0-alpha.13",
|
|
48
|
+
"react-desc": "~4.1.3",
|
|
42
49
|
"react-dropzone": "~10.2.2"
|
|
43
50
|
},
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"generateSubmodules": true
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@testing-library/jest-dom": "~5.15.0",
|
|
53
|
+
"@testing-library/react": "~12.1.2"
|
|
48
54
|
},
|
|
49
55
|
"peerDependencies": {
|
|
50
56
|
"lodash": "^4.17.21",
|
|
51
57
|
"react": "~17.0.2",
|
|
52
58
|
"react-dom": "^17.0.2"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public",
|
|
62
|
+
"directory": "dist",
|
|
63
|
+
"generateSubmodules": true
|
|
53
64
|
}
|
|
54
65
|
}
|
package/types/DSUploader.d.ts
CHANGED
|
@@ -1,50 +1,136 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
3
|
+
import type { DSUploaderPropsT } from './index.d';
|
|
2
4
|
declare const DSUploader: {
|
|
3
|
-
({ containerProps, label, icon: UploadFileIcon, defaultActionLabel, dragActiveInstructionalText, dragActiveIcon: DragActiveIcon, altActionLabel, acceptedTypesText, disabledDefault, disabledAlt, onDefaultHandlerClick, onAltHandlerClick, actions, showAltAction, defaultActionTooltipText, altActionTooltipText, ...dropzoneProps }:
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
containerProps?: {} | undefined;
|
|
6
|
-
label?: string | undefined;
|
|
7
|
-
icon?: any;
|
|
8
|
-
defaultActionLabel?: string | undefined;
|
|
9
|
-
dragActiveInstructionalText?: string | undefined;
|
|
10
|
-
dragActiveIcon?: any;
|
|
11
|
-
altActionLabel?: string | undefined;
|
|
12
|
-
acceptedTypesText?: string | undefined;
|
|
13
|
-
disabledDefault?: boolean | undefined;
|
|
14
|
-
disabledAlt?: boolean | undefined;
|
|
15
|
-
onDefaultHandlerClick?: (() => null) | undefined;
|
|
16
|
-
onAltHandlerClick?: (() => null) | undefined;
|
|
17
|
-
actions?: {
|
|
18
|
-
defaultAction: string;
|
|
19
|
-
} | undefined;
|
|
20
|
-
showAltAction?: boolean | undefined;
|
|
21
|
-
defaultActionTooltipText: any;
|
|
22
|
-
altActionTooltipText: any;
|
|
23
|
-
}): JSX.Element;
|
|
5
|
+
({ containerProps, label, icon: UploadFileIcon, defaultActionLabel, dragActiveInstructionalText, dragActiveIcon: DragActiveIcon, altActionLabel, acceptedTypesText, disabledDefault, disabledAlt, onDefaultHandlerClick, onAltHandlerClick, actions, showAltAction, defaultActionTooltipText, altActionTooltipText, ...dropzoneProps }: DSUploaderPropsT): JSX.Element;
|
|
24
6
|
actions: {
|
|
25
7
|
defaultAction: string;
|
|
26
8
|
altAction: string;
|
|
27
9
|
};
|
|
28
10
|
propTypes: {
|
|
29
|
-
containerProps:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
};
|
|
46
128
|
};
|
|
47
129
|
};
|
|
48
|
-
declare const UploaderWithSchema:
|
|
130
|
+
declare const UploaderWithSchema: {
|
|
131
|
+
(props?: DSUploaderPropsT | undefined): JSX.Element;
|
|
132
|
+
propTypes: unknown;
|
|
133
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
134
|
+
};
|
|
49
135
|
export { UploaderWithSchema };
|
|
50
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
|
+
}
|
|
@@ -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
|
+
};
|
package/cjs/package.json
DELETED