@elliemae/ds-comments 3.34.0-next.1 → 3.34.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/config/DSCommentCardDefinitions.js.map +1 -1
- package/dist/cjs/config/useCommentCard.js +1 -1
- package/dist/cjs/config/useCommentCard.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +2 -0
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/config/DSCommentCardDefinitions.js.map +1 -1
- package/dist/esm/config/useCommentCard.js +1 -1
- package/dist/esm/config/useCommentCard.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +8 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/config/DSCommentCardDefinitions.d.ts +7 -7
- package/dist/types/config/useCommentCard.d.ts +1 -1
- package/dist/types/react-desc-prop-types.d.ts +3 -1
- package/dist/types/tests/DSCommentCard.test.d.ts +1 -0
- package/package.json +10 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/DSCommentCardDefinitions.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentCard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU: 'menu',\n};\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentCard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU: 'menu',\n} as const;\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,+BAA2B,0CAAwB,mBAAmB,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -44,7 +44,7 @@ const useCommentCard = (props) => {
|
|
|
44
44
|
const displayDate = date ? (0, import_helpers.getDisplayDate)(date, dateFormat) : null;
|
|
45
45
|
const displayTime = date ? (0, import_helpers.getTime)(date, timeFormat) : null;
|
|
46
46
|
const getOwnerProps = (0, import_react.useCallback)(() => propsWithDefault, [propsWithDefault]);
|
|
47
|
-
const getOwnerPropsArguments = (0, import_react.useCallback)(() =>
|
|
47
|
+
const getOwnerPropsArguments = (0, import_react.useCallback)(() => props, [props]);
|
|
48
48
|
return {
|
|
49
49
|
propsWithDefault,
|
|
50
50
|
xstyledProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useCommentCard.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useCallback } from 'react';\nimport { omit } from 'lodash';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { getTime, getDisplayDate } from '../helpers.js';\nimport { type DSCommentCardT, defaultProps } from '../react-desc-prop-types.js';\n\nexport const useCommentCard = (props: DSCommentCardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSCommentCardT.InternalProps>(props, defaultProps);\n const { date, dateFormat, timeFormat } = propsWithDefault;\n\n const xstyledProps = useGetXstyledProps(omit(propsWithDefault, 'borderBottom'));\n\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() =>
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4B;AAC5B,oBAAqB;AACrB,8BAAiE;AACjE,qBAAwC;AACxC,mCAAkD;AAE3C,MAAM,iBAAiB,CAAC,UAAgC;AAC7D,QAAM,uBAAmB,sDAA2D,OAAO,yCAAY;AACvG,QAAM,EAAE,MAAM,YAAY,WAAW,IAAI;AAEzC,QAAM,mBAAe,gDAAmB,oBAAK,kBAAkB,cAAc,CAAC;AAE9E,QAAM,cAAc,WAAO,+BAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,WAAO,wBAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,6BAAyB,0BAAY,OAAO,CAAC,
|
|
4
|
+
"sourcesContent": ["import { useCallback } from 'react';\nimport { omit } from 'lodash';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { getTime, getDisplayDate } from '../helpers.js';\nimport { type DSCommentCardT, defaultProps } from '../react-desc-prop-types.js';\n\nexport const useCommentCard = (props: DSCommentCardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSCommentCardT.InternalProps>(props, defaultProps);\n const { date, dateFormat, timeFormat } = propsWithDefault;\n\n const xstyledProps = useGetXstyledProps(omit(propsWithDefault, 'borderBottom'));\n\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => props, [props]);\n\n return {\n propsWithDefault,\n xstyledProps,\n getOwnerProps,\n getOwnerPropsArguments,\n displayDate,\n displayTime,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4B;AAC5B,oBAAqB;AACrB,8BAAiE;AACjE,qBAAwC;AACxC,mCAAkD;AAE3C,MAAM,iBAAiB,CAAC,UAAgC;AAC7D,QAAM,uBAAmB,sDAA2D,OAAO,yCAAY;AACvG,QAAM,EAAE,MAAM,YAAY,WAAW,IAAI;AAEzC,QAAM,mBAAe,gDAAmB,oBAAK,kBAAkB,cAAc,CAAC;AAE9E,QAAM,cAAc,WAAO,+BAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,WAAO,wBAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,oBAAgB,0BAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,6BAAyB,0BAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AAE/D,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,6 +35,7 @@ __export(react_desc_prop_types_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
36
|
var React = __toESM(require("react"));
|
|
37
37
|
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_DSCommentCardDefinitions = require("./config/DSCommentCardDefinitions.js");
|
|
38
39
|
const defaultProps = {
|
|
39
40
|
containerProps: {},
|
|
40
41
|
name: "",
|
|
@@ -53,6 +54,7 @@ const defaultProps = {
|
|
|
53
54
|
maxLines: 2
|
|
54
55
|
};
|
|
55
56
|
const DSCommentCardPropTypes = {
|
|
57
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_DSCommentCardDefinitions.DSCommentCardName, import_DSCommentCardDefinitions.DSCommentCardSlots),
|
|
56
58
|
...import_ds_props_helpers.globalAttributesPropTypes,
|
|
57
59
|
...import_ds_props_helpers.xstyledPropTypes,
|
|
58
60
|
/** props to inject to comment card wrapper */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSCommentCardName, DSCommentCardSlots } from './config/DSCommentCardDefinitions.js';\n\nexport namespace DSCommentCardT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export interface DefaultProps {\n containerProps: React.HTMLAttributes<HTMLDivElement>;\n name: string;\n date: Date;\n type: string;\n content: string;\n style: React.CSSProperties;\n options: unknown[];\n selection: unknown;\n customDropdownMenuProps: Record<string, unknown>;\n borderBottom: boolean;\n dateFormat: string;\n timeFormat: string;\n maxLines: number;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCommentCardName, typeof DSCommentCardSlots> {\n Menu?: React.ComponentType;\n menuProps?: object;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n focusableRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n}\n\nexport const defaultProps: DSCommentCardT.DefaultProps = {\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: false,\n dateFormat: 'MM/DD/YYYY',\n timeFormat: 'hh:mm a',\n maxLines: 2,\n};\n\nexport const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props> = {\n ...getPropsPerSlotPropTypes(DSCommentCardName, DSCommentCardSlots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\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)\n .description('dropdown menu options')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\n /** dropdown selection */\n selection: PropTypes.object\n .description('dropdown selection')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n })\n .description('pass down props to dropdown')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\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 Menu: PropTypes.func.description('Menu component'),\n menuProps: PropTypes.object.description('Props that will be received by the Menu component'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description(\n 'Inner ref to the Comment Card component',\n ),\n focusableRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Ref to the focusable part of the component')\n .deprecated({ version: '4.x', message: 'use global attribute prop instead' }),\n};\n\nexport const DSCommentCardPropTypesSchema =\n DSCommentCardPropTypes as unknown as WeakValidationMap<DSCommentCardT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAKO;AAIP,sCAAsD;AA6C/C,MAAM,eAA4C;AAAA,EACvD,gBAA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,YAAY,+BAA+B;AAAA;AAAA,EAExE,YAAY,kCAAU,MAAM,CAAC,cAAc,YAAY,CAAC,EAAE;AAAA,IACxD;AAAA,EACF;AAAA;AAAA,EAEA,YAAY,kCAAU,MAAM,CAAC,WAAW,OAAO,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAIA,UAAU,kCAAU,OAAO,YAAY,WAAW;AAAA,EAClD,MAAM,kCAAU,KAAK,YAAY,gBAAgB;AAAA,EACjD,WAAW,kCAAU,OAAO,YAAY,mDAAmD;AAAA,EAC3F,UAAU,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA,EACA,cAAc,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,IAAI,CAAC,EACjE,YAAY,4CAA4C,EACxD,WAAW,EAAE,SAAS,OAAO,SAAS,oCAAoC,CAAC;AAChF;AAEO,MAAM,+BACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/DSCommentCardDefinitions.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentCard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU: 'menu',\n};\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSCommentCardName = 'DSCommentCard';\n\nexport const DSCommentCardSlots = {\n ROOT: 'root',\n HEADER: 'header',\n CONTENT: 'content',\n LEFT: 'left',\n NAME: 'name',\n DATA: 'data',\n MENU: 'menu',\n} as const;\n\nexport const DSCommentCardDataTestIds = slotObjectToDataTestIds(DSCommentCardName, DSCommentCardSlots);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,oBAAoB;AAE1B,MAAM,qBAAqB;AAAA,EAChC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,2BAA2B,wBAAwB,mBAAmB,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -11,7 +11,7 @@ const useCommentCard = (props) => {
|
|
|
11
11
|
const displayDate = date ? getDisplayDate(date, dateFormat) : null;
|
|
12
12
|
const displayTime = date ? getTime(date, timeFormat) : null;
|
|
13
13
|
const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);
|
|
14
|
-
const getOwnerPropsArguments = useCallback(() =>
|
|
14
|
+
const getOwnerPropsArguments = useCallback(() => props, [props]);
|
|
15
15
|
return {
|
|
16
16
|
propsWithDefault,
|
|
17
17
|
xstyledProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useCommentCard.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport { omit } from 'lodash';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { getTime, getDisplayDate } from '../helpers.js';\nimport { type DSCommentCardT, defaultProps } from '../react-desc-prop-types.js';\n\nexport const useCommentCard = (props: DSCommentCardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSCommentCardT.InternalProps>(props, defaultProps);\n const { date, dateFormat, timeFormat } = propsWithDefault;\n\n const xstyledProps = useGetXstyledProps(omit(propsWithDefault, 'borderBottom'));\n\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() =>
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,SAAS,sBAAsB;AACxC,SAA8B,oBAAoB;AAE3C,MAAM,iBAAiB,CAAC,UAAgC;AAC7D,QAAM,mBAAmB,6BAA2D,OAAO,YAAY;AACvG,QAAM,EAAE,MAAM,YAAY,WAAW,IAAI;AAEzC,QAAM,eAAe,mBAAmB,KAAK,kBAAkB,cAAc,CAAC;AAE9E,QAAM,cAAc,OAAO,eAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,OAAO,QAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,yBAAyB,YAAY,OAAO,CAAC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback } from 'react';\nimport { omit } from 'lodash';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { getTime, getDisplayDate } from '../helpers.js';\nimport { type DSCommentCardT, defaultProps } from '../react-desc-prop-types.js';\n\nexport const useCommentCard = (props: DSCommentCardT.Props) => {\n const propsWithDefault = useMemoMergePropsWithDefault<DSCommentCardT.InternalProps>(props, defaultProps);\n const { date, dateFormat, timeFormat } = propsWithDefault;\n\n const xstyledProps = useGetXstyledProps(omit(propsWithDefault, 'borderBottom'));\n\n const displayDate = date ? getDisplayDate(date, dateFormat) : null;\n const displayTime = date ? getTime(date, timeFormat) : null;\n\n const getOwnerProps = useCallback(() => propsWithDefault, [propsWithDefault]);\n const getOwnerPropsArguments = useCallback(() => props, [props]);\n\n return {\n propsWithDefault,\n xstyledProps,\n getOwnerProps,\n getOwnerPropsArguments,\n displayDate,\n displayTime,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,mBAAmB;AAC5B,SAAS,YAAY;AACrB,SAAS,oBAAoB,oCAAoC;AACjE,SAAS,SAAS,sBAAsB;AACxC,SAA8B,oBAAoB;AAE3C,MAAM,iBAAiB,CAAC,UAAgC;AAC7D,QAAM,mBAAmB,6BAA2D,OAAO,YAAY;AACvG,QAAM,EAAE,MAAM,YAAY,WAAW,IAAI;AAEzC,QAAM,eAAe,mBAAmB,KAAK,kBAAkB,cAAc,CAAC;AAE9E,QAAM,cAAc,OAAO,eAAe,MAAM,UAAU,IAAI;AAC9D,QAAM,cAAc,OAAO,QAAQ,MAAM,UAAU,IAAI;AAEvD,QAAM,gBAAgB,YAAY,MAAM,kBAAkB,CAAC,gBAAgB,CAAC;AAC5E,QAAM,yBAAyB,YAAY,MAAM,OAAO,CAAC,KAAK,CAAC;AAE/D,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
globalAttributesPropTypes,
|
|
4
|
+
getPropsPerSlotPropTypes,
|
|
5
|
+
PropTypes,
|
|
6
|
+
xstyledPropTypes
|
|
7
|
+
} from "@elliemae/ds-props-helpers";
|
|
8
|
+
import { DSCommentCardName, DSCommentCardSlots } from "./config/DSCommentCardDefinitions.js";
|
|
3
9
|
const defaultProps = {
|
|
4
10
|
containerProps: {},
|
|
5
11
|
name: "",
|
|
@@ -18,6 +24,7 @@ const defaultProps = {
|
|
|
18
24
|
maxLines: 2
|
|
19
25
|
};
|
|
20
26
|
const DSCommentCardPropTypes = {
|
|
27
|
+
...getPropsPerSlotPropTypes(DSCommentCardName, DSCommentCardSlots),
|
|
21
28
|
...globalAttributesPropTypes,
|
|
22
29
|
...xstyledPropTypes,
|
|
23
30
|
/** props to inject to comment card wrapper */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-empty-interface */\nimport {\n globalAttributesPropTypes,\n getPropsPerSlotPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSCommentCardName, DSCommentCardSlots } from './config/DSCommentCardDefinitions.js';\n\nexport namespace DSCommentCardT {\n type PropsT<D, R, O, E> = Partial<D> &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n type InternalPropsT<D, R, O, E> = D &\n R &\n O &\n Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> &\n Omit<XstyledProps, keyof D | keyof R | keyof O>;\n\n export interface DefaultProps {\n containerProps: React.HTMLAttributes<HTMLDivElement>;\n name: string;\n date: Date;\n type: string;\n content: string;\n style: React.CSSProperties;\n options: unknown[];\n selection: unknown;\n customDropdownMenuProps: Record<string, unknown>;\n borderBottom: boolean;\n dateFormat: string;\n timeFormat: string;\n maxLines: number;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCommentCardName, typeof DSCommentCardSlots> {\n Menu?: React.ComponentType;\n menuProps?: object;\n innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n focusableRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);\n }\n\n export interface RequiredProps {}\n\n export type Props = PropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n\n export type InternalProps = InternalPropsT<DefaultProps, RequiredProps, OptionalProps, HTMLDivElement>;\n}\n\nexport const defaultProps: DSCommentCardT.DefaultProps = {\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: false,\n dateFormat: 'MM/DD/YYYY',\n timeFormat: 'hh:mm a',\n maxLines: 2,\n};\n\nexport const DSCommentCardPropTypes: DSPropTypesSchema<DSCommentCardT.Props> = {\n ...getPropsPerSlotPropTypes(DSCommentCardName, DSCommentCardSlots),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\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)\n .description('dropdown menu options')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\n /** dropdown selection */\n selection: PropTypes.object\n .description('dropdown selection')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\n /** pass down props to dropdown */\n customDropdownMenuProps: PropTypes.shape({\n focusOnOpen: PropTypes.bool,\n })\n .description('pass down props to dropdown')\n .deprecated({ version: '4.x', message: 'use Menu and menuProps instead' }),\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 Menu: PropTypes.func.description('Menu component'),\n menuProps: PropTypes.object.description('Props that will be received by the Menu component'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).description(\n 'Inner ref to the Comment Card component',\n ),\n focusableRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Ref to the focusable part of the component')\n .deprecated({ version: '4.x', message: 'use global attribute prop instead' }),\n};\n\nexport const DSCommentCardPropTypesSchema =\n DSCommentCardPropTypes as unknown as WeakValidationMap<DSCommentCardT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,mBAAmB,0BAA0B;AA6C/C,MAAM,eAA4C;AAAA,EACvD,gBAAgB,CAAC;AAAA,EACjB,MAAM;AAAA,EACN,MAAM,oBAAI,KAAK;AAAA,EACf,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO,CAAC;AAAA,EACR,SAAS,CAAC;AAAA,EACV,WAAW,EAAE,sCAAsC,CAAC,iBAAiB,EAAE;AAA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A;AAAA,EAIA,UAAU,UAAU,OAAO,YAAY,WAAW;AAAA,EAClD,MAAM,UAAU,KAAK,YAAY,gBAAgB;AAAA,EACjD,WAAW,UAAU,OAAO,YAAY,mDAAmD;AAAA,EAC3F,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EAAE;AAAA,IAChE;AAAA,EACF;AAAA,EACA,cAAc,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,IAAI,CAAC,EACjE,YAAY,4CAA4C,EACxD,WAAW,EAAE,SAAS,OAAO,SAAS,oCAAoC,CAAC;AAChF;AAEO,MAAM,+BACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare const DSCommentCardName = "DSCommentCard";
|
|
2
2
|
export declare const DSCommentCardSlots: {
|
|
3
|
-
ROOT:
|
|
4
|
-
HEADER:
|
|
5
|
-
CONTENT:
|
|
6
|
-
LEFT:
|
|
7
|
-
NAME:
|
|
8
|
-
DATA:
|
|
9
|
-
MENU:
|
|
3
|
+
readonly ROOT: "root";
|
|
4
|
+
readonly HEADER: "header";
|
|
5
|
+
readonly CONTENT: "content";
|
|
6
|
+
readonly LEFT: "left";
|
|
7
|
+
readonly NAME: "name";
|
|
8
|
+
readonly DATA: "data";
|
|
9
|
+
readonly MENU: "menu";
|
|
10
10
|
};
|
|
11
11
|
export declare const DSCommentCardDataTestIds: Record<string, string>;
|
|
@@ -3,7 +3,7 @@ export declare const useCommentCard: (props: DSCommentCardT.Props) => {
|
|
|
3
3
|
propsWithDefault: DSCommentCardT.InternalProps;
|
|
4
4
|
xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
|
|
5
5
|
getOwnerProps: () => DSCommentCardT.InternalProps;
|
|
6
|
-
getOwnerPropsArguments: () =>
|
|
6
|
+
getOwnerPropsArguments: () => DSCommentCardT.Props;
|
|
7
7
|
displayDate: string | null;
|
|
8
8
|
displayTime: string | null;
|
|
9
9
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { WeakValidationMap } from 'react';
|
|
2
2
|
import type { GlobalAttributesT, XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
3
|
+
import type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
4
|
+
import { DSCommentCardName, DSCommentCardSlots } from './config/DSCommentCardDefinitions.js';
|
|
3
5
|
export declare namespace DSCommentCardT {
|
|
4
6
|
type PropsT<D, R, O, E> = Partial<D> & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
5
7
|
type InternalPropsT<D, R, O, E> = D & R & O & Omit<GlobalAttributesT<E>, keyof D | keyof R | keyof O> & Omit<XstyledProps, keyof D | keyof R | keyof O>;
|
|
@@ -18,7 +20,7 @@ export declare namespace DSCommentCardT {
|
|
|
18
20
|
timeFormat: string;
|
|
19
21
|
maxLines: number;
|
|
20
22
|
}
|
|
21
|
-
export interface OptionalProps {
|
|
23
|
+
export interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSCommentCardName, typeof DSCommentCardSlots> {
|
|
22
24
|
Menu?: React.ComponentType;
|
|
23
25
|
menuProps?: object;
|
|
24
26
|
innerRef?: React.MutableRefObject<HTMLDivElement | null> | ((instance: HTMLElement | null) => void);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-comments",
|
|
3
|
-
"version": "3.34.0-next.
|
|
3
|
+
"version": "3.34.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Comments",
|
|
6
6
|
"files": [
|
|
@@ -52,17 +52,19 @@
|
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"moment": "~2.29.4",
|
|
55
|
-
"@elliemae/ds-button-v2": "3.34.0-next.
|
|
56
|
-
"@elliemae/ds-dropdownmenu": "3.34.0-next.
|
|
57
|
-
"@elliemae/ds-icons": "3.34.0-next.
|
|
58
|
-
"@elliemae/ds-props-helpers": "3.34.0-next.
|
|
59
|
-
"@elliemae/ds-
|
|
60
|
-
"@elliemae/ds-
|
|
55
|
+
"@elliemae/ds-button-v2": "3.34.0-next.3",
|
|
56
|
+
"@elliemae/ds-dropdownmenu": "3.34.0-next.3",
|
|
57
|
+
"@elliemae/ds-icons": "3.34.0-next.3",
|
|
58
|
+
"@elliemae/ds-props-helpers": "3.34.0-next.3",
|
|
59
|
+
"@elliemae/ds-dropdownmenu-v2": "3.34.0-next.3",
|
|
60
|
+
"@elliemae/ds-read-more": "3.34.0-next.3",
|
|
61
|
+
"@elliemae/ds-system": "3.34.0-next.3",
|
|
62
|
+
"@elliemae/ds-typescript-helpers": "3.34.0-next.3"
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
64
66
|
"styled-components": "~5.3.9",
|
|
65
|
-
"@elliemae/ds-monorepo-devops": "3.34.0-next.
|
|
67
|
+
"@elliemae/ds-monorepo-devops": "3.34.0-next.3"
|
|
66
68
|
},
|
|
67
69
|
"peerDependencies": {
|
|
68
70
|
"@xstyled/system": "~3.7.3",
|