@elliemae/ds-imagelibrarymodal 2.3.0-next.0 → 3.0.0-alpha.0
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/dist/cjs/DSImageLibraryModal.js +83 -0
- package/dist/cjs/DSImageLibraryModal.js.map +7 -0
- package/dist/cjs/components/ImageLibraryModalImpl.js +188 -0
- package/dist/cjs/components/ImageLibraryModalImpl.js.map +7 -0
- package/dist/cjs/index.js +35 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/esm/DSImageLibraryModal.js +54 -0
- package/dist/esm/DSImageLibraryModal.js.map +7 -0
- package/dist/esm/components/ImageLibraryModalImpl.js +159 -0
- package/dist/esm/components/ImageLibraryModalImpl.js.map +7 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +7 -0
- package/{types → dist/types}/DSImageLibraryModal.d.ts +0 -0
- package/{types → dist/types}/components/ImageLibraryModalImpl.d.ts +0 -0
- package/{types → dist/types}/index.d.ts +0 -0
- package/package.json +32 -24
- package/cjs/DSImageLibraryModal.js +0 -64
- package/cjs/components/ImageLibraryModalImpl.js +0 -254
- package/cjs/index.js +0 -7
- package/esm/DSImageLibraryModal.js +0 -57
- package/esm/components/ImageLibraryModalImpl.js +0 -242
- package/esm/index.js +0 -1
package/package.json
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-imagelibrarymodal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Image Library Modal",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"import": "./esm/index.js",
|
|
12
|
-
"require": "./cjs/index.js"
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
13
16
|
},
|
|
14
17
|
"./DSImageLibraryModal": {
|
|
15
|
-
"import": "./esm/DSImageLibraryModal.js",
|
|
16
|
-
"require": "./cjs/DSImageLibraryModal.js"
|
|
18
|
+
"import": "./dist/esm/DSImageLibraryModal.js",
|
|
19
|
+
"require": "./dist/cjs/DSImageLibraryModal.js"
|
|
17
20
|
},
|
|
18
21
|
"./components/ImageLibraryModalImpl": {
|
|
19
|
-
"import": "./esm/components/ImageLibraryModalImpl.js",
|
|
20
|
-
"require": "./cjs/components/ImageLibraryModalImpl.js"
|
|
22
|
+
"import": "./dist/esm/components/ImageLibraryModalImpl.js",
|
|
23
|
+
"require": "./dist/cjs/components/ImageLibraryModalImpl.js"
|
|
21
24
|
}
|
|
22
25
|
},
|
|
23
26
|
"sideEffects": [
|
|
@@ -29,22 +32,22 @@
|
|
|
29
32
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
30
33
|
},
|
|
31
34
|
"engines": {
|
|
32
|
-
"
|
|
33
|
-
"node": ">=
|
|
35
|
+
"pnpm": ">=6",
|
|
36
|
+
"node": ">=16"
|
|
34
37
|
},
|
|
35
38
|
"author": "ICE MT",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
39
|
+
"jestSonar": {
|
|
40
|
+
"sonar56x": true,
|
|
41
|
+
"reportPath": "reports",
|
|
42
|
+
"reportFile": "tests.xml",
|
|
43
|
+
"indent": 4
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
|
-
"@elliemae/ds-icon": "
|
|
44
|
-
"@elliemae/ds-icons": "
|
|
45
|
-
"@elliemae/ds-modal": "
|
|
46
|
-
"@elliemae/ds-shared": "
|
|
47
|
-
"@elliemae/ds-spinner": "
|
|
46
|
+
"@elliemae/ds-icon": "3.0.0-alpha.0",
|
|
47
|
+
"@elliemae/ds-icons": "3.0.0-alpha.0",
|
|
48
|
+
"@elliemae/ds-modal": "3.0.0-alpha.0",
|
|
49
|
+
"@elliemae/ds-shared": "3.0.0-alpha.0",
|
|
50
|
+
"@elliemae/ds-spinner": "3.0.0-alpha.0",
|
|
48
51
|
"prop-types": "~15.7.2",
|
|
49
52
|
"react-loading-image": "~0.5.0"
|
|
50
53
|
},
|
|
@@ -55,7 +58,12 @@
|
|
|
55
58
|
},
|
|
56
59
|
"publishConfig": {
|
|
57
60
|
"access": "public",
|
|
58
|
-
"
|
|
59
|
-
|
|
61
|
+
"typeSafety": false
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
|
|
65
|
+
"test": "node ../../scripts/testing/test.mjs",
|
|
66
|
+
"lint": "node ../../scripts/lint.mjs",
|
|
67
|
+
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
|
|
60
68
|
}
|
|
61
69
|
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
|
-
require('react');
|
|
11
|
-
var DSModal = require('@elliemae/ds-modal');
|
|
12
|
-
var constants = require('@elliemae/ds-shared/constants');
|
|
13
|
-
var ImageLibraryModalImpl = require('./components/ImageLibraryModalImpl.js');
|
|
14
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
15
|
-
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
19
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
20
|
-
|
|
21
|
-
const _excluded = ["containerProps", "confirmLabel", "disableDoubleClick", "isOpen", "modalTitle", "modalType", "rejectLabel", "shouldCloseOnOverlayClick", "size", "imagesData", "onSelect"];
|
|
22
|
-
|
|
23
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
|
-
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
-
const modalTypes = Object.values(DSModal.MODAL_TYPE);
|
|
27
|
-
|
|
28
|
-
const DSImageLibraryModal = _ref => {
|
|
29
|
-
let {
|
|
30
|
-
containerProps = {},
|
|
31
|
-
confirmLabel = 'Add',
|
|
32
|
-
disableDoubleClick = false,
|
|
33
|
-
isOpen = true,
|
|
34
|
-
modalTitle = 'Add Image',
|
|
35
|
-
modalType = modalTypes[2],
|
|
36
|
-
rejectLabel = 'Cancel',
|
|
37
|
-
shouldCloseOnOverlayClick = true,
|
|
38
|
-
size = constants.sizeOptions[3],
|
|
39
|
-
imagesData = [{
|
|
40
|
-
url: 'https://www.freeiconspng.com/minicovers/no-image-icon-6.png',
|
|
41
|
-
name: 'no image',
|
|
42
|
-
createdBy: 'user:John Doe',
|
|
43
|
-
createdDate: '0000-01-01 00:00 AM UTC'
|
|
44
|
-
}],
|
|
45
|
-
onSelect = () => null
|
|
46
|
-
} = _ref,
|
|
47
|
-
rest = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
48
|
-
|
|
49
|
-
return /*#__PURE__*/jsxRuntime.jsx(ImageLibraryModalImpl, _objectSpread({
|
|
50
|
-
confirmLabel: confirmLabel,
|
|
51
|
-
containerProps: containerProps,
|
|
52
|
-
disableDoubleClick: disableDoubleClick,
|
|
53
|
-
imagesData: imagesData,
|
|
54
|
-
isOpen: isOpen,
|
|
55
|
-
modalTitle: modalTitle,
|
|
56
|
-
modalType: modalType,
|
|
57
|
-
onSelect: onSelect,
|
|
58
|
-
rejectLabel: rejectLabel,
|
|
59
|
-
shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
|
|
60
|
-
size: size
|
|
61
|
-
}, rest));
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
module.exports = DSImageLibraryModal;
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
4
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
-
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
|
-
require('core-js/modules/esnext.iterator.map.js');
|
|
8
|
-
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
-
require('core-js/modules/esnext.iterator.constructor.js');
|
|
10
|
-
require('core-js/modules/esnext.iterator.filter.js');
|
|
11
|
-
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
12
|
-
require('core-js/modules/esnext.iterator.for-each.js');
|
|
13
|
-
var React = require('react');
|
|
14
|
-
var DSModal = require('@elliemae/ds-modal');
|
|
15
|
-
var DSSpinner = require('@elliemae/ds-spinner');
|
|
16
|
-
var dsIcon = require('@elliemae/ds-icon');
|
|
17
|
-
var lodash = require('lodash');
|
|
18
|
-
var ImageLoader = require('react-loading-image');
|
|
19
|
-
var dsIcons = require('@elliemae/ds-icons');
|
|
20
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
-
|
|
22
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
-
|
|
24
|
-
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
25
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
26
|
-
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
27
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
28
|
-
var DSModal__default = /*#__PURE__*/_interopDefaultLegacy(DSModal);
|
|
29
|
-
var DSSpinner__default = /*#__PURE__*/_interopDefaultLegacy(DSSpinner);
|
|
30
|
-
var ImageLoader__default = /*#__PURE__*/_interopDefaultLegacy(ImageLoader);
|
|
31
|
-
|
|
32
|
-
const _excluded = ["containerProps", "imagesData", "onSelect", "disableDoubleClick"];
|
|
33
|
-
|
|
34
|
-
var _DSSpinner;
|
|
35
|
-
|
|
36
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
-
|
|
38
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
-
const elementClassName = 'imglibmodal-element';
|
|
40
|
-
class ImageLibraryModalImpl extends React__default["default"].PureComponent {
|
|
41
|
-
constructor(props) {
|
|
42
|
-
super(props);
|
|
43
|
-
|
|
44
|
-
this.onReject = () => {
|
|
45
|
-
const {
|
|
46
|
-
onReject,
|
|
47
|
-
onClose
|
|
48
|
-
} = this.props;
|
|
49
|
-
|
|
50
|
-
if (onReject) {
|
|
51
|
-
onReject();
|
|
52
|
-
} else {
|
|
53
|
-
onClose();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
this.handleElementClick = (e, image) => {
|
|
58
|
-
if (e.key && e.key !== ' ') {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const {
|
|
63
|
-
selected
|
|
64
|
-
} = this.state;
|
|
65
|
-
const {
|
|
66
|
-
disableDoubleClick,
|
|
67
|
-
onConfirm,
|
|
68
|
-
onSelect
|
|
69
|
-
} = this.props;
|
|
70
|
-
|
|
71
|
-
if (image === selected && onConfirm && !disableDoubleClick) {
|
|
72
|
-
onConfirm();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
this.setState({
|
|
77
|
-
selected: image,
|
|
78
|
-
user: this.getUser(image)
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
if (onSelect) {
|
|
82
|
-
onSelect(image);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
this.renderElements = () => {
|
|
87
|
-
const {
|
|
88
|
-
imagesData
|
|
89
|
-
} = this.props;
|
|
90
|
-
|
|
91
|
-
if (!imagesData) {
|
|
92
|
-
return 'Empty';
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
const {
|
|
96
|
-
selected
|
|
97
|
-
} = this.state;
|
|
98
|
-
return imagesData.map((image, idx) => {
|
|
99
|
-
const extras = {};
|
|
100
|
-
const {
|
|
101
|
-
name,
|
|
102
|
-
id
|
|
103
|
-
} = image;
|
|
104
|
-
|
|
105
|
-
if (this.focusFirst && idx === 0) {
|
|
106
|
-
extras.ref = element => element && element.focus();
|
|
107
|
-
|
|
108
|
-
this.focusFirst = undefined;
|
|
109
|
-
} else if (selected && name === selected.name) {
|
|
110
|
-
extras.ref = element => element && element.focus();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
|
|
114
|
-
className: elementClassName,
|
|
115
|
-
onClick: e => this.handleElementClick(e, image),
|
|
116
|
-
onKeyUp: e => this.handleElementClick(e, image),
|
|
117
|
-
role: "button",
|
|
118
|
-
tabIndex: 0
|
|
119
|
-
}, extras), {}, {
|
|
120
|
-
children: /*#__PURE__*/_jsx__default["default"]("div", {
|
|
121
|
-
className: "content"
|
|
122
|
-
}, void 0, name)
|
|
123
|
-
}), id || "".concat(name, "_").concat(idx));
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
this.renderSpinner = () => _DSSpinner || (_DSSpinner = /*#__PURE__*/_jsx__default["default"](DSSpinner__default["default"], {
|
|
128
|
-
message: "Loading...",
|
|
129
|
-
size: "m"
|
|
130
|
-
}));
|
|
131
|
-
|
|
132
|
-
this.renderError = () => /*#__PURE__*/_jsx__default["default"](dsIcons.ImageMissing, {
|
|
133
|
-
color: dsIcon.DSIconColors.NEUTRAL,
|
|
134
|
-
size: dsIcon.DSIconSizes.M
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
this.state = {
|
|
138
|
-
selected: undefined,
|
|
139
|
-
user: undefined
|
|
140
|
-
};
|
|
141
|
-
this.preventSpacebarScroll();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
componentDidMount() {
|
|
145
|
-
const {
|
|
146
|
-
imagesData
|
|
147
|
-
} = this.props;
|
|
148
|
-
|
|
149
|
-
if (imagesData) {
|
|
150
|
-
this.handleElementClick({}, imagesData[0]);
|
|
151
|
-
this.focusFirst = true;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
getDerivedStateFromProps(nextProps) {
|
|
156
|
-
const {
|
|
157
|
-
imagesData
|
|
158
|
-
} = this.props;
|
|
159
|
-
|
|
160
|
-
if (!imagesData && nextProps.imagesData) {
|
|
161
|
-
this.setState({
|
|
162
|
-
selected: imagesData[0]
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
getUser(selected) {
|
|
168
|
-
if (!selected) {
|
|
169
|
-
return '';
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const index = selected.createdBy.lastIndexOf('user:');
|
|
173
|
-
|
|
174
|
-
if (index === -1) {
|
|
175
|
-
return selected.createdBy;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return selected.createdBy.substring(index + 5);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
preventSpacebarScroll() {
|
|
182
|
-
document.onkeypress = function (e) {
|
|
183
|
-
if (!lodash.includes(e.target.className, elementClassName)) {
|
|
184
|
-
return true;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
e = e || window.event;
|
|
188
|
-
const charCode = e.keyCode || e.which;
|
|
189
|
-
|
|
190
|
-
if (charCode === 32) {
|
|
191
|
-
e.preventDefault();
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return true;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
drawDiv(className, content) {
|
|
200
|
-
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
201
|
-
className: className
|
|
202
|
-
}, void 0, content);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
drawLabel(className, label, value) {
|
|
206
|
-
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
207
|
-
className: className
|
|
208
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("span", {
|
|
209
|
-
className: "label"
|
|
210
|
-
}, void 0, label), /*#__PURE__*/_jsx__default["default"]("span", {
|
|
211
|
-
className: "value"
|
|
212
|
-
}, void 0, value));
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
render() {
|
|
216
|
-
const {
|
|
217
|
-
selected,
|
|
218
|
-
user
|
|
219
|
-
} = this.state;
|
|
220
|
-
|
|
221
|
-
const _this$props = this.props,
|
|
222
|
-
{
|
|
223
|
-
containerProps,
|
|
224
|
-
imagesData,
|
|
225
|
-
onSelect,
|
|
226
|
-
disableDoubleClick
|
|
227
|
-
} = _this$props,
|
|
228
|
-
modalProps = _objectWithoutProperties__default["default"](_this$props, _excluded);
|
|
229
|
-
|
|
230
|
-
return /*#__PURE__*/jsxRuntime.jsx(DSModal__default["default"], _objectSpread(_objectSpread({
|
|
231
|
-
containerProps: containerProps
|
|
232
|
-
}, modalProps), {}, {
|
|
233
|
-
className: "em-ds-modal-image-library",
|
|
234
|
-
onReject: this.onReject,
|
|
235
|
-
children: /*#__PURE__*/_jsx__default["default"]("div", {
|
|
236
|
-
className: "wrapper"
|
|
237
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
238
|
-
className: "col-1"
|
|
239
|
-
}, void 0, this.drawDiv('title', 'Company Images'), this.renderElements()), /*#__PURE__*/_jsx__default["default"]("div", {
|
|
240
|
-
className: "col-2"
|
|
241
|
-
}, void 0, this.drawDiv('title', selected ? selected.name : ''), /*#__PURE__*/_jsx__default["default"](ImageLoader__default["default"], {
|
|
242
|
-
className: "image-loader",
|
|
243
|
-
error: this.renderError,
|
|
244
|
-
loading: this.renderSpinner,
|
|
245
|
-
src: selected ? selected.url : ''
|
|
246
|
-
}), selected && /*#__PURE__*/_jsx__default["default"]("div", {
|
|
247
|
-
className: "info"
|
|
248
|
-
}, void 0, this.drawLabel('info-element', 'Created Date:', selected.createdDate), this.drawLabel('info-element', 'Created By:', user))))
|
|
249
|
-
}));
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
module.exports = ImageLibraryModalImpl;
|
package/cjs/index.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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';
|
|
7
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
8
|
-
import 'react';
|
|
9
|
-
import { MODAL_TYPE } from '@elliemae/ds-modal';
|
|
10
|
-
import { sizeOptions } from '@elliemae/ds-shared/constants';
|
|
11
|
-
import ImageLibraryModalImpl from './components/ImageLibraryModalImpl.js';
|
|
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); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : 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,
|
|
40
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
41
|
-
|
|
42
|
-
return /*#__PURE__*/jsx(ImageLibraryModalImpl, _objectSpread({
|
|
43
|
-
confirmLabel: confirmLabel,
|
|
44
|
-
containerProps: containerProps,
|
|
45
|
-
disableDoubleClick: disableDoubleClick,
|
|
46
|
-
imagesData: imagesData,
|
|
47
|
-
isOpen: isOpen,
|
|
48
|
-
modalTitle: modalTitle,
|
|
49
|
-
modalType: modalType,
|
|
50
|
-
onSelect: onSelect,
|
|
51
|
-
rejectLabel: rejectLabel,
|
|
52
|
-
shouldCloseOnOverlayClick: shouldCloseOnOverlayClick,
|
|
53
|
-
size: size
|
|
54
|
-
}, rest));
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export { DSImageLibraryModal as default };
|