@elliemae/ds-imagelibrarymodal 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.
@@ -1,57 +1,45 @@
1
- import _extends from '@babel/runtime/helpers/esm/extends';
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
7
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
3
- import React from 'react';
4
- import PropTypes from 'prop-types';
8
+ import 'react';
5
9
  import { MODAL_TYPE } from '@elliemae/ds-modal';
6
10
  import { sizeOptions } from '@elliemae/ds-shared/constants';
7
11
  import ImageLibraryModalImpl from './components/ImageLibraryModalImpl.js';
8
- import '@babel/runtime/helpers/esm/classCallCheck';
9
- import '@babel/runtime/helpers/esm/createClass';
10
- import '@babel/runtime/helpers/esm/inherits';
11
- import '@babel/runtime/helpers/esm/possibleConstructorReturn';
12
- import '@babel/runtime/helpers/esm/getPrototypeOf';
13
- import '@elliemae/ds-spinner';
14
- import '@elliemae/ds-icon';
15
- import 'lodash';
16
- import 'react-loading-image';
17
- import '@elliemae/ds-icons';
18
-
19
- var _excluded = ["containerProps", "confirmLabel", "disableDoubleClick", "isOpen", "modalTitle", "modalType", "rejectLabel", "shouldCloseOnOverlayClick", "size", "imagesData", "onSelect"];
20
- var modalTypes = Object.values(MODAL_TYPE);
21
-
22
- var DSImageLibraryModal = function DSImageLibraryModal(_ref) {
23
- var _ref$containerProps = _ref.containerProps,
24
- containerProps = _ref$containerProps === void 0 ? {} : _ref$containerProps,
25
- _ref$confirmLabel = _ref.confirmLabel,
26
- confirmLabel = _ref$confirmLabel === void 0 ? 'Add' : _ref$confirmLabel,
27
- _ref$disableDoubleCli = _ref.disableDoubleClick,
28
- disableDoubleClick = _ref$disableDoubleCli === void 0 ? false : _ref$disableDoubleCli,
29
- _ref$isOpen = _ref.isOpen,
30
- isOpen = _ref$isOpen === void 0 ? true : _ref$isOpen,
31
- _ref$modalTitle = _ref.modalTitle,
32
- modalTitle = _ref$modalTitle === void 0 ? 'Add Image' : _ref$modalTitle,
33
- _ref$modalType = _ref.modalType,
34
- modalType = _ref$modalType === void 0 ? modalTypes[2] : _ref$modalType,
35
- _ref$rejectLabel = _ref.rejectLabel,
36
- rejectLabel = _ref$rejectLabel === void 0 ? 'Cancel' : _ref$rejectLabel,
37
- _ref$shouldCloseOnOve = _ref.shouldCloseOnOverlayClick,
38
- shouldCloseOnOverlayClick = _ref$shouldCloseOnOve === void 0 ? true : _ref$shouldCloseOnOve,
39
- _ref$size = _ref.size,
40
- size = _ref$size === void 0 ? sizeOptions[3] : _ref$size,
41
- _ref$imagesData = _ref.imagesData,
42
- imagesData = _ref$imagesData === void 0 ? [{
43
- url: 'https://www.freeiconspng.com/minicovers/no-image-icon-6.png',
44
- name: 'no image',
45
- createdBy: 'user:John Doe',
46
- createdDate: '0000-01-01 00:00 AM UTC'
47
- }] : _ref$imagesData,
48
- _ref$onSelect = _ref.onSelect,
49
- onSelect = _ref$onSelect === void 0 ? function () {
50
- return null;
51
- } : _ref$onSelect,
12
+ import { jsx } from 'react/jsx-runtime';
13
+
14
+ const _excluded = ["containerProps", "confirmLabel", "disableDoubleClick", "isOpen", "modalTitle", "modalType", "rejectLabel", "shouldCloseOnOverlayClick", "size", "imagesData", "onSelect"];
15
+
16
+ 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; }
17
+
18
+ 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; }
19
+ const modalTypes = Object.values(MODAL_TYPE);
20
+
21
+ const DSImageLibraryModal = _ref => {
22
+ let {
23
+ containerProps = {},
24
+ confirmLabel = 'Add',
25
+ disableDoubleClick = false,
26
+ isOpen = true,
27
+ modalTitle = 'Add Image',
28
+ modalType = modalTypes[2],
29
+ rejectLabel = 'Cancel',
30
+ shouldCloseOnOverlayClick = true,
31
+ size = sizeOptions[3],
32
+ imagesData = [{
33
+ url: 'https://www.freeiconspng.com/minicovers/no-image-icon-6.png',
34
+ name: 'no image',
35
+ createdBy: 'user:John Doe',
36
+ createdDate: '0000-01-01 00:00 AM UTC'
37
+ }],
38
+ onSelect = () => null
39
+ } = _ref,
52
40
  rest = _objectWithoutProperties(_ref, _excluded);
53
41
 
54
- return /*#__PURE__*/React.createElement(ImageLibraryModalImpl, _extends({
42
+ return /*#__PURE__*/jsx(ImageLibraryModalImpl, _objectSpread({
55
43
  confirmLabel: confirmLabel,
56
44
  containerProps: containerProps,
57
45
  disableDoubleClick: disableDoubleClick,
@@ -65,21 +53,5 @@ var DSImageLibraryModal = function DSImageLibraryModal(_ref) {
65
53
  size: size
66
54
  }, rest));
67
55
  };
68
- /** Inherits DSModal props */
69
-
70
-
71
- DSImageLibraryModal.propTypes = {
72
- containerProps: PropTypes.shape({}),
73
-
74
- /** List of images src */
75
- imagesData: PropTypes.arrayOf(PropTypes.shape({
76
- url: PropTypes.string,
77
- name: PropTypes.string
78
- })),
79
-
80
- /** Handler when user selects an image */
81
- onSelect: PropTypes.func
82
- };
83
56
 
84
57
  export { DSImageLibraryModal as default };
85
- //# sourceMappingURL=DSImageLibraryModal.js.map
@@ -1,10 +1,13 @@
1
1
  import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
2
- import _extends from '@babel/runtime/helpers/esm/extends';
3
- import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';
4
- import _createClass from '@babel/runtime/helpers/esm/createClass';
5
- import _inherits from '@babel/runtime/helpers/esm/inherits';
6
- import _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';
7
- import _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';
2
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
3
+ import _jsx from '@babel/runtime/helpers/esm/jsx';
4
+ import 'core-js/modules/esnext.async-iterator.map.js';
5
+ import 'core-js/modules/esnext.iterator.map.js';
6
+ import 'core-js/modules/esnext.async-iterator.filter.js';
7
+ import 'core-js/modules/esnext.iterator.constructor.js';
8
+ import 'core-js/modules/esnext.iterator.filter.js';
9
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
10
+ import 'core-js/modules/esnext.iterator.for-each.js';
8
11
  import React from 'react';
9
12
  import DSModal from '@elliemae/ds-modal';
10
13
  import DSSpinner from '@elliemae/ds-spinner';
@@ -12,30 +15,25 @@ import { DSIconColors, DSIconSizes } from '@elliemae/ds-icon';
12
15
  import { includes } from 'lodash';
13
16
  import ImageLoader from 'react-loading-image';
14
17
  import { ImageMissing } from '@elliemae/ds-icons';
18
+ import { jsx } from 'react/jsx-runtime';
15
19
 
16
- var _excluded = ["containerProps", "imagesData", "onSelect", "disableDoubleClick"];
20
+ const _excluded = ["containerProps", "imagesData", "onSelect", "disableDoubleClick"];
17
21
 
18
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
+ var _DSSpinner;
19
23
 
20
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
21
- var elementClassName = 'imglibmodal-element';
24
+ 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; }
22
25
 
23
- var ImageLibraryModalImpl = /*#__PURE__*/function (_React$PureComponent) {
24
- _inherits(ImageLibraryModalImpl, _React$PureComponent);
26
+ 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; }
27
+ const elementClassName = 'imglibmodal-element';
28
+ class ImageLibraryModalImpl extends React.PureComponent {
29
+ constructor(props) {
30
+ super(props);
25
31
 
26
- var _super = _createSuper(ImageLibraryModalImpl);
27
-
28
- function ImageLibraryModalImpl(props) {
29
- var _this;
30
-
31
- _classCallCheck(this, ImageLibraryModalImpl);
32
-
33
- _this = _super.call(this, props);
34
-
35
- _this.onReject = function () {
36
- var _this$props = _this.props,
37
- onReject = _this$props.onReject,
38
- onClose = _this$props.onClose;
32
+ this.onReject = () => {
33
+ const {
34
+ onReject,
35
+ onClose
36
+ } = this.props;
39
37
 
40
38
  if (onReject) {
41
39
  onReject();
@@ -44,25 +42,28 @@ var ImageLibraryModalImpl = /*#__PURE__*/function (_React$PureComponent) {
44
42
  }
45
43
  };
46
44
 
47
- _this.handleElementClick = function (e, image) {
45
+ this.handleElementClick = (e, image) => {
48
46
  if (e.key && e.key !== ' ') {
49
47
  return;
50
48
  }
51
49
 
52
- var selected = _this.state.selected;
53
- var _this$props2 = _this.props,
54
- disableDoubleClick = _this$props2.disableDoubleClick,
55
- onConfirm = _this$props2.onConfirm,
56
- onSelect = _this$props2.onSelect;
50
+ const {
51
+ selected
52
+ } = this.state;
53
+ const {
54
+ disableDoubleClick,
55
+ onConfirm,
56
+ onSelect
57
+ } = this.props;
57
58
 
58
59
  if (image === selected && onConfirm && !disableDoubleClick) {
59
60
  onConfirm();
60
61
  return;
61
62
  }
62
63
 
63
- _this.setState({
64
+ this.setState({
64
65
  selected: image,
65
- user: _this.getUser(image)
66
+ user: this.getUser(image)
66
67
  });
67
68
 
68
69
  if (onSelect) {
@@ -70,183 +71,172 @@ var ImageLibraryModalImpl = /*#__PURE__*/function (_React$PureComponent) {
70
71
  }
71
72
  };
72
73
 
73
- _this.renderElements = function () {
74
- var imagesData = _this.props.imagesData;
74
+ this.renderElements = () => {
75
+ const {
76
+ imagesData
77
+ } = this.props;
75
78
 
76
79
  if (!imagesData) {
77
80
  return 'Empty';
78
81
  }
79
82
 
80
- var selected = _this.state.selected;
81
- return imagesData.map(function (image, idx) {
82
- var extras = {};
83
- var name = image.name,
84
- id = image.id;
83
+ const {
84
+ selected
85
+ } = this.state;
86
+ return imagesData.map((image, idx) => {
87
+ const extras = {};
88
+ const {
89
+ name,
90
+ id
91
+ } = image;
85
92
 
86
- if (_this.focusFirst && idx === 0) {
87
- extras.ref = function (element) {
88
- return element && element.focus();
89
- };
93
+ if (this.focusFirst && idx === 0) {
94
+ extras.ref = element => element && element.focus();
90
95
 
91
- _this.focusFirst = undefined;
96
+ this.focusFirst = undefined;
92
97
  } else if (selected && name === selected.name) {
93
- extras.ref = function (element) {
94
- return element && element.focus();
95
- };
98
+ extras.ref = element => element && element.focus();
96
99
  }
97
100
 
98
- return /*#__PURE__*/React.createElement("div", _extends({
99
- key: id || "".concat(name, "_").concat(idx),
101
+ return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
100
102
  className: elementClassName,
101
- onClick: function onClick(e) {
102
- return _this.handleElementClick(e, image);
103
- },
104
- onKeyUp: function onKeyUp(e) {
105
- return _this.handleElementClick(e, image);
106
- },
103
+ onClick: e => this.handleElementClick(e, image),
104
+ onKeyUp: e => this.handleElementClick(e, image),
107
105
  role: "button",
108
106
  tabIndex: 0
109
- }, extras), /*#__PURE__*/React.createElement("div", {
110
- className: "content"
111
- }, name));
107
+ }, extras), {}, {
108
+ children: /*#__PURE__*/_jsx("div", {
109
+ className: "content"
110
+ }, void 0, name)
111
+ }), id || "".concat(name, "_").concat(idx));
112
112
  });
113
113
  };
114
114
 
115
- _this.renderSpinner = function () {
116
- return /*#__PURE__*/React.createElement(DSSpinner, {
117
- message: "Loading...",
118
- size: "m"
119
- });
120
- };
115
+ this.renderSpinner = () => _DSSpinner || (_DSSpinner = /*#__PURE__*/_jsx(DSSpinner, {
116
+ message: "Loading...",
117
+ size: "m"
118
+ }));
121
119
 
122
- _this.renderError = function () {
123
- return /*#__PURE__*/React.createElement(ImageMissing, {
124
- color: DSIconColors.NEUTRAL,
125
- size: DSIconSizes.M
126
- });
127
- };
120
+ this.renderError = () => /*#__PURE__*/_jsx(ImageMissing, {
121
+ color: DSIconColors.NEUTRAL,
122
+ size: DSIconSizes.M
123
+ });
128
124
 
129
- _this.state = {
125
+ this.state = {
130
126
  selected: undefined,
131
127
  user: undefined
132
128
  };
129
+ this.preventSpacebarScroll();
130
+ }
133
131
 
134
- _this.preventSpacebarScroll();
132
+ componentDidMount() {
133
+ const {
134
+ imagesData
135
+ } = this.props;
135
136
 
136
- return _this;
137
+ if (imagesData) {
138
+ this.handleElementClick({}, imagesData[0]);
139
+ this.focusFirst = true;
140
+ }
137
141
  }
138
142
 
139
- _createClass(ImageLibraryModalImpl, [{
140
- key: "componentDidMount",
141
- value: function componentDidMount() {
142
- var imagesData = this.props.imagesData;
143
+ getDerivedStateFromProps(nextProps) {
144
+ const {
145
+ imagesData
146
+ } = this.props;
143
147
 
144
- if (imagesData) {
145
- this.handleElementClick({}, imagesData[0]);
146
- this.focusFirst = true;
147
- }
148
+ if (!imagesData && nextProps.imagesData) {
149
+ this.setState({
150
+ selected: imagesData[0]
151
+ });
148
152
  }
149
- }, {
150
- key: "getDerivedStateFromProps",
151
- value: function getDerivedStateFromProps(nextProps) {
152
- var imagesData = this.props.imagesData;
153
-
154
- if (!imagesData && nextProps.imagesData) {
155
- this.setState({
156
- selected: imagesData[0]
157
- });
158
- }
153
+ }
154
+
155
+ getUser(selected) {
156
+ if (!selected) {
157
+ return '';
158
+ }
159
+
160
+ const index = selected.createdBy.lastIndexOf('user:');
161
+
162
+ if (index === -1) {
163
+ return selected.createdBy;
159
164
  }
160
- }, {
161
- key: "getUser",
162
- value: function getUser(selected) {
163
- if (!selected) {
164
- return '';
165
+
166
+ return selected.createdBy.substring(index + 5);
167
+ }
168
+
169
+ preventSpacebarScroll() {
170
+ document.onkeypress = function (e) {
171
+ if (!includes(e.target.className, elementClassName)) {
172
+ return true;
165
173
  }
166
174
 
167
- var index = selected.createdBy.lastIndexOf('user:');
175
+ e = e || window.event;
176
+ const charCode = e.keyCode || e.which;
168
177
 
169
- if (index === -1) {
170
- return selected.createdBy;
178
+ if (charCode === 32) {
179
+ e.preventDefault();
180
+ return false;
171
181
  }
172
182
 
173
- return selected.createdBy.substring(index + 5);
174
- }
175
- }, {
176
- key: "preventSpacebarScroll",
177
- value: function preventSpacebarScroll() {
178
- document.onkeypress = function (e) {
179
- if (!includes(e.target.className, elementClassName)) {
180
- return true;
181
- }
183
+ return true;
184
+ };
185
+ }
182
186
 
183
- e = e || window.event;
184
- var charCode = e.keyCode || e.which;
187
+ drawDiv(className, content) {
188
+ return /*#__PURE__*/_jsx("div", {
189
+ className: className
190
+ }, void 0, content);
191
+ }
185
192
 
186
- if (charCode === 32) {
187
- e.preventDefault();
188
- return false;
189
- }
193
+ drawLabel(className, label, value) {
194
+ return /*#__PURE__*/_jsx("div", {
195
+ className: className
196
+ }, void 0, /*#__PURE__*/_jsx("span", {
197
+ className: "label"
198
+ }, void 0, label), /*#__PURE__*/_jsx("span", {
199
+ className: "value"
200
+ }, void 0, value));
201
+ }
190
202
 
191
- return true;
192
- };
193
- }
194
- }, {
195
- key: "drawDiv",
196
- value: function drawDiv(className, content) {
197
- return /*#__PURE__*/React.createElement("div", {
198
- className: className
199
- }, content);
200
- }
201
- }, {
202
- key: "drawLabel",
203
- value: function drawLabel(className, label, value) {
204
- return /*#__PURE__*/React.createElement("div", {
205
- className: className
206
- }, /*#__PURE__*/React.createElement("span", {
207
- className: "label"
208
- }, label), /*#__PURE__*/React.createElement("span", {
209
- className: "value"
210
- }, value));
211
- }
212
- }, {
213
- key: "render",
214
- value: function render() {
215
- var _this$state = this.state,
216
- selected = _this$state.selected,
217
- user = _this$state.user;
218
-
219
- var _this$props3 = this.props,
220
- containerProps = _this$props3.containerProps;
221
- _this$props3.imagesData;
222
- _this$props3.onSelect;
223
- _this$props3.disableDoubleClick;
224
- var modalProps = _objectWithoutProperties(_this$props3, _excluded);
225
-
226
- return /*#__PURE__*/React.createElement(DSModal, _extends({
227
- containerProps: containerProps
228
- }, modalProps, {
229
- className: "em-ds-modal-image-library",
230
- onReject: this.onReject
231
- }), /*#__PURE__*/React.createElement("div", {
203
+ render() {
204
+ const {
205
+ selected,
206
+ user
207
+ } = this.state;
208
+
209
+ const _this$props = this.props,
210
+ {
211
+ containerProps,
212
+ imagesData,
213
+ onSelect,
214
+ disableDoubleClick
215
+ } = _this$props,
216
+ modalProps = _objectWithoutProperties(_this$props, _excluded);
217
+
218
+ return /*#__PURE__*/jsx(DSModal, _objectSpread(_objectSpread({
219
+ containerProps: containerProps
220
+ }, modalProps), {}, {
221
+ className: "em-ds-modal-image-library",
222
+ onReject: this.onReject,
223
+ children: /*#__PURE__*/_jsx("div", {
232
224
  className: "wrapper"
233
- }, /*#__PURE__*/React.createElement("div", {
225
+ }, void 0, /*#__PURE__*/_jsx("div", {
234
226
  className: "col-1"
235
- }, this.drawDiv('title', 'Company Images'), this.renderElements()), /*#__PURE__*/React.createElement("div", {
227
+ }, void 0, this.drawDiv('title', 'Company Images'), this.renderElements()), /*#__PURE__*/_jsx("div", {
236
228
  className: "col-2"
237
- }, this.drawDiv('title', selected ? selected.name : ''), /*#__PURE__*/React.createElement(ImageLoader, {
229
+ }, void 0, this.drawDiv('title', selected ? selected.name : ''), /*#__PURE__*/_jsx(ImageLoader, {
238
230
  className: "image-loader",
239
231
  error: this.renderError,
240
232
  loading: this.renderSpinner,
241
233
  src: selected ? selected.url : ''
242
- }), selected && /*#__PURE__*/React.createElement("div", {
234
+ }), selected && /*#__PURE__*/_jsx("div", {
243
235
  className: "info"
244
- }, this.drawLabel('info-element', 'Created Date:', selected.createdDate), this.drawLabel('info-element', 'Created By:', user)))));
245
- }
246
- }]);
236
+ }, void 0, this.drawLabel('info-element', 'Created Date:', selected.createdDate), this.drawLabel('info-element', 'Created By:', user))))
237
+ }));
238
+ }
247
239
 
248
- return ImageLibraryModalImpl;
249
- }(React.PureComponent);
240
+ }
250
241
 
251
242
  export { ImageLibraryModalImpl as default };
252
- //# sourceMappingURL=ImageLibraryModalImpl.js.map
package/esm/index.js CHANGED
@@ -1,19 +1 @@
1
1
  export { default } from './DSImageLibraryModal.js';
2
- import '@babel/runtime/helpers/esm/extends';
3
- import '@babel/runtime/helpers/esm/objectWithoutProperties';
4
- import 'react';
5
- import 'prop-types';
6
- import '@elliemae/ds-modal';
7
- import '@elliemae/ds-shared/constants';
8
- import './components/ImageLibraryModalImpl.js';
9
- import '@babel/runtime/helpers/esm/classCallCheck';
10
- import '@babel/runtime/helpers/esm/createClass';
11
- import '@babel/runtime/helpers/esm/inherits';
12
- import '@babel/runtime/helpers/esm/possibleConstructorReturn';
13
- import '@babel/runtime/helpers/esm/getPrototypeOf';
14
- import '@elliemae/ds-spinner';
15
- import '@elliemae/ds-icon';
16
- import 'lodash';
17
- import 'react-loading-image';
18
- import '@elliemae/ds-icons';
19
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,14 +1,38 @@
1
1
  {
2
2
  "name": "@elliemae/ds-imagelibrarymodal",
3
- "version": "1.60.0",
3
+ "version": "2.0.0-alpha.12",
4
4
  "license": "MIT",
5
- "description": "Ellie Mae - Dim Sum - Image Library Modal",
6
- "main": "cjs/index.js",
7
- "module": "esm/index.js",
5
+ "description": "ICE MT - Dimsum - Image Library Modal",
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
+ "./DSImageLibraryModal": {
15
+ "import": "./esm/DSImageLibraryModal.js",
16
+ "require": "./cjs/DSImageLibraryModal.js"
17
+ },
18
+ "./components/ImageLibraryModalImpl": {
19
+ "import": "./esm/components/ImageLibraryModalImpl.js",
20
+ "require": "./cjs/components/ImageLibraryModalImpl.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,22 @@
16
40
  "build": "node ../../scripts/build/build.js"
17
41
  },
18
42
  "dependencies": {
19
- "@elliemae/ds-basic": "1.60.0",
20
- "@elliemae/ds-icons": "1.60.0",
21
- "@elliemae/ds-modal": "1.60.0",
22
- "@elliemae/ds-shared": "1.60.0",
43
+ "@elliemae/ds-icon": "2.0.0-alpha.12",
44
+ "@elliemae/ds-icons": "2.0.0-alpha.12",
45
+ "@elliemae/ds-modal": "2.0.0-alpha.12",
46
+ "@elliemae/ds-shared": "2.0.0-alpha.12",
47
+ "@elliemae/ds-spinner": "2.0.0-alpha.12",
23
48
  "prop-types": "~15.7.2",
24
- "react-loading-image": "0.5.0"
49
+ "react-loading-image": "~0.5.0"
25
50
  },
26
51
  "peerDependencies": {
27
- "lodash": "^4.17.20",
28
- "react": "~17.0.1",
29
- "react-dom": "^17.0.1"
52
+ "lodash": "^4.17.21",
53
+ "react": "~17.0.2",
54
+ "react-dom": "^17.0.2"
30
55
  },
31
56
  "publishConfig": {
32
57
  "access": "public",
33
- "directory": "dist"
58
+ "directory": "dist",
59
+ "generateSubmodules": true
34
60
  }
35
61
  }
@@ -0,0 +1,35 @@
1
+ /// <reference types="react" />
2
+ import PropTypes from 'prop-types';
3
+ declare const DSImageLibraryModal: {
4
+ ({ containerProps, confirmLabel, disableDoubleClick, isOpen, modalTitle, modalType, rejectLabel, shouldCloseOnOverlayClick, size, imagesData, onSelect, ...rest }: {
5
+ [x: string]: any;
6
+ containerProps?: {} | undefined;
7
+ confirmLabel?: string | undefined;
8
+ disableDoubleClick?: boolean | undefined;
9
+ isOpen?: boolean | undefined;
10
+ modalTitle?: string | undefined;
11
+ modalType?: string | undefined;
12
+ rejectLabel?: string | undefined;
13
+ shouldCloseOnOverlayClick?: boolean | undefined;
14
+ size?: any;
15
+ imagesData?: {
16
+ url: string;
17
+ name: string;
18
+ createdBy: string;
19
+ createdDate: string;
20
+ }[] | undefined;
21
+ onSelect?: (() => null) | undefined;
22
+ }): JSX.Element;
23
+ /** Inherits DSModal props */
24
+ propTypes: {
25
+ containerProps: PropTypes.Requireable<PropTypes.InferProps<{}>>;
26
+ /** List of images src */
27
+ imagesData: PropTypes.Requireable<(PropTypes.InferProps<{
28
+ url: PropTypes.Requireable<string>;
29
+ name: PropTypes.Requireable<string>;
30
+ }> | null | undefined)[]>;
31
+ /** Handler when user selects an image */
32
+ onSelect: PropTypes.Requireable<(...args: any[]) => any>;
33
+ };
34
+ };
35
+ export default DSImageLibraryModal;