@elliemae/ds-comments 2.0.0-alpha.1 → 2.0.0-alpha.13
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 +40 -35
- package/cjs/components/DSComments.js +2 -2
- package/cjs/components/blocks.js +34 -22
- package/cjs/components/helper.js +6 -4
- package/cjs/index.js +2 -2
- package/esm/components/CommentCard.js +29 -23
- package/esm/components/blocks.js +34 -22
- package/esm/components/helper.js +4 -2
- package/package.json +11 -7
- package/types/components/CommentCard.d.ts +102 -14
- package/types/components/DSComments.d.ts +79 -13
- package/types/index.d.ts +79 -13
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
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');
|
|
5
10
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
11
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
12
|
var react = require('react');
|
|
8
13
|
var reactDesc = require('react-desc');
|
|
9
|
-
var DSButton = require('@elliemae/ds-
|
|
10
|
-
var
|
|
14
|
+
var DSButton = require('@elliemae/ds-button');
|
|
15
|
+
var dsReadMore = require('@elliemae/ds-read-more');
|
|
11
16
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
12
|
-
var
|
|
17
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
13
18
|
var blocks = require('./blocks.js');
|
|
14
19
|
var helper = require('./helper.js');
|
|
15
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -20,33 +25,33 @@ var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
|
20
25
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
26
|
var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
|
|
22
27
|
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
23
|
-
var MoreOptionsVert__default = /*#__PURE__*/_interopDefaultLegacy(MoreOptionsVert);
|
|
24
28
|
|
|
25
29
|
var _span, _span2, _MoreOptionsVert;
|
|
26
30
|
|
|
27
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; }
|
|
28
32
|
|
|
29
|
-
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[
|
|
30
|
-
|
|
31
|
-
const CommentCard =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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;
|
|
50
55
|
const ref = react.useRef();
|
|
51
56
|
const displayDate = date ? helper.getDisplayDate(date, dateFormat) : null;
|
|
52
57
|
const displayTime = date ? helper.getTime(date, timeFormat) : null;
|
|
@@ -60,28 +65,28 @@ const CommentCard = ({
|
|
|
60
65
|
tabIndex: 0
|
|
61
66
|
}, containerProps), {}, {
|
|
62
67
|
style: _objectSpread(_objectSpread({}, style), containerProps.style || {}),
|
|
63
|
-
children: [/*#__PURE__*/_jsx__default[
|
|
68
|
+
children: [/*#__PURE__*/_jsx__default["default"](blocks.CommentCardHeader, {
|
|
64
69
|
classProps: {
|
|
65
70
|
borderBottom
|
|
66
71
|
}
|
|
67
|
-
}, void 0, /*#__PURE__*/_jsx__default[
|
|
68
|
-
children: [_span || (_span = /*#__PURE__*/_jsx__default[
|
|
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]
|
|
69
74
|
}), type && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
70
|
-
children: [_span2 || (_span2 = /*#__PURE__*/_jsx__default[
|
|
71
|
-
}))), options && options.length > 0 && /*#__PURE__*/_jsx__default[
|
|
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), {}, {
|
|
72
77
|
onClose: handleCloseMenu,
|
|
73
78
|
options: options,
|
|
74
79
|
selection: selection,
|
|
75
|
-
triggerComponent: /*#__PURE__*/_jsx__default[
|
|
80
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](DSButton__default["default"], {
|
|
76
81
|
buttonType: "text",
|
|
77
|
-
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx__default[
|
|
82
|
+
icon: _MoreOptionsVert || (_MoreOptionsVert = /*#__PURE__*/_jsx__default["default"](dsIcons.MoreOptionsVert, {})),
|
|
78
83
|
innerRef: ref
|
|
79
84
|
}),
|
|
80
85
|
zIndex: "11" // https://jira.elliemae.io/browse/PUI-1664
|
|
81
86
|
|
|
82
|
-
})))), /*#__PURE__*/_jsx__default[
|
|
87
|
+
})))), /*#__PURE__*/_jsx__default["default"](blocks.CommentCardContent, {}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, /*#__PURE__*/_jsx__default["default"](dsReadMore.DSReadMore, {
|
|
83
88
|
lines: maxLines,
|
|
84
|
-
content:
|
|
89
|
+
content: "".concat(content, " "),
|
|
85
90
|
more: "MORE",
|
|
86
91
|
less: "LESS",
|
|
87
92
|
buttonType: "text",
|
|
@@ -142,4 +147,4 @@ const DSCommentCardWithSchema = reactDesc.describe(CommentCard);
|
|
|
142
147
|
DSCommentCardWithSchema.propTypes = props;
|
|
143
148
|
|
|
144
149
|
exports.DSCommentCardWithSchema = DSCommentCardWithSchema;
|
|
145
|
-
exports[
|
|
150
|
+
exports["default"] = CommentCard;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var CommentCard = require('./CommentCard.js');
|
|
6
6
|
|
|
7
7
|
var DSComments = {
|
|
8
|
-
DSCommentCard: CommentCard[
|
|
8
|
+
DSCommentCard: CommentCard["default"]
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
|
|
12
|
-
exports[
|
|
12
|
+
exports["default"] = DSComments;
|
package/cjs/components/blocks.js
CHANGED
|
@@ -6,32 +6,44 @@ var dsClassnames = require('@elliemae/ds-classnames');
|
|
|
6
6
|
|
|
7
7
|
const blockName = 'comments';
|
|
8
8
|
const WrapperArea = dsClassnames.aggregatedClasses('div')(blockName, 'area', () => ({}));
|
|
9
|
-
const WrapperComments = dsClassnames.aggregatedClasses('div')(blockName, 'comments',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
const WrapperComments = dsClassnames.aggregatedClasses('div')(blockName, 'comments', _ref => {
|
|
10
|
+
let {
|
|
11
|
+
hasScroll
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
hasScroll,
|
|
15
|
+
'not-scroll': !hasScroll
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
const WrapperCommentsScroll = dsClassnames.aggregatedClasses('div')(blockName, 'comments-scroll', _ref2 => {
|
|
19
|
+
let {
|
|
20
|
+
hasScroll
|
|
21
|
+
} = _ref2;
|
|
22
|
+
return {
|
|
23
|
+
hasScroll,
|
|
24
|
+
'not-scroll': !hasScroll
|
|
25
|
+
};
|
|
26
|
+
});
|
|
21
27
|
const Counter = dsClassnames.aggregatedClasses('div')(blockName, 'counter', () => ({}));
|
|
22
28
|
const SubmitWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'submit-wrapper', () => ({}));
|
|
23
29
|
const SubmitExternal = dsClassnames.aggregatedClasses('div')(blockName, 'submit-external', () => ({}));
|
|
24
30
|
const SubmitButton = dsClassnames.aggregatedClasses('div')(blockName, 'submit-btn', () => ({}));
|
|
25
|
-
const CommentCardWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-wrapper',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const CommentCardWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-wrapper', _ref3 => {
|
|
32
|
+
let {
|
|
33
|
+
borderBottom
|
|
34
|
+
} = _ref3;
|
|
35
|
+
return {
|
|
36
|
+
borderBottom
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const CommentCardHeader = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-header', _ref4 => {
|
|
40
|
+
let {
|
|
41
|
+
borderBottom
|
|
42
|
+
} = _ref4;
|
|
43
|
+
return {
|
|
44
|
+
borderBottom
|
|
45
|
+
};
|
|
46
|
+
});
|
|
35
47
|
const CommentCardContent = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-content', () => ({}));
|
|
36
48
|
const CommentCardLeft = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-left', () => ({}));
|
|
37
49
|
const CommentCardName = dsClassnames.aggregatedClasses('div')(blockName, 'comment-card-name', () => ({}));
|
package/cjs/components/helper.js
CHANGED
|
@@ -11,11 +11,13 @@ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
|
11
11
|
function getMaxSize() {
|
|
12
12
|
return 113;
|
|
13
13
|
}
|
|
14
|
-
function getTime(date
|
|
15
|
-
|
|
14
|
+
function getTime(date) {
|
|
15
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm a';
|
|
16
|
+
return moment__default["default"](date).format(formatString);
|
|
16
17
|
}
|
|
17
|
-
function getDisplayDate(date
|
|
18
|
-
|
|
18
|
+
function getDisplayDate(date) {
|
|
19
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'MM/DD/YYYY';
|
|
20
|
+
return moment__default["default"](date).format(formatString);
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
exports.getDisplayDate = getDisplayDate;
|
package/cjs/index.js
CHANGED
|
@@ -7,8 +7,8 @@ var CommentCard = require('./components/CommentCard.js');
|
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
9
|
DSCommentCard
|
|
10
|
-
} = DSComments[
|
|
10
|
+
} = DSComments["default"];
|
|
11
11
|
|
|
12
12
|
exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
|
|
13
13
|
exports.DSCommentCard = DSCommentCard;
|
|
14
|
-
exports[
|
|
14
|
+
exports["default"] = DSCommentCard;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import { useRef, useCallback } from 'react';
|
|
4
9
|
import { PropTypes, describe } from 'react-desc';
|
|
5
|
-
import DSButton from '@elliemae/ds-
|
|
6
|
-
import { DSReadMore } from '@elliemae/ds-
|
|
10
|
+
import DSButton from '@elliemae/ds-button';
|
|
11
|
+
import { DSReadMore } from '@elliemae/ds-read-more';
|
|
7
12
|
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
8
|
-
import MoreOptionsVert from '@elliemae/ds-icons
|
|
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
16
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
@@ -16,25 +21,26 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
16
21
|
|
|
17
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; }
|
|
18
23
|
|
|
19
|
-
const CommentCard =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
38
44
|
const ref = useRef();
|
|
39
45
|
const displayDate = date ? getDisplayDate(date, dateFormat) : null;
|
|
40
46
|
const displayTime = date ? getTime(date, timeFormat) : null;
|
|
@@ -69,7 +75,7 @@ const CommentCard = ({
|
|
|
69
75
|
|
|
70
76
|
})))), /*#__PURE__*/_jsx(CommentCardContent, {}, void 0, /*#__PURE__*/_jsx("div", {}, void 0, /*#__PURE__*/_jsx(DSReadMore, {
|
|
71
77
|
lines: maxLines,
|
|
72
|
-
content:
|
|
78
|
+
content: "".concat(content, " "),
|
|
73
79
|
more: "MORE",
|
|
74
80
|
less: "LESS",
|
|
75
81
|
buttonType: "text",
|
package/esm/components/blocks.js
CHANGED
|
@@ -2,32 +2,44 @@ import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
|
2
2
|
|
|
3
3
|
const blockName = 'comments';
|
|
4
4
|
const WrapperArea = aggregatedClasses('div')(blockName, 'area', () => ({}));
|
|
5
|
-
const WrapperComments = aggregatedClasses('div')(blockName, 'comments',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const WrapperComments = aggregatedClasses('div')(blockName, 'comments', _ref => {
|
|
6
|
+
let {
|
|
7
|
+
hasScroll
|
|
8
|
+
} = _ref;
|
|
9
|
+
return {
|
|
10
|
+
hasScroll,
|
|
11
|
+
'not-scroll': !hasScroll
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
const WrapperCommentsScroll = aggregatedClasses('div')(blockName, 'comments-scroll', _ref2 => {
|
|
15
|
+
let {
|
|
16
|
+
hasScroll
|
|
17
|
+
} = _ref2;
|
|
18
|
+
return {
|
|
19
|
+
hasScroll,
|
|
20
|
+
'not-scroll': !hasScroll
|
|
21
|
+
};
|
|
22
|
+
});
|
|
17
23
|
const Counter = aggregatedClasses('div')(blockName, 'counter', () => ({}));
|
|
18
24
|
const SubmitWrapper = aggregatedClasses('div')(blockName, 'submit-wrapper', () => ({}));
|
|
19
25
|
const SubmitExternal = aggregatedClasses('div')(blockName, 'submit-external', () => ({}));
|
|
20
26
|
const SubmitButton = aggregatedClasses('div')(blockName, 'submit-btn', () => ({}));
|
|
21
|
-
const CommentCardWrapper = aggregatedClasses('div')(blockName, 'comment-card-wrapper',
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const CommentCardWrapper = aggregatedClasses('div')(blockName, 'comment-card-wrapper', _ref3 => {
|
|
28
|
+
let {
|
|
29
|
+
borderBottom
|
|
30
|
+
} = _ref3;
|
|
31
|
+
return {
|
|
32
|
+
borderBottom
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
const CommentCardHeader = aggregatedClasses('div')(blockName, 'comment-card-header', _ref4 => {
|
|
36
|
+
let {
|
|
37
|
+
borderBottom
|
|
38
|
+
} = _ref4;
|
|
39
|
+
return {
|
|
40
|
+
borderBottom
|
|
41
|
+
};
|
|
42
|
+
});
|
|
31
43
|
const CommentCardContent = aggregatedClasses('div')(blockName, 'comment-card-content', () => ({}));
|
|
32
44
|
const CommentCardLeft = aggregatedClasses('div')(blockName, 'comment-card-left', () => ({}));
|
|
33
45
|
const CommentCardName = aggregatedClasses('div')(blockName, 'comment-card-name', () => ({}));
|
package/esm/components/helper.js
CHANGED
|
@@ -3,10 +3,12 @@ import moment from 'moment';
|
|
|
3
3
|
function getMaxSize() {
|
|
4
4
|
return 113;
|
|
5
5
|
}
|
|
6
|
-
function getTime(date
|
|
6
|
+
function getTime(date) {
|
|
7
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hh:mm a';
|
|
7
8
|
return moment(date).format(formatString);
|
|
8
9
|
}
|
|
9
|
-
function getDisplayDate(date
|
|
10
|
+
function getDisplayDate(date) {
|
|
11
|
+
let formatString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'MM/DD/YYYY';
|
|
10
12
|
return moment(date).format(formatString);
|
|
11
13
|
}
|
|
12
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-comments",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Comments",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -48,19 +48,23 @@
|
|
|
48
48
|
"build": "node ../../scripts/build/build.js"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@elliemae/ds-
|
|
52
|
-
"@elliemae/ds-classnames": "2.0.0-alpha.
|
|
53
|
-
"@elliemae/ds-dropdownmenu": "2.0.0-alpha.
|
|
54
|
-
"
|
|
51
|
+
"@elliemae/ds-button": "2.0.0-alpha.13",
|
|
52
|
+
"@elliemae/ds-classnames": "2.0.0-alpha.13",
|
|
53
|
+
"@elliemae/ds-dropdownmenu": "2.0.0-alpha.13",
|
|
54
|
+
"@elliemae/ds-icons": "2.0.0-alpha.13",
|
|
55
|
+
"@elliemae/ds-read-more": "2.0.0-alpha.13",
|
|
56
|
+
"moment": "~2.29.1",
|
|
57
|
+
"prop-types": "~15.7.2",
|
|
58
|
+
"react-desc": "~4.1.3"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
|
-
"styled-components": "~5.3.
|
|
61
|
+
"styled-components": "~5.3.3"
|
|
58
62
|
},
|
|
59
63
|
"peerDependencies": {
|
|
60
64
|
"lodash": "^4.17.21",
|
|
61
65
|
"react": "~17.0.2",
|
|
62
66
|
"react-dom": "^17.0.2",
|
|
63
|
-
"styled-components": "~5.3.
|
|
67
|
+
"styled-components": "~5.3.3"
|
|
64
68
|
},
|
|
65
69
|
"publishConfig": {
|
|
66
70
|
"access": "public",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
declare const CommentCard: {
|
|
3
4
|
({ containerProps, name, date, type, content, style, options, selection, customDropdownMenuProps, borderBottom, dateFormat, timeFormat, maxLines, }: {
|
|
@@ -21,35 +22,122 @@ declare const CommentCard: {
|
|
|
21
22
|
}): JSX.Element;
|
|
22
23
|
propTypes: {
|
|
23
24
|
/** props to inject to comment card wrapper */
|
|
24
|
-
containerProps:
|
|
25
|
+
containerProps: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
25
31
|
/** form name */
|
|
26
|
-
name:
|
|
32
|
+
name: {
|
|
33
|
+
defaultValue<T = unknown>(arg: T): {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
27
38
|
/** style object */
|
|
28
|
-
style:
|
|
39
|
+
style: {
|
|
40
|
+
defaultValue<T = unknown>(arg: T): {
|
|
41
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
44
|
+
};
|
|
29
45
|
/** date object */
|
|
30
|
-
date:
|
|
46
|
+
date: {
|
|
47
|
+
defaultValue<T = unknown>(arg: T): {
|
|
48
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
49
|
+
};
|
|
50
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
51
|
+
};
|
|
31
52
|
/** comment type string */
|
|
32
|
-
type:
|
|
53
|
+
type: {
|
|
54
|
+
defaultValue<T = unknown>(arg: T): {
|
|
55
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
56
|
+
};
|
|
57
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
58
|
+
};
|
|
33
59
|
/** comment content */
|
|
34
|
-
content:
|
|
60
|
+
content: {
|
|
61
|
+
defaultValue<T = unknown>(arg: T): {
|
|
62
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
63
|
+
};
|
|
64
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
65
|
+
};
|
|
35
66
|
/** dropdown menu options */
|
|
36
|
-
options:
|
|
67
|
+
options: {
|
|
68
|
+
defaultValue<T = unknown>(arg: T): {
|
|
69
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
+
};
|
|
71
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
72
|
+
};
|
|
37
73
|
/** dropdown selection */
|
|
38
|
-
selection:
|
|
74
|
+
selection: {
|
|
75
|
+
defaultValue<T = unknown>(arg: T): {
|
|
76
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
78
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
79
|
+
};
|
|
39
80
|
/** pass down props to dropdown */
|
|
40
|
-
customDropdownMenuProps:
|
|
81
|
+
customDropdownMenuProps: {
|
|
82
|
+
defaultValue<T = unknown>(arg: T): {
|
|
83
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
84
|
+
};
|
|
85
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
86
|
+
};
|
|
41
87
|
/** toggle border bottom for card */
|
|
42
|
-
borderBottom:
|
|
88
|
+
borderBottom: {
|
|
89
|
+
defaultValue<T = unknown>(arg: T): {
|
|
90
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
91
|
+
};
|
|
92
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
93
|
+
};
|
|
43
94
|
/** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
|
|
44
|
-
dateFormat:
|
|
95
|
+
dateFormat: {
|
|
96
|
+
defaultValue<T = unknown>(arg: T): {
|
|
97
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
98
|
+
};
|
|
99
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
100
|
+
};
|
|
45
101
|
/** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */
|
|
46
|
-
timeFormat:
|
|
102
|
+
timeFormat: {
|
|
103
|
+
defaultValue<T = unknown>(arg: T): {
|
|
104
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
105
|
+
};
|
|
106
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
107
|
+
};
|
|
47
108
|
/**
|
|
48
109
|
* Max lines
|
|
49
110
|
*/
|
|
50
|
-
maxLines:
|
|
111
|
+
maxLines: {
|
|
112
|
+
defaultValue<T = unknown>(arg: T): {
|
|
113
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
114
|
+
};
|
|
115
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
116
|
+
};
|
|
51
117
|
};
|
|
52
118
|
};
|
|
53
|
-
declare const DSCommentCardWithSchema:
|
|
119
|
+
declare const DSCommentCardWithSchema: {
|
|
120
|
+
(props?: {
|
|
121
|
+
containerProps?: {} | undefined;
|
|
122
|
+
name?: string | undefined;
|
|
123
|
+
date?: Date | undefined;
|
|
124
|
+
type?: string | undefined;
|
|
125
|
+
content?: string | undefined;
|
|
126
|
+
style?: {} | undefined;
|
|
127
|
+
options?: never[] | undefined;
|
|
128
|
+
selection?: {
|
|
129
|
+
'single-selection-internal-external': string[];
|
|
130
|
+
} | undefined;
|
|
131
|
+
customDropdownMenuProps?: {
|
|
132
|
+
focusOnOpen: boolean;
|
|
133
|
+
} | undefined;
|
|
134
|
+
borderBottom: any;
|
|
135
|
+
dateFormat?: string | undefined;
|
|
136
|
+
timeFormat?: string | undefined;
|
|
137
|
+
maxLines?: number | undefined;
|
|
138
|
+
} | undefined): JSX.Element;
|
|
139
|
+
propTypes: unknown;
|
|
140
|
+
toTypescript: () => import("react-desc").TypescriptSchema;
|
|
141
|
+
};
|
|
54
142
|
export default CommentCard;
|
|
55
143
|
export { DSCommentCardWithSchema };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
import { DSCommentCardWithSchema } from './CommentCard';
|
|
3
4
|
declare const _default: {
|
|
@@ -22,19 +23,84 @@ declare const _default: {
|
|
|
22
23
|
maxLines?: number | undefined;
|
|
23
24
|
}): JSX.Element;
|
|
24
25
|
propTypes: {
|
|
25
|
-
containerProps:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
containerProps: {
|
|
27
|
+
defaultValue<T = unknown>(arg: T): {
|
|
28
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
29
|
+
};
|
|
30
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
31
|
+
};
|
|
32
|
+
name: {
|
|
33
|
+
defaultValue<T = unknown>(arg: T): {
|
|
34
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
35
|
+
};
|
|
36
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
37
|
+
};
|
|
38
|
+
style: {
|
|
39
|
+
defaultValue<T = unknown>(arg: T): {
|
|
40
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
41
|
+
};
|
|
42
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
43
|
+
};
|
|
44
|
+
date: {
|
|
45
|
+
defaultValue<T = unknown>(arg: T): {
|
|
46
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
47
|
+
};
|
|
48
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
49
|
+
};
|
|
50
|
+
type: {
|
|
51
|
+
defaultValue<T = unknown>(arg: T): {
|
|
52
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
53
|
+
};
|
|
54
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
55
|
+
};
|
|
56
|
+
content: {
|
|
57
|
+
defaultValue<T = unknown>(arg: T): {
|
|
58
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
59
|
+
};
|
|
60
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
61
|
+
};
|
|
62
|
+
options: {
|
|
63
|
+
defaultValue<T = unknown>(arg: T): {
|
|
64
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
65
|
+
};
|
|
66
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
67
|
+
};
|
|
68
|
+
selection: {
|
|
69
|
+
defaultValue<T = unknown>(arg: T): {
|
|
70
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
71
|
+
};
|
|
72
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
73
|
+
};
|
|
74
|
+
customDropdownMenuProps: {
|
|
75
|
+
defaultValue<T = unknown>(arg: T): {
|
|
76
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
77
|
+
};
|
|
78
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
79
|
+
};
|
|
80
|
+
borderBottom: {
|
|
81
|
+
defaultValue<T = unknown>(arg: T): {
|
|
82
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
83
|
+
};
|
|
84
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
85
|
+
};
|
|
86
|
+
dateFormat: {
|
|
87
|
+
defaultValue<T = unknown>(arg: T): {
|
|
88
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
89
|
+
};
|
|
90
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
91
|
+
};
|
|
92
|
+
timeFormat: {
|
|
93
|
+
defaultValue<T = unknown>(arg: T): {
|
|
94
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
95
|
+
};
|
|
96
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
97
|
+
};
|
|
98
|
+
maxLines: {
|
|
99
|
+
defaultValue<T = unknown>(arg: T): {
|
|
100
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
101
|
+
};
|
|
102
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
103
|
+
};
|
|
38
104
|
};
|
|
39
105
|
};
|
|
40
106
|
};
|
package/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference path="../../../../shared/typings/react-desc.d.ts" />
|
|
1
2
|
/// <reference types="react" />
|
|
2
3
|
import { DSCommentCardWithSchema } from './components/DSComments';
|
|
3
4
|
export declare const DSCommentCard: {
|
|
@@ -21,19 +22,84 @@ export declare const DSCommentCard: {
|
|
|
21
22
|
maxLines?: number | undefined;
|
|
22
23
|
}): JSX.Element;
|
|
23
24
|
propTypes: {
|
|
24
|
-
containerProps:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
25
|
+
containerProps: {
|
|
26
|
+
defaultValue<T = unknown>(arg: T): {
|
|
27
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
28
|
+
};
|
|
29
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
30
|
+
};
|
|
31
|
+
name: {
|
|
32
|
+
defaultValue<T = unknown>(arg: T): {
|
|
33
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
34
|
+
};
|
|
35
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
36
|
+
};
|
|
37
|
+
style: {
|
|
38
|
+
defaultValue<T = unknown>(arg: T): {
|
|
39
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
40
|
+
};
|
|
41
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
42
|
+
};
|
|
43
|
+
date: {
|
|
44
|
+
defaultValue<T = unknown>(arg: T): {
|
|
45
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
46
|
+
};
|
|
47
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
48
|
+
};
|
|
49
|
+
type: {
|
|
50
|
+
defaultValue<T = unknown>(arg: T): {
|
|
51
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
52
|
+
};
|
|
53
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
54
|
+
};
|
|
55
|
+
content: {
|
|
56
|
+
defaultValue<T = unknown>(arg: T): {
|
|
57
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
58
|
+
};
|
|
59
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
60
|
+
};
|
|
61
|
+
options: {
|
|
62
|
+
defaultValue<T = unknown>(arg: T): {
|
|
63
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
64
|
+
};
|
|
65
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
66
|
+
};
|
|
67
|
+
selection: {
|
|
68
|
+
defaultValue<T = unknown>(arg: T): {
|
|
69
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
70
|
+
};
|
|
71
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
72
|
+
};
|
|
73
|
+
customDropdownMenuProps: {
|
|
74
|
+
defaultValue<T = unknown>(arg: T): {
|
|
75
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
76
|
+
};
|
|
77
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
78
|
+
};
|
|
79
|
+
borderBottom: {
|
|
80
|
+
defaultValue<T = unknown>(arg: T): {
|
|
81
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
82
|
+
};
|
|
83
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
84
|
+
};
|
|
85
|
+
dateFormat: {
|
|
86
|
+
defaultValue<T = unknown>(arg: T): {
|
|
87
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
88
|
+
};
|
|
89
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
90
|
+
};
|
|
91
|
+
timeFormat: {
|
|
92
|
+
defaultValue<T = unknown>(arg: T): {
|
|
93
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
94
|
+
};
|
|
95
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
96
|
+
};
|
|
97
|
+
maxLines: {
|
|
98
|
+
defaultValue<T = unknown>(arg: T): {
|
|
99
|
+
deprecated: import("react-desc").PropTypesDescValidator;
|
|
100
|
+
};
|
|
101
|
+
isRequired: import("react-desc").PropTypesDescValidator;
|
|
102
|
+
};
|
|
37
103
|
};
|
|
38
104
|
};
|
|
39
105
|
export default DSCommentCard;
|
package/cjs/package.json
DELETED