@elliemae/ds-comments 1.61.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/components/CommentCard.js +74 -76
- package/cjs/components/DSComments.js +4 -17
- package/cjs/components/blocks.js +34 -53
- package/cjs/components/helper.js +4 -5
- package/cjs/index.js +7 -18
- package/esm/components/CommentCard.js +68 -69
- package/esm/components/DSComments.js +0 -13
- package/esm/components/blocks.js +34 -53
- package/esm/components/helper.js +2 -3
- package/esm/index.js +3 -14
- package/package.json +51 -13
- package/types/components/CommentCard.d.ts +143 -0
- package/types/components/DSComments.d.ts +108 -0
- package/types/components/blocks.d.ts +18 -0
- package/types/components/helper.d.ts +3 -0
- package/types/index.d.ts +106 -0
- package/cjs/components/CommentCard.js.map +0 -1
- package/cjs/components/DSComments.js.map +0 -1
- package/cjs/components/blocks.js.map +0 -1
- package/cjs/components/helper.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/components/CommentCard/package.json +0 -10
- package/components/DSComments/package.json +0 -10
- package/components/blocks/package.json +0 -10
- package/components/helper/package.json +0 -10
- package/esm/components/CommentCard.js.map +0 -1
- package/esm/components/DSComments.js.map +0 -1
- package/esm/components/blocks.js.map +0 -1
- package/esm/components/helper.js.map +0 -1
- package/esm/index.js.map +0 -1
|
@@ -2,101 +2,101 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
11
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
|
-
var
|
|
12
|
+
var react = require('react');
|
|
8
13
|
var reactDesc = require('react-desc');
|
|
9
14
|
var DSButton = require('@elliemae/ds-button');
|
|
10
15
|
var dsReadMore = require('@elliemae/ds-read-more');
|
|
11
16
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
12
17
|
var dsIcons = require('@elliemae/ds-icons');
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
require('
|
|
16
|
-
require('moment');
|
|
18
|
+
var blocks = require('./blocks.js');
|
|
19
|
+
var helper = require('./helper.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
21
|
|
|
18
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
23
|
|
|
20
|
-
var
|
|
24
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
25
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
23
26
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
24
27
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
25
28
|
|
|
29
|
+
var _span, _span2, _MoreOptionsVert;
|
|
30
|
+
|
|
26
31
|
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; }
|
|
27
32
|
|
|
28
|
-
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[
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
_ref$dateFormat = _ref.dateFormat,
|
|
55
|
-
dateFormat = _ref$dateFormat === void 0 ? 'MM/DD/YYYY' : _ref$dateFormat,
|
|
56
|
-
_ref$timeFormat = _ref.timeFormat,
|
|
57
|
-
timeFormat = _ref$timeFormat === void 0 ? 'hh:mm a' : _ref$timeFormat,
|
|
58
|
-
_ref$maxLines = _ref.maxLines,
|
|
59
|
-
maxLines = _ref$maxLines === void 0 ? 2 : _ref$maxLines;
|
|
60
|
-
var ref = React.useRef();
|
|
61
|
-
var displayDate = date ? components_helper.getDisplayDate(date, dateFormat) : null;
|
|
62
|
-
var displayTime = date ? components_helper.getTime(date, timeFormat) : null;
|
|
63
|
-
var handleCloseMenu = React.useCallback(function () {
|
|
33
|
+
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; }
|
|
34
|
+
|
|
35
|
+
const CommentCard = _ref => {
|
|
36
|
+
let {
|
|
37
|
+
containerProps = {},
|
|
38
|
+
name = '',
|
|
39
|
+
date = new Date(),
|
|
40
|
+
type = '',
|
|
41
|
+
content = '',
|
|
42
|
+
style = {},
|
|
43
|
+
options = [],
|
|
44
|
+
selection = {
|
|
45
|
+
'single-selection-internal-external': ['set-as-internal']
|
|
46
|
+
},
|
|
47
|
+
customDropdownMenuProps = {
|
|
48
|
+
focusOnOpen: true
|
|
49
|
+
},
|
|
50
|
+
borderBottom,
|
|
51
|
+
dateFormat = 'MM/DD/YYYY',
|
|
52
|
+
timeFormat = 'hh:mm a',
|
|
53
|
+
maxLines = 2
|
|
54
|
+
} = _ref;
|
|
55
|
+
const ref = react.useRef();
|
|
56
|
+
const displayDate = date ? helper.getDisplayDate(date, dateFormat) : null;
|
|
57
|
+
const displayTime = date ? helper.getTime(date, timeFormat) : null;
|
|
58
|
+
const handleCloseMenu = react.useCallback(() => {
|
|
64
59
|
ref.current.focus();
|
|
65
60
|
}, []);
|
|
66
|
-
return /*#__PURE__*/
|
|
61
|
+
return /*#__PURE__*/jsxRuntime.jsxs(blocks.CommentCardWrapper, _objectSpread(_objectSpread({
|
|
67
62
|
classProps: {
|
|
68
|
-
borderBottom
|
|
63
|
+
borderBottom
|
|
69
64
|
},
|
|
70
65
|
tabIndex: 0
|
|
71
|
-
}, containerProps, {
|
|
72
|
-
style: _objectSpread(_objectSpread({}, style), containerProps.style || {})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
}, containerProps), {}, {
|
|
67
|
+
style: _objectSpread(_objectSpread({}, style), containerProps.style || {}),
|
|
68
|
+
children: [/*#__PURE__*/_jsx__default["default"](blocks.CommentCardHeader, {
|
|
69
|
+
classProps: {
|
|
70
|
+
borderBottom
|
|
71
|
+
}
|
|
72
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.CommentCardLeft, {}, void 0, /*#__PURE__*/_jsx__default["default"](blocks.CommentCardName, {}, void 0, name), /*#__PURE__*/_jsx__default["default"](blocks.CommentCardData, {}, void 0, displayDate, displayTime && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
73
|
+
children: [_span || (_span = /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, "\u2022")), displayTime]
|
|
74
|
+
}), type && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
75
|
+
children: [_span2 || (_span2 = /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, "\u2022")), type]
|
|
76
|
+
}))), options && options.length > 0 && /*#__PURE__*/_jsx__default["default"](blocks.CommentCardMenu, {}, void 0, /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu__default["default"], _objectSpread(_objectSpread({}, customDropdownMenuProps), {}, {
|
|
77
|
+
onClose: handleCloseMenu,
|
|
78
|
+
options: options,
|
|
79
|
+
selection: selection,
|
|
80
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
81
|
+
buttonType: "text",
|
|
82
|
+
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx__default["default"](dsIcons.MoreOptionsVert, {})),
|
|
83
|
+
innerRef: ref
|
|
84
|
+
}),
|
|
85
|
+
zIndex: "11" // https://jira.elliemae.io/browse/PUI-1664
|
|
86
|
+
|
|
87
|
+
})))), /*#__PURE__*/_jsx__default["default"](blocks.CommentCardContent, {}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/_jsx__default["default"](dsReadMore.DSReadMore, {
|
|
88
|
+
lines: maxLines,
|
|
89
|
+
content: "".concat(content, " "),
|
|
90
|
+
more: "MORE",
|
|
91
|
+
less: "LESS",
|
|
82
92
|
buttonType: "text",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})))), /*#__PURE__*/React__default['default'].createElement(components_blocks.CommentCardContent, null, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(dsReadMore.DSReadMore, {
|
|
89
|
-
lines: maxLines,
|
|
90
|
-
content: "".concat(content, " "),
|
|
91
|
-
more: "MORE",
|
|
92
|
-
less: "LESS",
|
|
93
|
-
buttonType: "text",
|
|
94
|
-
size: "m",
|
|
95
|
-
ellipsis: "... "
|
|
96
|
-
}))));
|
|
93
|
+
size: "m",
|
|
94
|
+
ellipsis: "... "
|
|
95
|
+
})))]
|
|
96
|
+
}));
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
const props = {
|
|
100
100
|
/** props to inject to comment card wrapper */
|
|
101
101
|
containerProps: reactDesc.PropTypes.shape({
|
|
102
102
|
id: reactDesc.PropTypes.string,
|
|
@@ -143,10 +143,8 @@ var props = {
|
|
|
143
143
|
*/
|
|
144
144
|
maxLines: reactDesc.PropTypes.number.description('Max lines')
|
|
145
145
|
};
|
|
146
|
-
|
|
147
|
-
var DSCommentCardWithSchema = reactDesc.describe(CommentCard);
|
|
146
|
+
const DSCommentCardWithSchema = reactDesc.describe(CommentCard);
|
|
148
147
|
DSCommentCardWithSchema.propTypes = props;
|
|
149
148
|
|
|
150
149
|
exports.DSCommentCardWithSchema = DSCommentCardWithSchema;
|
|
151
|
-
exports[
|
|
152
|
-
//# sourceMappingURL=CommentCard.js.map
|
|
150
|
+
exports["default"] = CommentCard;
|
|
@@ -2,24 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('@babel/runtime/helpers/extends');
|
|
7
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
8
|
-
require('react');
|
|
9
|
-
require('react-desc');
|
|
10
|
-
require('@elliemae/ds-button');
|
|
11
|
-
require('@elliemae/ds-read-more');
|
|
12
|
-
require('@elliemae/ds-dropdownmenu');
|
|
13
|
-
require('@elliemae/ds-icons');
|
|
14
|
-
require('./blocks.js');
|
|
15
|
-
require('@elliemae/ds-classnames');
|
|
16
|
-
require('./helper.js');
|
|
17
|
-
require('moment');
|
|
5
|
+
var CommentCard = require('./CommentCard.js');
|
|
18
6
|
|
|
19
7
|
var DSComments = {
|
|
20
|
-
DSCommentCard:
|
|
8
|
+
DSCommentCard: CommentCard["default"]
|
|
21
9
|
};
|
|
22
10
|
|
|
23
|
-
exports.DSCommentCardWithSchema =
|
|
24
|
-
exports[
|
|
25
|
-
//# sourceMappingURL=DSComments.js.map
|
|
11
|
+
exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
|
|
12
|
+
exports["default"] = DSComments;
|
package/cjs/components/blocks.js
CHANGED
|
@@ -4,72 +4,54 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const blockName = 'comments';
|
|
8
|
+
const WrapperArea = dsClassnames.aggregatedClasses('div')(blockName, 'area', () => ({}));
|
|
9
|
+
const WrapperComments = dsClassnames.aggregatedClasses('div')(blockName, 'comments', _ref => {
|
|
10
|
+
let {
|
|
11
|
+
hasScroll
|
|
12
|
+
} = _ref;
|
|
13
13
|
return {
|
|
14
|
-
hasScroll
|
|
14
|
+
hasScroll,
|
|
15
15
|
'not-scroll': !hasScroll
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const WrapperCommentsScroll = dsClassnames.aggregatedClasses('div')(blockName, 'comments-scroll', _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
hasScroll
|
|
21
|
+
} = _ref2;
|
|
20
22
|
return {
|
|
21
|
-
hasScroll
|
|
23
|
+
hasScroll,
|
|
22
24
|
'not-scroll': !hasScroll
|
|
23
25
|
};
|
|
24
26
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
});
|
|
34
|
-
var SubmitButton = dsClassnames.aggregatedClasses('div')(blockName, 'submit-btn', function () {
|
|
35
|
-
return {};
|
|
36
|
-
});
|
|
37
|
-
var CommentCardWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-wrapper', function (_ref3) {
|
|
38
|
-
var borderBottom = _ref3.borderBottom;
|
|
27
|
+
const Counter = dsClassnames.aggregatedClasses('div')(blockName, 'counter', () => ({}));
|
|
28
|
+
const SubmitWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'submit-wrapper', () => ({}));
|
|
29
|
+
const SubmitExternal = dsClassnames.aggregatedClasses('div')(blockName, 'submit-external', () => ({}));
|
|
30
|
+
const SubmitButton = dsClassnames.aggregatedClasses('div')(blockName, 'submit-btn', () => ({}));
|
|
31
|
+
const CommentCardWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-wrapper', _ref3 => {
|
|
32
|
+
let {
|
|
33
|
+
borderBottom
|
|
34
|
+
} = _ref3;
|
|
39
35
|
return {
|
|
40
|
-
borderBottom
|
|
36
|
+
borderBottom
|
|
41
37
|
};
|
|
42
38
|
});
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const CommentCardHeader = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-header', _ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
borderBottom
|
|
42
|
+
} = _ref4;
|
|
45
43
|
return {
|
|
46
|
-
borderBottom
|
|
44
|
+
borderBottom
|
|
47
45
|
};
|
|
48
46
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
var CommentCardData = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-data', function () {
|
|
59
|
-
return {};
|
|
60
|
-
});
|
|
61
|
-
var CommentCardMenu = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-menu', function () {
|
|
62
|
-
return {};
|
|
63
|
-
});
|
|
64
|
-
var CommentEmptyWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty', function () {
|
|
65
|
-
return {};
|
|
66
|
-
});
|
|
67
|
-
var CommentEmptyIcon = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty-icon', function () {
|
|
68
|
-
return {};
|
|
69
|
-
});
|
|
70
|
-
var CommentEmptyLabel = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty-label', function () {
|
|
71
|
-
return {};
|
|
72
|
-
});
|
|
47
|
+
const CommentCardContent = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-content', () => ({}));
|
|
48
|
+
const CommentCardLeft = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-left', () => ({}));
|
|
49
|
+
const CommentCardName = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-name', () => ({}));
|
|
50
|
+
const CommentCardData = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-data', () => ({}));
|
|
51
|
+
const CommentCardMenu = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-menu', () => ({}));
|
|
52
|
+
const CommentEmptyWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty', () => ({}));
|
|
53
|
+
const CommentEmptyIcon = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty-icon', () => ({}));
|
|
54
|
+
const CommentEmptyLabel = dsClassnames.aggregatedClasses('div')(blockName, 'comment-empty-label', () => ({}));
|
|
73
55
|
|
|
74
56
|
exports.CommentCardContent = CommentCardContent;
|
|
75
57
|
exports.CommentCardData = CommentCardData;
|
|
@@ -88,4 +70,3 @@ exports.SubmitWrapper = SubmitWrapper;
|
|
|
88
70
|
exports.WrapperArea = WrapperArea;
|
|
89
71
|
exports.WrapperComments = WrapperComments;
|
|
90
72
|
exports.WrapperCommentsScroll = WrapperCommentsScroll;
|
|
91
|
-
//# sourceMappingURL=blocks.js.map
|
package/cjs/components/helper.js
CHANGED
|
@@ -12,15 +12,14 @@ function getMaxSize() {
|
|
|
12
12
|
return 113;
|
|
13
13
|
}
|
|
14
14
|
function getTime(date) {
|
|
15
|
-
|
|
16
|
-
return moment__default[
|
|
15
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm a';
|
|
16
|
+
return moment__default["default"](date).format(formatString);
|
|
17
17
|
}
|
|
18
18
|
function getDisplayDate(date) {
|
|
19
|
-
|
|
20
|
-
return moment__default[
|
|
19
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'MM/DD/YYYY';
|
|
20
|
+
return moment__default["default"](date).format(formatString);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
exports.getDisplayDate = getDisplayDate;
|
|
24
24
|
exports.getMaxSize = getMaxSize;
|
|
25
25
|
exports.getTime = getTime;
|
|
26
|
-
//# sourceMappingURL=helper.js.map
|
package/cjs/index.js
CHANGED
|
@@ -2,24 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
require('@babel/runtime/helpers/extends');
|
|
8
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
9
|
-
require('react');
|
|
10
|
-
require('react-desc');
|
|
11
|
-
require('@elliemae/ds-button');
|
|
12
|
-
require('@elliemae/ds-read-more');
|
|
13
|
-
require('@elliemae/ds-dropdownmenu');
|
|
14
|
-
require('@elliemae/ds-icons');
|
|
15
|
-
require('./components/blocks.js');
|
|
16
|
-
require('@elliemae/ds-classnames');
|
|
17
|
-
require('./components/helper.js');
|
|
18
|
-
require('moment');
|
|
5
|
+
var DSComments = require('./components/DSComments.js');
|
|
6
|
+
var CommentCard = require('./components/CommentCard.js');
|
|
19
7
|
|
|
20
|
-
|
|
8
|
+
const {
|
|
9
|
+
DSCommentCard
|
|
10
|
+
} = DSComments["default"];
|
|
21
11
|
|
|
22
|
-
exports.DSCommentCardWithSchema =
|
|
12
|
+
exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
|
|
23
13
|
exports.DSCommentCard = DSCommentCard;
|
|
24
|
-
exports[
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
14
|
+
exports["default"] = DSCommentCard;
|
|
@@ -1,6 +1,11 @@
|
|
|
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 _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
-
import
|
|
8
|
+
import { useRef, useCallback } from 'react';
|
|
4
9
|
import { PropTypes, describe } from 'react-desc';
|
|
5
10
|
import DSButton from '@elliemae/ds-button';
|
|
6
11
|
import { DSReadMore } from '@elliemae/ds-read-more';
|
|
@@ -8,83 +13,79 @@ import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
|
8
13
|
import { MoreOptionsVert } from '@elliemae/ds-icons';
|
|
9
14
|
import { CommentCardWrapper, CommentCardHeader, CommentCardLeft, CommentCardName, CommentCardData, CommentCardMenu, CommentCardContent } from './blocks.js';
|
|
10
15
|
import { getDisplayDate, getTime } from './helper.js';
|
|
11
|
-
import '
|
|
12
|
-
|
|
16
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
var _span, _span2, _MoreOptionsVert;
|
|
13
19
|
|
|
14
20
|
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; }
|
|
15
21
|
|
|
16
22
|
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; }
|
|
17
23
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
_ref$dateFormat = _ref.dateFormat,
|
|
43
|
-
dateFormat = _ref$dateFormat === void 0 ? 'MM/DD/YYYY' : _ref$dateFormat,
|
|
44
|
-
_ref$timeFormat = _ref.timeFormat,
|
|
45
|
-
timeFormat = _ref$timeFormat === void 0 ? 'hh:mm a' : _ref$timeFormat,
|
|
46
|
-
_ref$maxLines = _ref.maxLines,
|
|
47
|
-
maxLines = _ref$maxLines === void 0 ? 2 : _ref$maxLines;
|
|
48
|
-
var ref = useRef();
|
|
49
|
-
var displayDate = date ? getDisplayDate(date, dateFormat) : null;
|
|
50
|
-
var displayTime = date ? getTime(date, timeFormat) : null;
|
|
51
|
-
var handleCloseMenu = useCallback(function () {
|
|
24
|
+
const CommentCard = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
containerProps = {},
|
|
27
|
+
name = '',
|
|
28
|
+
date = new Date(),
|
|
29
|
+
type = '',
|
|
30
|
+
content = '',
|
|
31
|
+
style = {},
|
|
32
|
+
options = [],
|
|
33
|
+
selection = {
|
|
34
|
+
'single-selection-internal-external': ['set-as-internal']
|
|
35
|
+
},
|
|
36
|
+
customDropdownMenuProps = {
|
|
37
|
+
focusOnOpen: true
|
|
38
|
+
},
|
|
39
|
+
borderBottom,
|
|
40
|
+
dateFormat = 'MM/DD/YYYY',
|
|
41
|
+
timeFormat = 'hh:mm a',
|
|
42
|
+
maxLines = 2
|
|
43
|
+
} = _ref;
|
|
44
|
+
const ref = useRef();
|
|
45
|
+
const displayDate = date ? getDisplayDate(date, dateFormat) : null;
|
|
46
|
+
const displayTime = date ? getTime(date, timeFormat) : null;
|
|
47
|
+
const handleCloseMenu = useCallback(() => {
|
|
52
48
|
ref.current.focus();
|
|
53
49
|
}, []);
|
|
54
|
-
return /*#__PURE__*/
|
|
50
|
+
return /*#__PURE__*/jsxs(CommentCardWrapper, _objectSpread(_objectSpread({
|
|
55
51
|
classProps: {
|
|
56
|
-
borderBottom
|
|
52
|
+
borderBottom
|
|
57
53
|
},
|
|
58
54
|
tabIndex: 0
|
|
59
|
-
}, containerProps, {
|
|
60
|
-
style: _objectSpread(_objectSpread({}, style), containerProps.style || {})
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
}, containerProps), {}, {
|
|
56
|
+
style: _objectSpread(_objectSpread({}, style), containerProps.style || {}),
|
|
57
|
+
children: [/*#__PURE__*/_jsx(CommentCardHeader, {
|
|
58
|
+
classProps: {
|
|
59
|
+
borderBottom
|
|
60
|
+
}
|
|
61
|
+
}, void 0, /*#__PURE__*/_jsx(CommentCardLeft, {}, void 0, /*#__PURE__*/_jsx(CommentCardName, {}, void 0, name), /*#__PURE__*/_jsx(CommentCardData, {}, void 0, displayDate, displayTime && /*#__PURE__*/jsxs(Fragment, {
|
|
62
|
+
children: [_span || (_span = /*#__PURE__*/_jsx("span", {}, void 0, "\u2022")), displayTime]
|
|
63
|
+
}), type && /*#__PURE__*/jsxs(Fragment, {
|
|
64
|
+
children: [_span2 || (_span2 = /*#__PURE__*/_jsx("span", {}, void 0, "\u2022")), type]
|
|
65
|
+
}))), options && options.length > 0 && /*#__PURE__*/_jsx(CommentCardMenu, {}, void 0, /*#__PURE__*/jsx(DSDropdownMenu, _objectSpread(_objectSpread({}, customDropdownMenuProps), {}, {
|
|
66
|
+
onClose: handleCloseMenu,
|
|
67
|
+
options: options,
|
|
68
|
+
selection: selection,
|
|
69
|
+
triggerComponent: /*#__PURE__*/_jsx(DSButton, {
|
|
70
|
+
buttonType: "text",
|
|
71
|
+
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx(MoreOptionsVert, {})),
|
|
72
|
+
innerRef: ref
|
|
73
|
+
}),
|
|
74
|
+
zIndex: "11" // https://jira.elliemae.io/browse/PUI-1664
|
|
75
|
+
|
|
76
|
+
})))), /*#__PURE__*/_jsx(CommentCardContent, {}, void 0, /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/_jsx(DSReadMore, {
|
|
77
|
+
lines: maxLines,
|
|
78
|
+
content: "".concat(content, " "),
|
|
79
|
+
more: "MORE",
|
|
80
|
+
less: "LESS",
|
|
70
81
|
buttonType: "text",
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
})))), /*#__PURE__*/React.createElement(CommentCardContent, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DSReadMore, {
|
|
77
|
-
lines: maxLines,
|
|
78
|
-
content: "".concat(content, " "),
|
|
79
|
-
more: "MORE",
|
|
80
|
-
less: "LESS",
|
|
81
|
-
buttonType: "text",
|
|
82
|
-
size: "m",
|
|
83
|
-
ellipsis: "... "
|
|
84
|
-
}))));
|
|
82
|
+
size: "m",
|
|
83
|
+
ellipsis: "... "
|
|
84
|
+
})))]
|
|
85
|
+
}));
|
|
85
86
|
};
|
|
86
87
|
|
|
87
|
-
|
|
88
|
+
const props = {
|
|
88
89
|
/** props to inject to comment card wrapper */
|
|
89
90
|
containerProps: PropTypes.shape({
|
|
90
91
|
id: PropTypes.string,
|
|
@@ -131,9 +132,7 @@ var props = {
|
|
|
131
132
|
*/
|
|
132
133
|
maxLines: PropTypes.number.description('Max lines')
|
|
133
134
|
};
|
|
134
|
-
|
|
135
|
-
var DSCommentCardWithSchema = describe(CommentCard);
|
|
135
|
+
const DSCommentCardWithSchema = describe(CommentCard);
|
|
136
136
|
DSCommentCardWithSchema.propTypes = props;
|
|
137
137
|
|
|
138
138
|
export { DSCommentCardWithSchema, CommentCard as default };
|
|
139
|
-
//# sourceMappingURL=CommentCard.js.map
|
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import CommentCard from './CommentCard.js';
|
|
2
2
|
export { DSCommentCardWithSchema } from './CommentCard.js';
|
|
3
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
4
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react-desc';
|
|
7
|
-
import '@elliemae/ds-button';
|
|
8
|
-
import '@elliemae/ds-read-more';
|
|
9
|
-
import '@elliemae/ds-dropdownmenu';
|
|
10
|
-
import '@elliemae/ds-icons';
|
|
11
|
-
import './blocks.js';
|
|
12
|
-
import '@elliemae/ds-classnames';
|
|
13
|
-
import './helper.js';
|
|
14
|
-
import 'moment';
|
|
15
3
|
|
|
16
4
|
var DSComments = {
|
|
17
5
|
DSCommentCard: CommentCard
|
|
18
6
|
};
|
|
19
7
|
|
|
20
8
|
export { DSComments as default };
|
|
21
|
-
//# sourceMappingURL=DSComments.js.map
|