@elliemae/ds-comments 2.2.0-alpha.4 → 3.0.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,118 +1,150 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var CommentCard_exports = {};
29
- __export(CommentCard_exports, {
30
- DSCommentCardWithSchema: () => DSCommentCardWithSchema,
31
- default: () => CommentCard_default
32
- });
33
- var React = __toESM(require("react"));
34
- var import_react = __toESM(require("react"));
35
- var import_react_desc = require("react-desc");
36
- var import_ds_button = __toESM(require("@elliemae/ds-button"));
37
- var import_ds_read_more = require("@elliemae/ds-read-more");
38
- var import_ds_dropdownmenu = __toESM(require("@elliemae/ds-dropdownmenu"));
39
- var import_ds_icons = require("@elliemae/ds-icons");
40
- var import_blocks = require("./blocks");
41
- var import_helper = require("./helper");
42
- const CommentCard = ({
43
- containerProps = {},
44
- name = "",
45
- date = new Date(),
46
- type = "",
47
- content = "",
48
- style = {},
49
- options = [],
50
- selection = { "single-selection-internal-external": ["set-as-internal"] },
51
- customDropdownMenuProps = {
52
- focusOnOpen: true
53
- },
54
- borderBottom,
55
- dateFormat = "MM/DD/YYYY",
56
- timeFormat = "hh:mm a",
57
- maxLines = 2
58
- }) => {
59
- const ref = (0, import_react.useRef)();
60
- const displayDate = date ? (0, import_helper.getDisplayDate)(date, dateFormat) : null;
61
- const displayTime = date ? (0, import_helper.getTime)(date, timeFormat) : null;
62
- const handleCloseMenu = (0, import_react.useCallback)(() => {
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
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');
10
+ var _jsx = require('@babel/runtime/helpers/jsx');
11
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
12
+ var react = require('react');
13
+ var reactDesc = require('react-desc');
14
+ var DSButton = require('@elliemae/ds-button');
15
+ var dsReadMore = require('@elliemae/ds-read-more');
16
+ var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
17
+ var dsIcons = require('@elliemae/ds-icons');
18
+ var blocks = require('./blocks.js');
19
+ var helper = require('./helper.js');
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 _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
25
+ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
26
+ var DSButton__default = /*#__PURE__*/_interopDefaultLegacy(DSButton);
27
+ var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
28
+
29
+ var _span, _span2, _MoreOptionsVert;
30
+
31
+ 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; }
32
+
33
+ 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; }
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(() => {
63
59
  ref.current.focus();
64
60
  }, []);
65
- return /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardWrapper, {
66
- classProps: { borderBottom },
67
- tabIndex: 0,
68
- ...containerProps,
69
- style: { ...style, ...containerProps.style || {} }
70
- }, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardHeader, {
71
- classProps: { borderBottom }
72
- }, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardLeft, null, /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardName, null, name), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardMenu, null, /* @__PURE__ */ import_react.default.createElement(import_ds_dropdownmenu.default, {
73
- ...customDropdownMenuProps,
74
- onClose: handleCloseMenu,
75
- options,
76
- selection,
77
- triggerComponent: /* @__PURE__ */ import_react.default.createElement(import_ds_button.default, {
61
+ return /*#__PURE__*/jsxRuntime.jsxs(blocks.CommentCardWrapper, _objectSpread(_objectSpread({
62
+ classProps: {
63
+ borderBottom
64
+ },
65
+ tabIndex: 0
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",
78
92
  buttonType: "text",
79
- icon: /* @__PURE__ */ import_react.default.createElement(import_ds_icons.MoreOptionsVert, null),
80
- innerRef: ref
81
- }),
82
- zIndex: "11"
83
- }))), /* @__PURE__ */ import_react.default.createElement(import_blocks.CommentCardContent, null, /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_ds_read_more.DSReadMore, {
84
- lines: maxLines,
85
- content: `${content} `,
86
- more: "MORE",
87
- less: "LESS",
88
- buttonType: "text",
89
- size: "m",
90
- ellipsis: "... "
91
- }))));
93
+ size: "m",
94
+ ellipsis: "... "
95
+ })))]
96
+ }));
92
97
  };
98
+
93
99
  const props = {
94
- containerProps: import_react_desc.PropTypes.shape({
95
- id: import_react_desc.PropTypes.string,
96
- "data-testid": import_react_desc.PropTypes.string
97
- }).description("props to inject to comment card wrapper"),
98
- name: import_react_desc.PropTypes.string.description("form name"),
99
- style: import_react_desc.PropTypes.object.description(" style object "),
100
- date: import_react_desc.PropTypes.instanceOf(Date).description("date object"),
101
- type: import_react_desc.PropTypes.string.description("comment type string"),
102
- content: import_react_desc.PropTypes.string.description("comment content"),
103
- options: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.object).description("dropdown menu options"),
104
- selection: import_react_desc.PropTypes.object.description("dropdown selection"),
105
- customDropdownMenuProps: import_react_desc.PropTypes.shape({
106
- focusOnOpen: import_react_desc.PropTypes.bool
107
- }).description("pass down props to dropdown"),
108
- borderBottom: import_react_desc.PropTypes.bool.description("toggle border bottom for card"),
109
- dateFormat: import_react_desc.PropTypes.oneOf(["MM/DD/YYYY", "MM DD YYYY"]).description("moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/"),
110
- timeFormat: import_react_desc.PropTypes.oneOf(["hh:mm a", "HH:mm"]).description("moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/"),
111
- maxLines: import_react_desc.PropTypes.number.description("Max lines")
100
+ /** props to inject to comment card wrapper */
101
+ containerProps: reactDesc.PropTypes.shape({
102
+ id: reactDesc.PropTypes.string,
103
+ 'data-testid': reactDesc.PropTypes.string
104
+ }).description('props to inject to comment card wrapper'),
105
+
106
+ /** form name */
107
+ name: reactDesc.PropTypes.string.description('form name'),
108
+
109
+ /** style object */
110
+ style: reactDesc.PropTypes.object.description(' style object '),
111
+
112
+ /** date object */
113
+ date: reactDesc.PropTypes.instanceOf(Date).description('date object'),
114
+
115
+ /** comment type string */
116
+ type: reactDesc.PropTypes.string.description('comment type string'),
117
+
118
+ /** comment content */
119
+ content: reactDesc.PropTypes.string.description('comment content'),
120
+
121
+ /** dropdown menu options */
122
+ options: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.object).description('dropdown menu options'),
123
+
124
+ /** dropdown selection */
125
+ selection: reactDesc.PropTypes.object.description('dropdown selection'),
126
+
127
+ /** pass down props to dropdown */
128
+ customDropdownMenuProps: reactDesc.PropTypes.shape({
129
+ focusOnOpen: reactDesc.PropTypes.bool
130
+ }).description('pass down props to dropdown'),
131
+
132
+ /** toggle border bottom for card */
133
+ borderBottom: reactDesc.PropTypes.bool.description('toggle border bottom for card'),
134
+
135
+ /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
136
+ dateFormat: reactDesc.PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description('moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/'),
137
+
138
+ /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */
139
+ timeFormat: reactDesc.PropTypes.oneOf(['hh:mm a', 'HH:mm']).description('moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/'),
140
+
141
+ /**
142
+ * Max lines
143
+ */
144
+ maxLines: reactDesc.PropTypes.number.description('Max lines')
112
145
  };
113
- CommentCard.propTypes = props;
114
- const DSCommentCardWithSchema = (0, import_react_desc.describe)(CommentCard);
146
+ const DSCommentCardWithSchema = reactDesc.describe(CommentCard);
115
147
  DSCommentCardWithSchema.propTypes = props;
116
- var CommentCard_default = CommentCard;
117
- module.exports = __toCommonJS(CommentCard_exports);
118
- //# sourceMappingURL=CommentCard.js.map
148
+
149
+ exports.DSCommentCardWithSchema = DSCommentCardWithSchema;
150
+ exports["default"] = CommentCard;
@@ -1,39 +1,12 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var DSComments_exports = {};
29
- __export(DSComments_exports, {
30
- DSCommentCardWithSchema: () => import_CommentCard.DSCommentCardWithSchema,
31
- default: () => DSComments_default
32
- });
33
- var React = __toESM(require("react"));
34
- var import_CommentCard = __toESM(require("./CommentCard"));
35
- var DSComments_default = {
36
- DSCommentCard: import_CommentCard.default
37
- };
38
- module.exports = __toCommonJS(DSComments_exports);
39
- //# sourceMappingURL=DSComments.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var CommentCard = require('./CommentCard.js');
6
+
7
+ var DSComments = {
8
+ DSCommentCard: CommentCard["default"]
9
+ };
10
+
11
+ exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
12
+ exports["default"] = DSComments;
@@ -1,75 +1,72 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var dsClassnames = require('@elliemae/ds-classnames');
6
+
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
+ return {
14
+ hasScroll,
15
+ 'not-scroll': !hasScroll
26
16
  };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var blocks_exports = {};
29
- __export(blocks_exports, {
30
- CommentCardContent: () => CommentCardContent,
31
- CommentCardData: () => CommentCardData,
32
- CommentCardHeader: () => CommentCardHeader,
33
- CommentCardLeft: () => CommentCardLeft,
34
- CommentCardMenu: () => CommentCardMenu,
35
- CommentCardName: () => CommentCardName,
36
- CommentCardWrapper: () => CommentCardWrapper,
37
- CommentEmptyIcon: () => CommentEmptyIcon,
38
- CommentEmptyLabel: () => CommentEmptyLabel,
39
- CommentEmptyWrapper: () => CommentEmptyWrapper,
40
- Counter: () => Counter,
41
- SubmitButton: () => SubmitButton,
42
- SubmitExternal: () => SubmitExternal,
43
- SubmitWrapper: () => SubmitWrapper,
44
- WrapperArea: () => WrapperArea,
45
- WrapperComments: () => WrapperComments,
46
- WrapperCommentsScroll: () => WrapperCommentsScroll
47
17
  });
48
- var React = __toESM(require("react"));
49
- var import_ds_classnames = require("@elliemae/ds-classnames");
50
- const blockName = "comments";
51
- const WrapperArea = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "area", () => ({}));
52
- const WrapperComments = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comments", ({ hasScroll }) => ({
53
- hasScroll,
54
- "not-scroll": !hasScroll
55
- }));
56
- const WrapperCommentsScroll = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comments-scroll", ({ hasScroll }) => ({
57
- hasScroll,
58
- "not-scroll": !hasScroll
59
- }));
60
- const Counter = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "counter", () => ({}));
61
- const SubmitWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-wrapper", () => ({}));
62
- const SubmitExternal = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-external", () => ({}));
63
- const SubmitButton = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "submit-btn", () => ({}));
64
- const CommentCardWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-wrapper", ({ borderBottom }) => ({ borderBottom }));
65
- const CommentCardHeader = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-header", ({ borderBottom }) => ({ borderBottom }));
66
- const CommentCardContent = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-content", () => ({}));
67
- const CommentCardLeft = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-left", () => ({}));
68
- const CommentCardName = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-name", () => ({}));
69
- const CommentCardData = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-data", () => ({}));
70
- const CommentCardMenu = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-card-menu", () => ({}));
71
- const CommentEmptyWrapper = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty", () => ({}));
72
- const CommentEmptyIcon = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty-icon", () => ({}));
73
- const CommentEmptyLabel = (0, import_ds_classnames.aggregatedClasses)("div")(blockName, "comment-empty-label", () => ({}));
74
- module.exports = __toCommonJS(blocks_exports);
75
- //# sourceMappingURL=blocks.js.map
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
+ });
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;
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
+ });
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', () => ({}));
55
+
56
+ exports.CommentCardContent = CommentCardContent;
57
+ exports.CommentCardData = CommentCardData;
58
+ exports.CommentCardHeader = CommentCardHeader;
59
+ exports.CommentCardLeft = CommentCardLeft;
60
+ exports.CommentCardMenu = CommentCardMenu;
61
+ exports.CommentCardName = CommentCardName;
62
+ exports.CommentCardWrapper = CommentCardWrapper;
63
+ exports.CommentEmptyIcon = CommentEmptyIcon;
64
+ exports.CommentEmptyLabel = CommentEmptyLabel;
65
+ exports.CommentEmptyWrapper = CommentEmptyWrapper;
66
+ exports.Counter = Counter;
67
+ exports.SubmitButton = SubmitButton;
68
+ exports.SubmitExternal = SubmitExternal;
69
+ exports.SubmitWrapper = SubmitWrapper;
70
+ exports.WrapperArea = WrapperArea;
71
+ exports.WrapperComments = WrapperComments;
72
+ exports.WrapperCommentsScroll = WrapperCommentsScroll;
@@ -1,46 +1,25 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var helper_exports = {};
29
- __export(helper_exports, {
30
- getDisplayDate: () => getDisplayDate,
31
- getMaxSize: () => getMaxSize,
32
- getTime: () => getTime
33
- });
34
- var React = __toESM(require("react"));
35
- var import_moment = __toESM(require("moment"));
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var moment = require('moment');
6
+
7
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
+
9
+ var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
10
+
36
11
  function getMaxSize() {
37
12
  return 113;
38
13
  }
39
- function getTime(date, formatString = "hh:mm a") {
40
- return (0, import_moment.default)(date).format(formatString);
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);
41
17
  }
42
- function getDisplayDate(date, formatString = "MM/DD/YYYY") {
43
- return (0, import_moment.default)(date).format(formatString);
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);
44
21
  }
45
- module.exports = __toCommonJS(helper_exports);
46
- //# sourceMappingURL=helper.js.map
22
+
23
+ exports.getDisplayDate = getDisplayDate;
24
+ exports.getMaxSize = getMaxSize;
25
+ exports.getTime = getTime;
package/cjs/index.js CHANGED
@@ -1,39 +1,14 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var src_exports = {};
29
- __export(src_exports, {
30
- DSCommentCard: () => DSCommentCard,
31
- DSCommentCardWithSchema: () => import_DSComments.DSCommentCardWithSchema,
32
- default: () => src_default
33
- });
34
- var React = __toESM(require("react"));
35
- var import_DSComments = __toESM(require("./components/DSComments"));
36
- const { DSCommentCard } = import_DSComments.default;
37
- var src_default = DSCommentCard;
38
- module.exports = __toCommonJS(src_exports);
39
- //# sourceMappingURL=index.js.map
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var DSComments = require('./components/DSComments.js');
6
+ var CommentCard = require('./components/CommentCard.js');
7
+
8
+ const {
9
+ DSCommentCard
10
+ } = DSComments["default"];
11
+
12
+ exports.DSCommentCardWithSchema = CommentCard.DSCommentCardWithSchema;
13
+ exports.DSCommentCard = DSCommentCard;
14
+ exports["default"] = DSCommentCard;
@@ -1,97 +1,138 @@
1
- import * as React from "react";
2
- import React2, { useCallback, useRef } from "react";
3
- import { PropTypes, describe } from "react-desc";
4
- import DSButton from "@elliemae/ds-button";
5
- import { DSReadMore } from "@elliemae/ds-read-more";
6
- import DSDropdownMenu from "@elliemae/ds-dropdownmenu";
7
- import { MoreOptionsVert } from "@elliemae/ds-icons";
8
- import {
9
- CommentCardWrapper,
10
- CommentCardHeader,
11
- CommentCardContent,
12
- CommentCardName,
13
- CommentCardData,
14
- CommentCardMenu,
15
- CommentCardLeft
16
- } from "./blocks";
17
- import { getTime, getDisplayDate } from "./helper";
18
- const CommentCard = ({
19
- containerProps = {},
20
- name = "",
21
- date = new Date(),
22
- type = "",
23
- content = "",
24
- style = {},
25
- options = [],
26
- selection = { "single-selection-internal-external": ["set-as-internal"] },
27
- customDropdownMenuProps = {
28
- focusOnOpen: true
29
- },
30
- borderBottom,
31
- dateFormat = "MM/DD/YYYY",
32
- timeFormat = "hh:mm a",
33
- maxLines = 2
34
- }) => {
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';
7
+ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
8
+ import { useRef, useCallback } from 'react';
9
+ import { PropTypes, describe } from 'react-desc';
10
+ import DSButton from '@elliemae/ds-button';
11
+ import { DSReadMore } from '@elliemae/ds-read-more';
12
+ import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
13
+ import { MoreOptionsVert } from '@elliemae/ds-icons';
14
+ import { CommentCardWrapper, CommentCardHeader, CommentCardLeft, CommentCardName, CommentCardData, CommentCardMenu, CommentCardContent } from './blocks.js';
15
+ import { getDisplayDate, getTime } from './helper.js';
16
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
17
+
18
+ var _span, _span2, _MoreOptionsVert;
19
+
20
+ 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; }
21
+
22
+ 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; }
23
+
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;
35
44
  const ref = useRef();
36
45
  const displayDate = date ? getDisplayDate(date, dateFormat) : null;
37
46
  const displayTime = date ? getTime(date, timeFormat) : null;
38
47
  const handleCloseMenu = useCallback(() => {
39
48
  ref.current.focus();
40
49
  }, []);
41
- return /* @__PURE__ */ React2.createElement(CommentCardWrapper, {
42
- classProps: { borderBottom },
43
- tabIndex: 0,
44
- ...containerProps,
45
- style: { ...style, ...containerProps.style || {} }
46
- }, /* @__PURE__ */ React2.createElement(CommentCardHeader, {
47
- classProps: { borderBottom }
48
- }, /* @__PURE__ */ React2.createElement(CommentCardLeft, null, /* @__PURE__ */ React2.createElement(CommentCardName, null, name), /* @__PURE__ */ React2.createElement(CommentCardData, null, displayDate, displayTime && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), displayTime), type && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", null, "\u2022"), type))), options && options.length > 0 && /* @__PURE__ */ React2.createElement(CommentCardMenu, null, /* @__PURE__ */ React2.createElement(DSDropdownMenu, {
49
- ...customDropdownMenuProps,
50
- onClose: handleCloseMenu,
51
- options,
52
- selection,
53
- triggerComponent: /* @__PURE__ */ React2.createElement(DSButton, {
50
+ return /*#__PURE__*/jsxs(CommentCardWrapper, _objectSpread(_objectSpread({
51
+ classProps: {
52
+ borderBottom
53
+ },
54
+ tabIndex: 0
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",
54
81
  buttonType: "text",
55
- icon: /* @__PURE__ */ React2.createElement(MoreOptionsVert, null),
56
- innerRef: ref
57
- }),
58
- zIndex: "11"
59
- }))), /* @__PURE__ */ React2.createElement(CommentCardContent, null, /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(DSReadMore, {
60
- lines: maxLines,
61
- content: `${content} `,
62
- more: "MORE",
63
- less: "LESS",
64
- buttonType: "text",
65
- size: "m",
66
- ellipsis: "... "
67
- }))));
82
+ size: "m",
83
+ ellipsis: "... "
84
+ })))]
85
+ }));
68
86
  };
87
+
69
88
  const props = {
89
+ /** props to inject to comment card wrapper */
70
90
  containerProps: PropTypes.shape({
71
91
  id: PropTypes.string,
72
- "data-testid": PropTypes.string
73
- }).description("props to inject to comment card wrapper"),
74
- name: PropTypes.string.description("form name"),
75
- style: PropTypes.object.description(" style object "),
76
- date: PropTypes.instanceOf(Date).description("date object"),
77
- type: PropTypes.string.description("comment type string"),
78
- content: PropTypes.string.description("comment content"),
79
- options: PropTypes.arrayOf(PropTypes.object).description("dropdown menu options"),
80
- selection: PropTypes.object.description("dropdown selection"),
92
+ 'data-testid': PropTypes.string
93
+ }).description('props to inject to comment card wrapper'),
94
+
95
+ /** form name */
96
+ name: PropTypes.string.description('form name'),
97
+
98
+ /** style object */
99
+ style: PropTypes.object.description(' style object '),
100
+
101
+ /** date object */
102
+ date: PropTypes.instanceOf(Date).description('date object'),
103
+
104
+ /** comment type string */
105
+ type: PropTypes.string.description('comment type string'),
106
+
107
+ /** comment content */
108
+ content: PropTypes.string.description('comment content'),
109
+
110
+ /** dropdown menu options */
111
+ options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),
112
+
113
+ /** dropdown selection */
114
+ selection: PropTypes.object.description('dropdown selection'),
115
+
116
+ /** pass down props to dropdown */
81
117
  customDropdownMenuProps: PropTypes.shape({
82
118
  focusOnOpen: PropTypes.bool
83
- }).description("pass down props to dropdown"),
84
- borderBottom: PropTypes.bool.description("toggle border bottom for card"),
85
- dateFormat: PropTypes.oneOf(["MM/DD/YYYY", "MM DD YYYY"]).description("moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/"),
86
- timeFormat: PropTypes.oneOf(["hh:mm a", "HH:mm"]).description("moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/"),
87
- maxLines: PropTypes.number.description("Max lines")
119
+ }).description('pass down props to dropdown'),
120
+
121
+ /** toggle border bottom for card */
122
+ borderBottom: PropTypes.bool.description('toggle border bottom for card'),
123
+
124
+ /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */
125
+ dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description('moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/'),
126
+
127
+ /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */
128
+ timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description('moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/'),
129
+
130
+ /**
131
+ * Max lines
132
+ */
133
+ maxLines: PropTypes.number.description('Max lines')
88
134
  };
89
- CommentCard.propTypes = props;
90
135
  const DSCommentCardWithSchema = describe(CommentCard);
91
136
  DSCommentCardWithSchema.propTypes = props;
92
- var CommentCard_default = CommentCard;
93
- export {
94
- DSCommentCardWithSchema,
95
- CommentCard_default as default
96
- };
97
- //# sourceMappingURL=CommentCard.js.map
137
+
138
+ export { DSCommentCardWithSchema, CommentCard as default };
@@ -1,10 +1,8 @@
1
- import * as React from "react";
2
- import DSCommentCard, { DSCommentCardWithSchema } from "./CommentCard";
3
- var DSComments_default = {
4
- DSCommentCard
1
+ import CommentCard from './CommentCard.js';
2
+ export { DSCommentCardWithSchema } from './CommentCard.js';
3
+
4
+ var DSComments = {
5
+ DSCommentCard: CommentCard
5
6
  };
6
- export {
7
- DSCommentCardWithSchema,
8
- DSComments_default as default
9
- };
10
- //# sourceMappingURL=DSComments.js.map
7
+
8
+ export { DSComments as default };
@@ -1,46 +1,52 @@
1
- import * as React from "react";
2
- import { aggregatedClasses } from "@elliemae/ds-classnames";
3
- const blockName = "comments";
4
- const WrapperArea = aggregatedClasses("div")(blockName, "area", () => ({}));
5
- const WrapperComments = aggregatedClasses("div")(blockName, "comments", ({ hasScroll }) => ({
6
- hasScroll,
7
- "not-scroll": !hasScroll
8
- }));
9
- const WrapperCommentsScroll = aggregatedClasses("div")(blockName, "comments-scroll", ({ hasScroll }) => ({
10
- hasScroll,
11
- "not-scroll": !hasScroll
12
- }));
13
- const Counter = aggregatedClasses("div")(blockName, "counter", () => ({}));
14
- const SubmitWrapper = aggregatedClasses("div")(blockName, "submit-wrapper", () => ({}));
15
- const SubmitExternal = aggregatedClasses("div")(blockName, "submit-external", () => ({}));
16
- const SubmitButton = aggregatedClasses("div")(blockName, "submit-btn", () => ({}));
17
- const CommentCardWrapper = aggregatedClasses("div")(blockName, "comment-card-wrapper", ({ borderBottom }) => ({ borderBottom }));
18
- const CommentCardHeader = aggregatedClasses("div")(blockName, "comment-card-header", ({ borderBottom }) => ({ borderBottom }));
19
- const CommentCardContent = aggregatedClasses("div")(blockName, "comment-card-content", () => ({}));
20
- const CommentCardLeft = aggregatedClasses("div")(blockName, "comment-card-left", () => ({}));
21
- const CommentCardName = aggregatedClasses("div")(blockName, "comment-card-name", () => ({}));
22
- const CommentCardData = aggregatedClasses("div")(blockName, "comment-card-data", () => ({}));
23
- const CommentCardMenu = aggregatedClasses("div")(blockName, "comment-card-menu", () => ({}));
24
- const CommentEmptyWrapper = aggregatedClasses("div")(blockName, "comment-empty", () => ({}));
25
- const CommentEmptyIcon = aggregatedClasses("div")(blockName, "comment-empty-icon", () => ({}));
26
- const CommentEmptyLabel = aggregatedClasses("div")(blockName, "comment-empty-label", () => ({}));
27
- export {
28
- CommentCardContent,
29
- CommentCardData,
30
- CommentCardHeader,
31
- CommentCardLeft,
32
- CommentCardMenu,
33
- CommentCardName,
34
- CommentCardWrapper,
35
- CommentEmptyIcon,
36
- CommentEmptyLabel,
37
- CommentEmptyWrapper,
38
- Counter,
39
- SubmitButton,
40
- SubmitExternal,
41
- SubmitWrapper,
42
- WrapperArea,
43
- WrapperComments,
44
- WrapperCommentsScroll
45
- };
46
- //# sourceMappingURL=blocks.js.map
1
+ import { aggregatedClasses } from '@elliemae/ds-classnames';
2
+
3
+ const blockName = 'comments';
4
+ const WrapperArea = aggregatedClasses('div')(blockName, 'area', () => ({}));
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
+ });
23
+ const Counter = aggregatedClasses('div')(blockName, 'counter', () => ({}));
24
+ const SubmitWrapper = aggregatedClasses('div')(blockName, 'submit-wrapper', () => ({}));
25
+ const SubmitExternal = aggregatedClasses('div')(blockName, 'submit-external', () => ({}));
26
+ const SubmitButton = aggregatedClasses('div')(blockName, 'submit-btn', () => ({}));
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
+ });
43
+ const CommentCardContent = aggregatedClasses('div')(blockName, 'comment-card-content', () => ({}));
44
+ const CommentCardLeft = aggregatedClasses('div')(blockName, 'comment-card-left', () => ({}));
45
+ const CommentCardName = aggregatedClasses('div')(blockName, 'comment-card-name', () => ({}));
46
+ const CommentCardData = aggregatedClasses('div')(blockName, 'comment-card-data', () => ({}));
47
+ const CommentCardMenu = aggregatedClasses('div')(blockName, 'comment-card-menu', () => ({}));
48
+ const CommentEmptyWrapper = aggregatedClasses('div')(blockName, 'comment-empty', () => ({}));
49
+ const CommentEmptyIcon = aggregatedClasses('div')(blockName, 'comment-empty-icon', () => ({}));
50
+ const CommentEmptyLabel = aggregatedClasses('div')(blockName, 'comment-empty-label', () => ({}));
51
+
52
+ export { CommentCardContent, CommentCardData, CommentCardHeader, CommentCardLeft, CommentCardMenu, CommentCardName, CommentCardWrapper, CommentEmptyIcon, CommentEmptyLabel, CommentEmptyWrapper, Counter, SubmitButton, SubmitExternal, SubmitWrapper, WrapperArea, WrapperComments, WrapperCommentsScroll };
@@ -1,17 +1,15 @@
1
- import * as React from "react";
2
- import moment from "moment";
1
+ import moment from 'moment';
2
+
3
3
  function getMaxSize() {
4
4
  return 113;
5
5
  }
6
- function getTime(date, formatString = "hh:mm a") {
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, formatString = "MM/DD/YYYY") {
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
- export {
13
- getDisplayDate,
14
- getMaxSize,
15
- getTime
16
- };
17
- //# sourceMappingURL=helper.js.map
14
+
15
+ export { getDisplayDate, getMaxSize, getTime };
package/esm/index.js CHANGED
@@ -1,10 +1,8 @@
1
- import * as React from "react";
2
- import DSComments, { DSCommentCardWithSchema } from "./components/DSComments";
3
- const { DSCommentCard } = DSComments;
4
- var src_default = DSCommentCard;
5
- export {
6
- DSCommentCard,
7
- DSCommentCardWithSchema,
8
- src_default as default
9
- };
10
- //# sourceMappingURL=index.js.map
1
+ import DSComments from './components/DSComments.js';
2
+ export { DSCommentCardWithSchema } from './components/CommentCard.js';
3
+
4
+ const {
5
+ DSCommentCard
6
+ } = DSComments;
7
+
8
+ export { DSCommentCard, DSCommentCard as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-comments",
3
- "version": "2.2.0-alpha.4",
3
+ "version": "3.0.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Comments",
6
6
  "module": "./esm/index.js",
@@ -48,11 +48,11 @@
48
48
  "build": "node ../../scripts/build/build.js"
49
49
  },
50
50
  "dependencies": {
51
- "@elliemae/ds-button": "2.2.0-alpha.4",
52
- "@elliemae/ds-classnames": "2.2.0-alpha.4",
53
- "@elliemae/ds-dropdownmenu": "2.2.0-alpha.4",
54
- "@elliemae/ds-icons": "2.2.0-alpha.4",
55
- "@elliemae/ds-read-more": "2.2.0-alpha.4",
51
+ "@elliemae/ds-button": "3.0.0-next.2",
52
+ "@elliemae/ds-classnames": "3.0.0-next.2",
53
+ "@elliemae/ds-dropdownmenu": "3.0.0-next.2",
54
+ "@elliemae/ds-icons": "3.0.0-next.2",
55
+ "@elliemae/ds-read-more": "3.0.0-next.2",
56
56
  "moment": "~2.29.1",
57
57
  "prop-types": "~15.7.2",
58
58
  "react-desc": "~4.1.3"
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/CommentCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex=\"11\" // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n};\n\nCommentCard.propTypes = props;\n\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA2C;AAC3C,wBAAoC;AACpC,uBAAqB;AACrB,0BAA2B;AAC3B,6BAA2B;AAC3B,sBAAgC;AAChC,oBAQO;AACP,oBAAwC;AAExC,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,OAAO,IAAI;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY,EAAE,sCAAsC,CAAC;AAAA,EACrD,0BAA0B;AAAA,IACxB,aAAa;AAAA;AAAA,EAEf;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,MACP;AACJ,QAAM,MAAM;AACZ,QAAM,cAAc,OAAO,kCAAe,MAAM,cAAc;AAC9D,QAAM,cAAc,OAAO,2BAAQ,MAAM,cAAc;AAEvD,QAAM,kBAAkB,8BAAY,MAAM;AACxC,QAAI,QAAQ;AAAA,KACX;AAEH,SACE,mDAAC,kCAAD;AAAA,IACE,YAAY,EAAE;AAAA,IACd,UAAU;AAAA,OACN;AAAA,IACJ,OAAO,KAAK,UAAW,eAAe,SAAS;AAAA,KAE/C,mDAAC,iCAAD;AAAA,IAAmB,YAAY,EAAE;AAAA,KAC/B,mDAAC,+BAAD,MACE,mDAAC,+BAAD,MAAkB,OAClB,mDAAC,+BAAD,MACG,aACA,eACC,wFACE,mDAAC,QAAD,MAAM,WACL,cAGJ,QACC,wFACE,mDAAC,QAAD,MAAM,WACL,SAKR,WAAW,QAAQ,SAAS,KAC3B,mDAAC,+BAAD,MACE,mDAAC,gCAAD;AAAA,OACM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,kBAAkB,mDAAC,0BAAD;AAAA,MAAU,YAAW;AAAA,MAAO,MAAM,mDAAC,iCAAD;AAAA,MAAqB,UAAU;AAAA;AAAA,IACnF,QAAO;AAAA,QAKf,mDAAC,kCAAD,MACE,mDAAC,OAAD,MACE,mDAAC,gCAAD;AAAA,IACE,OAAO;AAAA,IACP,SAAS,GAAG;AAAA,IACZ,MAAK;AAAA,IACL,MAAK;AAAA,IACL,YAAW;AAAA,IACX,MAAK;AAAA,IACL,UAAS;AAAA;AAAA;AAQrB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,4BAAU,MAAM;AAAA,IAC9B,IAAI,4BAAU;AAAA,IACd,eAAe,4BAAU;AAAA,KACxB,YAAY;AAAA,EAEf,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,OAAO,4BAAU,OAAO,YAAY;AAAA,EAEpC,MAAM,4BAAU,WAAW,MAAM,YAAY;AAAA,EAE7C,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,SAAS,4BAAU,OAAO,YAAY;AAAA,EAEtC,SAAS,4BAAU,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAEzD,WAAW,4BAAU,OAAO,YAAY;AAAA,EAExC,yBAAyB,4BAAU,MAAM;AAAA,IACvC,aAAa,4BAAU;AAAA,KACtB,YAAY;AAAA,EAEf,cAAc,4BAAU,KAAK,YAAY;AAAA,EAEzC,YAAY,4BAAU,MAAM,CAAC,cAAc,eAAe,YACxD;AAAA,EAGF,YAAY,4BAAU,MAAM,CAAC,WAAW,UAAU,YAChD;AAAA,EAKF,UAAU,4BAAU,OAAO,YAAY;AAAA;AAGzC,YAAY,YAAY;AAExB,MAAM,0BAA0B,gCAAS;AACzC,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/DSComments.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import DSCommentCard, { DSCommentCardWithSchema } from './CommentCard';\n\nexport default {\n DSCommentCard,\n};\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAuD;AAEvD,IAAO,qBAAQ;AAAA,EACb;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/blocks.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'comments';\n\nexport const WrapperArea = aggregatedClasses('div')(\n blockName,\n 'area',\n () => ({}),\n);\n\nexport const WrapperComments = aggregatedClasses('div')(\n blockName,\n 'comments',\n ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n }),\n);\n\nexport const WrapperCommentsScroll = aggregatedClasses('div')(\n blockName,\n 'comments-scroll',\n ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n }),\n);\n\nexport const Counter = aggregatedClasses('div')(\n blockName,\n 'counter',\n () => ({}),\n);\n\nexport const SubmitWrapper = aggregatedClasses('div')(\n blockName,\n 'submit-wrapper',\n () => ({}),\n);\n\nexport const SubmitExternal = aggregatedClasses('div')(\n blockName,\n 'submit-external',\n () => ({}),\n);\n\nexport const SubmitButton = aggregatedClasses('div')(\n blockName,\n 'submit-btn',\n () => ({}),\n);\n\nexport const CommentCardWrapper = aggregatedClasses('div')(\n blockName,\n 'comment-card-wrapper',\n ({ borderBottom }) => ({ borderBottom }),\n);\n\nexport const CommentCardHeader = aggregatedClasses('div')(\n blockName,\n 'comment-card-header',\n ({ borderBottom }) => ({ borderBottom }),\n);\n\nexport const CommentCardContent = aggregatedClasses('div')(\n blockName,\n 'comment-card-content',\n () => ({}),\n);\n\nexport const CommentCardLeft = aggregatedClasses('div')(\n blockName,\n 'comment-card-left',\n () => ({}),\n);\n\nexport const CommentCardName = aggregatedClasses('div')(\n blockName,\n 'comment-card-name',\n () => ({}),\n);\n\nexport const CommentCardData = aggregatedClasses('div')(\n blockName,\n 'comment-card-data',\n () => ({}),\n);\n\nexport const CommentCardMenu = aggregatedClasses('div')(\n blockName,\n 'comment-card-menu',\n () => ({}),\n);\n\nexport const CommentEmptyWrapper = aggregatedClasses('div')(\n blockName,\n 'comment-empty',\n () => ({}),\n);\n\nexport const CommentEmptyIcon = aggregatedClasses('div')(\n blockName,\n 'comment-empty-icon',\n () => ({}),\n);\n\nexport const CommentEmptyLabel = aggregatedClasses('div')(\n blockName,\n 'comment-empty-label',\n () => ({}),\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,2BAAkC;AAElC,MAAM,YAAY;AAEX,MAAM,cAAc,4CAAkB,OAC3C,WACA,QACA,MAAO;AAGF,MAAM,kBAAkB,4CAAkB,OAC/C,WACA,YACA,CAAC,EAAE,gBAAiB;AAAA,EAClB;AAAA,EACA,cAAc,CAAC;AAAA;AAIZ,MAAM,wBAAwB,4CAAkB,OACrD,WACA,mBACA,CAAC,EAAE,gBAAiB;AAAA,EAClB;AAAA,EACA,cAAc,CAAC;AAAA;AAIZ,MAAM,UAAU,4CAAkB,OACvC,WACA,WACA,MAAO;AAGF,MAAM,gBAAgB,4CAAkB,OAC7C,WACA,kBACA,MAAO;AAGF,MAAM,iBAAiB,4CAAkB,OAC9C,WACA,mBACA,MAAO;AAGF,MAAM,eAAe,4CAAkB,OAC5C,WACA,cACA,MAAO;AAGF,MAAM,qBAAqB,4CAAkB,OAClD,WACA,wBACA,CAAC,EAAE,mBAAoB,GAAE;AAGpB,MAAM,oBAAoB,4CAAkB,OACjD,WACA,uBACA,CAAC,EAAE,mBAAoB,GAAE;AAGpB,MAAM,qBAAqB,4CAAkB,OAClD,WACA,wBACA,MAAO;AAGF,MAAM,kBAAkB,4CAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,4CAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,4CAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,4CAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,sBAAsB,4CAAkB,OACnD,WACA,iBACA,MAAO;AAGF,MAAM,mBAAmB,4CAAkB,OAChD,WACA,sBACA,MAAO;AAGF,MAAM,oBAAoB,4CAAkB,OACjD,WACA,uBACA,MAAO;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/helper.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import moment from 'moment';\n\nexport function getMaxSize() {\n return 113;\n}\nexport function getTime(date, formatString = 'hh:mm a') {\n return moment(date).format(formatString);\n}\nexport function getDisplayDate(date, formatString = 'MM/DD/YYYY') {\n return moment(date).format(formatString);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAmB;AAEZ,sBAAsB;AAC3B,SAAO;AAAA;AAEF,iBAAiB,MAAM,eAAe,WAAW;AACtD,SAAO,2BAAO,MAAM,OAAO;AAAA;AAEtB,wBAAwB,MAAM,eAAe,cAAc;AAChE,SAAO,2BAAO,MAAM,OAAO;AAAA;",
6
- "names": []
7
- }
package/cjs/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import DSComments, { DSCommentCardWithSchema } from './components/DSComments';\n\nexport const { DSCommentCard } = DSComments;\nexport default DSCommentCard;\nexport { DSCommentCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAoD;AAE7C,MAAM,EAAE,kBAAkB;AACjC,IAAO,cAAQ;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/CommentCard.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\n/* eslint-disable max-lines */\nimport React, { useCallback, useRef } from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport DSButton from '@elliemae/ds-button';\nimport { DSReadMore } from '@elliemae/ds-read-more';\nimport DSDropdownMenu from '@elliemae/ds-dropdownmenu';\nimport { MoreOptionsVert } from '@elliemae/ds-icons';\nimport {\n CommentCardWrapper,\n CommentCardHeader,\n CommentCardContent,\n CommentCardName,\n CommentCardData,\n CommentCardMenu,\n CommentCardLeft,\n} from './blocks';\nimport { getTime, getDisplayDate } from './helper';\n\nconst CommentCard = ({\n containerProps = {},\n name = '',\n date = new Date(),\n type = '',\n content = '',\n style = {},\n options = [],\n selection = { 'single-selection-internal-external': ['set-as-internal'] },\n customDropdownMenuProps = {\n focusOnOpen: true,\n },\n borderBottom,\n dateFormat = 'MM/DD/YYYY',\n timeFormat = 'hh:mm a',\n maxLines = 2,\n}) => {\n const ref = useRef();\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const handleCloseMenu = useCallback(() => {\n ref.current.focus();\n }, []);\n\n return (\n <CommentCardWrapper\n classProps={{ borderBottom }}\n tabIndex={0}\n {...containerProps}\n style={{ ...style, ...(containerProps.style || {}) }}\n >\n <CommentCardHeader classProps={{ borderBottom }}>\n <CommentCardLeft>\n <CommentCardName>{name}</CommentCardName>\n <CommentCardData>\n {displayDate}\n {displayTime && (\n <>\n <span>\u2022</span>\n {displayTime}\n </>\n )}\n {type && (\n <>\n <span>\u2022</span>\n {type}\n </>\n )}\n </CommentCardData>\n </CommentCardLeft>\n {options && options.length > 0 && (\n <CommentCardMenu>\n <DSDropdownMenu\n {...customDropdownMenuProps}\n onClose={handleCloseMenu}\n options={options}\n selection={selection}\n triggerComponent={<DSButton buttonType=\"text\" icon={<MoreOptionsVert />} innerRef={ref} />}\n zIndex=\"11\" // https://jira.elliemae.io/browse/PUI-1664\n />\n </CommentCardMenu>\n )}\n </CommentCardHeader>\n <CommentCardContent>\n <div>\n <DSReadMore\n lines={maxLines}\n content={`${content} `}\n more=\"MORE\"\n less=\"LESS\"\n buttonType=\"text\"\n size=\"m\"\n ellipsis=\"... \"\n />\n </div>\n </CommentCardContent>\n </CommentCardWrapper>\n );\n};\n\nconst props = {\n /** props to inject to comment card wrapper */\n containerProps: PropTypes.shape({\n id: PropTypes.string,\n 'data-testid': PropTypes.string,\n }).description('props to inject to comment card wrapper'),\n /** form name */\n name: PropTypes.string.description('form name'),\n /** style object */\n style: PropTypes.object.description(' style object '),\n /** date object */\n date: PropTypes.instanceOf(Date).description('date object'),\n /** comment type string */\n type: PropTypes.string.description('comment type string'),\n /** comment content */\n content: PropTypes.string.description('comment content'),\n /** dropdown menu options */\n options: PropTypes.arrayOf(PropTypes.object).description('dropdown menu options'),\n /** dropdown selection */\n selection: PropTypes.object.description('dropdown selection'),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n }).description('pass down props to dropdown'),\n /** toggle border bottom for card */\n borderBottom: PropTypes.bool.description('toggle border bottom for card'),\n /** moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/ */\n dateFormat: PropTypes.oneOf(['MM/DD/YYYY', 'MM DD YYYY']).description(\n 'moment Year, month, and day tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /** moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/ */\n timeFormat: PropTypes.oneOf(['hh:mm a', 'HH:mm']).description(\n 'moment Hour, minute, second, millisecond, and offset tokens https://momentjs.com/docs/#/parsing/string-format/',\n ),\n /**\n * Max lines\n */\n maxLines: PropTypes.number.description('Max lines'),\n};\n\nCommentCard.propTypes = props;\n\nconst DSCommentCardWithSchema = describe(CommentCard);\nDSCommentCardWithSchema.propTypes = props;\n\nexport default CommentCard;\nexport { DSCommentCardWithSchema };\n"],
5
- "mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA;AAEA,MAAM,cAAc,CAAC;AAAA,EACnB,iBAAiB;AAAA,EACjB,OAAO;AAAA,EACP,OAAO,IAAI;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY,EAAE,sCAAsC,CAAC;AAAA,EACrD,0BAA0B;AAAA,IACxB,aAAa;AAAA;AAAA,EAEf;AAAA,EACA,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW;AAAA,MACP;AACJ,QAAM,MAAM;AACZ,QAAM,cAAc,OAAO,eAAe,MAAM,cAAc;AAC9D,QAAM,cAAc,OAAO,QAAQ,MAAM,cAAc;AAEvD,QAAM,kBAAkB,YAAY,MAAM;AACxC,QAAI,QAAQ;AAAA,KACX;AAEH,SACE,qCAAC,oBAAD;AAAA,IACE,YAAY,EAAE;AAAA,IACd,UAAU;AAAA,OACN;AAAA,IACJ,OAAO,KAAK,UAAW,eAAe,SAAS;AAAA,KAE/C,qCAAC,mBAAD;AAAA,IAAmB,YAAY,EAAE;AAAA,KAC/B,qCAAC,iBAAD,MACE,qCAAC,iBAAD,MAAkB,OAClB,qCAAC,iBAAD,MACG,aACA,eACC,4DACE,qCAAC,QAAD,MAAM,WACL,cAGJ,QACC,4DACE,qCAAC,QAAD,MAAM,WACL,SAKR,WAAW,QAAQ,SAAS,KAC3B,qCAAC,iBAAD,MACE,qCAAC,gBAAD;AAAA,OACM;AAAA,IACJ,SAAS;AAAA,IACT;AAAA,IACA;AAAA,IACA,kBAAkB,qCAAC,UAAD;AAAA,MAAU,YAAW;AAAA,MAAO,MAAM,qCAAC,iBAAD;AAAA,MAAqB,UAAU;AAAA;AAAA,IACnF,QAAO;AAAA,QAKf,qCAAC,oBAAD,MACE,qCAAC,OAAD,MACE,qCAAC,YAAD;AAAA,IACE,OAAO;AAAA,IACP,SAAS,GAAG;AAAA,IACZ,MAAK;AAAA,IACL,MAAK;AAAA,IACL,YAAW;AAAA,IACX,MAAK;AAAA,IACL,UAAS;AAAA;AAAA;AAQrB,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,MAAM;AAAA,IAC9B,IAAI,UAAU;AAAA,IACd,eAAe,UAAU;AAAA,KACxB,YAAY;AAAA,EAEf,MAAM,UAAU,OAAO,YAAY;AAAA,EAEnC,OAAO,UAAU,OAAO,YAAY;AAAA,EAEpC,MAAM,UAAU,WAAW,MAAM,YAAY;AAAA,EAE7C,MAAM,UAAU,OAAO,YAAY;AAAA,EAEnC,SAAS,UAAU,OAAO,YAAY;AAAA,EAEtC,SAAS,UAAU,QAAQ,UAAU,QAAQ,YAAY;AAAA,EAEzD,WAAW,UAAU,OAAO,YAAY;AAAA,EAExC,yBAAyB,UAAU,MAAM;AAAA,IACvC,aAAa,UAAU;AAAA,KACtB,YAAY;AAAA,EAEf,cAAc,UAAU,KAAK,YAAY;AAAA,EAEzC,YAAY,UAAU,MAAM,CAAC,cAAc,eAAe,YACxD;AAAA,EAGF,YAAY,UAAU,MAAM,CAAC,WAAW,UAAU,YAChD;AAAA,EAKF,UAAU,UAAU,OAAO,YAAY;AAAA;AAGzC,YAAY,YAAY;AAExB,MAAM,0BAA0B,SAAS;AACzC,wBAAwB,YAAY;AAEpC,IAAO,sBAAQ;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/DSComments.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import DSCommentCard, { DSCommentCardWithSchema } from './CommentCard';\n\nexport default {\n DSCommentCard,\n};\nexport { DSCommentCardWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AAEA,IAAO,qBAAQ;AAAA,EACb;AAAA;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/blocks.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'comments';\n\nexport const WrapperArea = aggregatedClasses('div')(\n blockName,\n 'area',\n () => ({}),\n);\n\nexport const WrapperComments = aggregatedClasses('div')(\n blockName,\n 'comments',\n ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n }),\n);\n\nexport const WrapperCommentsScroll = aggregatedClasses('div')(\n blockName,\n 'comments-scroll',\n ({ hasScroll }) => ({\n hasScroll,\n 'not-scroll': !hasScroll,\n }),\n);\n\nexport const Counter = aggregatedClasses('div')(\n blockName,\n 'counter',\n () => ({}),\n);\n\nexport const SubmitWrapper = aggregatedClasses('div')(\n blockName,\n 'submit-wrapper',\n () => ({}),\n);\n\nexport const SubmitExternal = aggregatedClasses('div')(\n blockName,\n 'submit-external',\n () => ({}),\n);\n\nexport const SubmitButton = aggregatedClasses('div')(\n blockName,\n 'submit-btn',\n () => ({}),\n);\n\nexport const CommentCardWrapper = aggregatedClasses('div')(\n blockName,\n 'comment-card-wrapper',\n ({ borderBottom }) => ({ borderBottom }),\n);\n\nexport const CommentCardHeader = aggregatedClasses('div')(\n blockName,\n 'comment-card-header',\n ({ borderBottom }) => ({ borderBottom }),\n);\n\nexport const CommentCardContent = aggregatedClasses('div')(\n blockName,\n 'comment-card-content',\n () => ({}),\n);\n\nexport const CommentCardLeft = aggregatedClasses('div')(\n blockName,\n 'comment-card-left',\n () => ({}),\n);\n\nexport const CommentCardName = aggregatedClasses('div')(\n blockName,\n 'comment-card-name',\n () => ({}),\n);\n\nexport const CommentCardData = aggregatedClasses('div')(\n blockName,\n 'comment-card-data',\n () => ({}),\n);\n\nexport const CommentCardMenu = aggregatedClasses('div')(\n blockName,\n 'comment-card-menu',\n () => ({}),\n);\n\nexport const CommentEmptyWrapper = aggregatedClasses('div')(\n blockName,\n 'comment-empty',\n () => ({}),\n);\n\nexport const CommentEmptyIcon = aggregatedClasses('div')(\n blockName,\n 'comment-empty-icon',\n () => ({}),\n);\n\nexport const CommentEmptyLabel = aggregatedClasses('div')(\n blockName,\n 'comment-empty-label',\n () => ({}),\n);\n"],
5
- "mappings": "AAAA;ACAA;AAEA,MAAM,YAAY;AAEX,MAAM,cAAc,kBAAkB,OAC3C,WACA,QACA,MAAO;AAGF,MAAM,kBAAkB,kBAAkB,OAC/C,WACA,YACA,CAAC,EAAE,gBAAiB;AAAA,EAClB;AAAA,EACA,cAAc,CAAC;AAAA;AAIZ,MAAM,wBAAwB,kBAAkB,OACrD,WACA,mBACA,CAAC,EAAE,gBAAiB;AAAA,EAClB;AAAA,EACA,cAAc,CAAC;AAAA;AAIZ,MAAM,UAAU,kBAAkB,OACvC,WACA,WACA,MAAO;AAGF,MAAM,gBAAgB,kBAAkB,OAC7C,WACA,kBACA,MAAO;AAGF,MAAM,iBAAiB,kBAAkB,OAC9C,WACA,mBACA,MAAO;AAGF,MAAM,eAAe,kBAAkB,OAC5C,WACA,cACA,MAAO;AAGF,MAAM,qBAAqB,kBAAkB,OAClD,WACA,wBACA,CAAC,EAAE,mBAAoB,GAAE;AAGpB,MAAM,oBAAoB,kBAAkB,OACjD,WACA,uBACA,CAAC,EAAE,mBAAoB,GAAE;AAGpB,MAAM,qBAAqB,kBAAkB,OAClD,WACA,wBACA,MAAO;AAGF,MAAM,kBAAkB,kBAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,kBAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,kBAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,kBAAkB,kBAAkB,OAC/C,WACA,qBACA,MAAO;AAGF,MAAM,sBAAsB,kBAAkB,OACnD,WACA,iBACA,MAAO;AAGF,MAAM,mBAAmB,kBAAkB,OAChD,WACA,sBACA,MAAO;AAGF,MAAM,oBAAoB,kBAAkB,OACjD,WACA,uBACA,MAAO;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/helper.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import moment from 'moment';\n\nexport function getMaxSize() {\n return 113;\n}\nexport function getTime(date, formatString = 'hh:mm a') {\n return moment(date).format(formatString);\n}\nexport function getDisplayDate(date, formatString = 'MM/DD/YYYY') {\n return moment(date).format(formatString);\n}\n"],
5
- "mappings": "AAAA;ACAA;AAEO,sBAAsB;AAC3B,SAAO;AAAA;AAEF,iBAAiB,MAAM,eAAe,WAAW;AACtD,SAAO,OAAO,MAAM,OAAO;AAAA;AAEtB,wBAAwB,MAAM,eAAe,cAAc;AAChE,SAAO,OAAO,MAAM,OAAO;AAAA;",
6
- "names": []
7
- }
package/esm/index.js.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import DSComments, { DSCommentCardWithSchema } from './components/DSComments';\n\nexport const { DSCommentCard } = DSComments;\nexport default DSCommentCard;\nexport { DSCommentCardWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,EAAE,kBAAkB;AACjC,IAAO,cAAQ;",
6
- "names": []
7
- }