@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.
- package/cjs/DSImageLibraryModal.js +37 -67
- package/cjs/components/ImageLibraryModalImpl.js +158 -172
- package/cjs/index.js +0 -18
- package/esm/DSImageLibraryModal.js +36 -64
- package/esm/components/ImageLibraryModalImpl.js +156 -166
- package/esm/index.js +0 -18
- package/package.json +39 -13
- package/types/DSImageLibraryModal.d.ts +35 -0
- package/types/components/ImageLibraryModalImpl.d.ts +16 -0
- package/types/index.d.ts +1 -0
- package/DSImageLibraryModal/package.json +0 -10
- package/cjs/DSImageLibraryModal.js.map +0 -1
- package/cjs/components/ImageLibraryModalImpl.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/components/ImageLibraryModalImpl/package.json +0 -10
- package/esm/DSImageLibraryModal.js.map +0 -1
- package/esm/components/ImageLibraryModalImpl.js.map +0 -1
- package/esm/index.js.map +0 -1
|
@@ -1,57 +1,45 @@
|
|
|
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 _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
-
import
|
|
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 '
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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__*/
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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
|
-
|
|
20
|
+
const _excluded = ["containerProps", "imagesData", "onSelect", "disableDoubleClick"];
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
var _DSSpinner;
|
|
19
23
|
|
|
20
|
-
function
|
|
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
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
45
|
+
this.handleElementClick = (e, image) => {
|
|
48
46
|
if (e.key && e.key !== ' ') {
|
|
49
47
|
return;
|
|
50
48
|
}
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
64
|
+
this.setState({
|
|
64
65
|
selected: image,
|
|
65
|
-
user:
|
|
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
|
-
|
|
74
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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 (
|
|
87
|
-
extras.ref =
|
|
88
|
-
return element && element.focus();
|
|
89
|
-
};
|
|
93
|
+
if (this.focusFirst && idx === 0) {
|
|
94
|
+
extras.ref = element => element && element.focus();
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
this.focusFirst = undefined;
|
|
92
97
|
} else if (selected && name === selected.name) {
|
|
93
|
-
extras.ref =
|
|
94
|
-
return element && element.focus();
|
|
95
|
-
};
|
|
98
|
+
extras.ref = element => element && element.focus();
|
|
96
99
|
}
|
|
97
100
|
|
|
98
|
-
return /*#__PURE__*/
|
|
99
|
-
key: id || "".concat(name, "_").concat(idx),
|
|
101
|
+
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({
|
|
100
102
|
className: elementClassName,
|
|
101
|
-
onClick:
|
|
102
|
-
|
|
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),
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
});
|
|
120
|
-
};
|
|
115
|
+
this.renderSpinner = () => _DSSpinner || (_DSSpinner = /*#__PURE__*/_jsx(DSSpinner, {
|
|
116
|
+
message: "Loading...",
|
|
117
|
+
size: "m"
|
|
118
|
+
}));
|
|
121
119
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
});
|
|
127
|
-
};
|
|
120
|
+
this.renderError = () => /*#__PURE__*/_jsx(ImageMissing, {
|
|
121
|
+
color: DSIconColors.NEUTRAL,
|
|
122
|
+
size: DSIconSizes.M
|
|
123
|
+
});
|
|
128
124
|
|
|
129
|
-
|
|
125
|
+
this.state = {
|
|
130
126
|
selected: undefined,
|
|
131
127
|
user: undefined
|
|
132
128
|
};
|
|
129
|
+
this.preventSpacebarScroll();
|
|
130
|
+
}
|
|
133
131
|
|
|
134
|
-
|
|
132
|
+
componentDidMount() {
|
|
133
|
+
const {
|
|
134
|
+
imagesData
|
|
135
|
+
} = this.props;
|
|
135
136
|
|
|
136
|
-
|
|
137
|
+
if (imagesData) {
|
|
138
|
+
this.handleElementClick({}, imagesData[0]);
|
|
139
|
+
this.focusFirst = true;
|
|
140
|
+
}
|
|
137
141
|
}
|
|
138
142
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
getDerivedStateFromProps(nextProps) {
|
|
144
|
+
const {
|
|
145
|
+
imagesData
|
|
146
|
+
} = this.props;
|
|
143
147
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
+
if (!imagesData && nextProps.imagesData) {
|
|
149
|
+
this.setState({
|
|
150
|
+
selected: imagesData[0]
|
|
151
|
+
});
|
|
148
152
|
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
175
|
+
e = e || window.event;
|
|
176
|
+
const charCode = e.keyCode || e.which;
|
|
168
177
|
|
|
169
|
-
if (
|
|
170
|
-
|
|
178
|
+
if (charCode === 32) {
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
return false;
|
|
171
181
|
}
|
|
172
182
|
|
|
173
|
-
return
|
|
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
|
-
|
|
184
|
-
|
|
187
|
+
drawDiv(className, content) {
|
|
188
|
+
return /*#__PURE__*/_jsx("div", {
|
|
189
|
+
className: className
|
|
190
|
+
}, void 0, content);
|
|
191
|
+
}
|
|
185
192
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
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__*/
|
|
225
|
+
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
234
226
|
className: "col-1"
|
|
235
|
-
}, this.drawDiv('title', 'Company Images'), this.renderElements()), /*#__PURE__*/
|
|
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__*/
|
|
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__*/
|
|
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
|
-
|
|
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": "
|
|
3
|
+
"version": "2.0.0-alpha.12",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "
|
|
6
|
-
"
|
|
7
|
-
"
|
|
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-
|
|
20
|
-
"@elliemae/ds-icons": "
|
|
21
|
-
"@elliemae/ds-modal": "
|
|
22
|
-
"@elliemae/ds-shared": "
|
|
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.
|
|
28
|
-
"react": "~17.0.
|
|
29
|
-
"react-dom": "^17.0.
|
|
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;
|