@elliemae/ds-uploader 2.0.0-next.8 → 2.0.0-rc.3

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