@elliemae/ds-accordion 3.3.0-next.4 → 3.3.0-next.7
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/parts/accordionContent/AccordionContent.js +8 -31
- package/dist/cjs/parts/accordionContent/AccordionContent.js.map +1 -1
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js +31 -71
- package/dist/cjs/parts/accordionItem/DSAccordionItem.js.map +1 -1
- package/dist/cjs/react-desc-prop-types.js +8 -21
- package/dist/cjs/react-desc-prop-types.js.map +1 -1
- package/dist/esm/parts/accordionContent/AccordionContent.js +8 -33
- package/dist/esm/parts/accordionContent/AccordionContent.js.map +1 -1
- package/dist/esm/parts/accordionItem/DSAccordionItem.js +31 -73
- package/dist/esm/parts/accordionItem/DSAccordionItem.js.map +1 -1
- package/dist/esm/react-desc-prop-types.js +8 -23
- package/dist/esm/react-desc-prop-types.js.map +1 -1
- package/package.json +6 -6
|
@@ -3,34 +3,8 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
8
|
var __export = (target, all) => {
|
|
35
9
|
for (var name in all)
|
|
36
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -58,16 +32,19 @@ var import_DSAccordionDatatestid = require("../../exported-related/DSAccordionDa
|
|
|
58
32
|
var import_styles = require("./styles");
|
|
59
33
|
const AccordionContent = () => {
|
|
60
34
|
const {
|
|
61
|
-
props:
|
|
62
|
-
} = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext)
|
|
35
|
+
props: { containerProps, children, ...rest }
|
|
36
|
+
} = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext);
|
|
63
37
|
const childrenWithIndex = [];
|
|
64
38
|
const xstyledAttrs = (0, import_ds_utilities.useGetXstyledProps)(rest);
|
|
65
39
|
const globalAttrs = (0, import_ds_utilities.useGetGlobalAttributes)(rest);
|
|
66
40
|
import_react.default.Children.forEach(children, (child, index) => childrenWithIndex.push(import_react.default.cloneElement(child, {
|
|
67
41
|
dsIndex: index
|
|
68
42
|
})));
|
|
69
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer,
|
|
70
|
-
"data-testid": import_DSAccordionDatatestid.DSAccordionDataTestid.GROUP
|
|
71
|
-
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledContainer, {
|
|
44
|
+
"data-testid": import_DSAccordionDatatestid.DSAccordionDataTestid.GROUP,
|
|
45
|
+
...containerProps,
|
|
46
|
+
...globalAttrs,
|
|
47
|
+
...xstyledAttrs
|
|
48
|
+
}, childrenWithIndex);
|
|
72
49
|
};
|
|
73
50
|
//# sourceMappingURL=AccordionContent.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/accordionContent/AccordionContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDatatestid';\nimport { StyledContainer } from './styles';\nimport type { DSAccordionT } from '../../react-desc-prop-types';\n\nexport const AccordionContent = (): JSX.Element => {\n const {\n props: { containerProps, children, ...rest },\n } = useContext(DSAccordionContext);\n\n const childrenWithIndex: React.ReactElement<DSAccordionT.InternalItemProps>[] = [];\n\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const globalAttrs = useGetGlobalAttributes(rest);\n\n React.Children.forEach(children, (child, index) =>\n childrenWithIndex.push(\n React.cloneElement(child, {\n dsIndex: index,\n }),\n ),\n );\n\n return (\n <StyledContainer data-testid={DSAccordionDataTestid.GROUP} {...containerProps} {...globalAttrs} {...xstyledAttrs}>\n {childrenWithIndex}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAClC,0BAA2D;AAC3D,4BAAmC;AACnC,mCAAsC;AACtC,oBAAgC;AAGzB,MAAM,mBAAmB,MAAmB;AACjD,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,aAAa;AAAA,MACpC,6BAAW,wCAAkB;AAEjC,QAAM,oBAA0E,CAAC;AAEjF,QAAM,eAAe,4CAAmB,IAAI;AAE5C,QAAM,cAAc,gDAAuB,IAAI;AAE/C,uBAAM,SAAS,QAAQ,UAAU,CAAC,OAAO,UACvC,kBAAkB,KAChB,qBAAM,aAAa,OAAO;AAAA,IACxB,SAAS;AAAA,EACX,CAAC,CACH,CACF;AAEA,SACE,mDAAC;AAAA,IAAgB,eAAa,mDAAsB;AAAA,IAAQ,GAAG;AAAA,IAAiB,GAAG;AAAA,IAAc,GAAG;AAAA,KACjG,iBACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,39 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
8
|
var __export = (target, all) => {
|
|
38
9
|
for (var name in all)
|
|
39
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -68,7 +39,7 @@ var import_DSAccordionDatatestid = require("../../exported-related/DSAccordionDa
|
|
|
68
39
|
var import_react_desc_prop_types = require("../../react-desc-prop-types");
|
|
69
40
|
const DSAccordionItem = (props) => {
|
|
70
41
|
const propsWithDefaults = (0, import_ds_utilities.useMemoMergePropsWithDefault)(props, import_defaultProps.accordionItemDefaultProps);
|
|
71
|
-
const
|
|
42
|
+
const {
|
|
72
43
|
children,
|
|
73
44
|
title,
|
|
74
45
|
secondaryTitle,
|
|
@@ -78,20 +49,10 @@ const DSAccordionItem = (props) => {
|
|
|
78
49
|
value,
|
|
79
50
|
disabled,
|
|
80
51
|
dsIndex,
|
|
81
|
-
renderCustomActions
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"secondaryTitle",
|
|
86
|
-
"customActions",
|
|
87
|
-
"iconOpened",
|
|
88
|
-
"iconClosed",
|
|
89
|
-
"value",
|
|
90
|
-
"disabled",
|
|
91
|
-
"dsIndex",
|
|
92
|
-
"renderCustomActions"
|
|
93
|
-
]);
|
|
94
|
-
const _b = (0, import_ds_utilities.useGetGlobalAttributes)(rest), { className } = _b, globalAttrs = __objRest(_b, ["className"]);
|
|
52
|
+
renderCustomActions,
|
|
53
|
+
...rest
|
|
54
|
+
} = propsWithDefaults;
|
|
55
|
+
const { className, ...globalAttrs } = (0, import_ds_utilities.useGetGlobalAttributes)(rest);
|
|
95
56
|
const xstyledAttrs = (0, import_ds_utilities.useGetXstyledProps)(rest);
|
|
96
57
|
const { handleOnClick, handleOnKeyDown, selected } = (0, import_useAccordionItem.useAccordionItem)({ value, disabled });
|
|
97
58
|
const {
|
|
@@ -108,19 +69,16 @@ const DSAccordionItem = (props) => {
|
|
|
108
69
|
if (!isDSMobile && customActions?.length > 0)
|
|
109
70
|
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemCustomActions, {
|
|
110
71
|
isDSMobile
|
|
111
|
-
}, customActions?.map((
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
e
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
buttonType: import_ds_button.BUTTON_TYPE.SECONDARY
|
|
122
|
-
}));
|
|
123
|
-
}));
|
|
72
|
+
}, customActions?.map(({ onClick, id, ...otherProps }) => /* @__PURE__ */ import_react.default.createElement(import_ds_button.DSButton, {
|
|
73
|
+
key: id,
|
|
74
|
+
onClick: (e) => {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
if (onClick)
|
|
77
|
+
onClick(e);
|
|
78
|
+
},
|
|
79
|
+
...otherProps,
|
|
80
|
+
buttonType: import_ds_button.BUTTON_TYPE.SECONDARY
|
|
81
|
+
})));
|
|
124
82
|
if (!isDSMobile && renderCustomActions)
|
|
125
83
|
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemCustomActions, {
|
|
126
84
|
isDSMobile
|
|
@@ -133,14 +91,14 @@ const DSAccordionItem = (props) => {
|
|
|
133
91
|
const handleOnBlur = (0, import_react.useCallback)(() => setShowPopover(false), []);
|
|
134
92
|
const Titles = (0, import_react.useMemo)(() => {
|
|
135
93
|
if ((isPrimaryShowingEllipsis || isSecondaryShowingEllipsis) && !isDSMobile)
|
|
136
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledPrimaryTitle,
|
|
137
|
-
ref: setPrimaryElement
|
|
138
|
-
|
|
94
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledPrimaryTitle, {
|
|
95
|
+
ref: setPrimaryElement,
|
|
96
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
139
97
|
disabled,
|
|
140
98
|
isDSMobile,
|
|
141
99
|
selected,
|
|
142
100
|
withSecondaryTitle: secondaryTitle
|
|
143
|
-
}
|
|
101
|
+
}, title), !isDSMobile && secondaryTitle && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledSecondaryTitle, {
|
|
144
102
|
ref: setSecondaryElement,
|
|
145
103
|
disabled,
|
|
146
104
|
selected
|
|
@@ -148,14 +106,14 @@ const DSAccordionItem = (props) => {
|
|
|
148
106
|
referenceElement,
|
|
149
107
|
showPopover
|
|
150
108
|
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledTooltipContent, null, /* @__PURE__ */ import_react.default.createElement("p", null, title), /* @__PURE__ */ import_react.default.createElement("p", null, " ", secondaryTitle))));
|
|
151
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledPrimaryTitle,
|
|
152
|
-
ref: setPrimaryElement
|
|
153
|
-
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledPrimaryTitle, {
|
|
110
|
+
ref: setPrimaryElement,
|
|
111
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
154
112
|
disabled,
|
|
155
113
|
isDSMobile,
|
|
156
114
|
selected,
|
|
157
115
|
withSecondaryTitle: secondaryTitle
|
|
158
|
-
}
|
|
116
|
+
}, title), !isDSMobile && secondaryTitle && /* @__PURE__ */ import_react.default.createElement(import_styles.StyledSecondaryTitle, {
|
|
159
117
|
ref: setSecondaryElement,
|
|
160
118
|
disabled,
|
|
161
119
|
selected
|
|
@@ -173,13 +131,14 @@ const DSAccordionItem = (props) => {
|
|
|
173
131
|
selected,
|
|
174
132
|
title
|
|
175
133
|
]);
|
|
176
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemContainer,
|
|
134
|
+
return /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemContainer, {
|
|
177
135
|
"data-testid": import_DSAccordionDatatestid.DSAccordionDataTestid.ITEM.CONTAINER,
|
|
178
|
-
className
|
|
179
|
-
|
|
136
|
+
className,
|
|
137
|
+
...xstyledAttrs
|
|
138
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemHeaderContainer, {
|
|
180
139
|
disabled,
|
|
181
140
|
ref: setReferenceElement
|
|
182
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemHeader,
|
|
141
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemHeader, {
|
|
183
142
|
type: "button",
|
|
184
143
|
withCustomActions: (customActions?.length > 0 || renderCustomActions !== void 0) && !isDSMobile,
|
|
185
144
|
withSecondaryTitle: secondaryTitle,
|
|
@@ -196,8 +155,9 @@ const DSAccordionItem = (props) => {
|
|
|
196
155
|
"aria-disabled": disabled,
|
|
197
156
|
"aria-controls": `ds-accordion-content-${value}`,
|
|
198
157
|
onFocus: handleOnFocus,
|
|
199
|
-
onBlur: handleOnBlur
|
|
200
|
-
|
|
158
|
+
onBlur: handleOnBlur,
|
|
159
|
+
...globalAttrs
|
|
160
|
+
}, /* @__PURE__ */ import_react.default.createElement(import_styles.StyledItemAddon, {
|
|
201
161
|
disabled,
|
|
202
162
|
isDSMobile
|
|
203
163
|
}, selected ? /* @__PURE__ */ import_react.default.createElement(IconOpened, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/accordionItem/DSAccordionItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport React, { useState, useContext, useCallback, useMemo, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n describe,\n useIsShowingEllipsis,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-utilities';\nimport { DSButton, BUTTON_TYPE } from '@elliemae/ds-button';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { accordionItemDefaultProps } from '../../defaultProps';\nimport {\n StyledItemAddon,\n StyledItemContainer,\n StyledItemContent,\n StyledItemCustomActions,\n StyledItemHeader,\n StyledItemHeaderContainer,\n StyledItemTitles,\n StyledPrimaryTitle,\n StyledSecondaryTitle,\n StyledTooltipContent,\n} from './styles';\nimport { useAccordionItem } from './useAccordionItem';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDatatestid';\nimport { accordionItemPropTypes } from '../../react-desc-prop-types';\nimport type { DSAccordionT } from '../../react-desc-prop-types';\n\nconst DSAccordionItem = (props: DSAccordionT.ItemProps): JSX.Element => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n accordionItemDefaultProps,\n ) as DSAccordionT.InternalItemProps;\n\n const {\n children,\n title,\n secondaryTitle,\n customActions,\n iconOpened: IconOpened,\n iconClosed: IconClosed,\n value,\n disabled,\n dsIndex,\n renderCustomActions,\n ...rest\n } = propsWithDefaults;\n\n const { className, ...globalAttrs } = useGetGlobalAttributes(rest);\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const { handleOnClick, handleOnKeyDown, selected } = useAccordionItem({ value, disabled });\n const {\n allChildrenReferences,\n actualActiveValue,\n props: { isDSMobile },\n } = useContext(DSAccordionContext);\n\n const onKeyDownWithIndex = useCallback(\n (e: React.KeyboardEvent) => {\n handleOnKeyDown(e, dsIndex);\n },\n [dsIndex, handleOnKeyDown],\n );\n\n const [showPopover, setShowPopover] = useState(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>();\n\n const CustomActionsContent = useMemo(() => {\n if (!isDSMobile && customActions?.length > 0)\n return (\n <StyledItemCustomActions isDSMobile={isDSMobile}>\n {customActions?.map(({ onClick, id, ...otherProps }) => (\n <DSButton\n key={id}\n onClick={(e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>): void => {\n e.stopPropagation();\n if (onClick) onClick(e as React.MouseEvent<HTMLElement, MouseEvent>);\n }}\n {...otherProps}\n buttonType={BUTTON_TYPE.SECONDARY}\n />\n ))}\n </StyledItemCustomActions>\n );\n\n if (!isDSMobile && renderCustomActions)\n return (\n <StyledItemCustomActions isDSMobile={isDSMobile}>\n {renderCustomActions({ allRefs: allChildrenReferences, actualActiveValue })}\n </StyledItemCustomActions>\n );\n return null;\n }, [actualActiveValue, allChildrenReferences, customActions, isDSMobile, renderCustomActions]);\n\n const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = useIsShowingEllipsis();\n\n const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = useIsShowingEllipsis();\n\n const handleOnFocus = useCallback(\n () => setShowPopover(isPrimaryShowingEllipsis || isSecondaryShowingEllipsis),\n [isPrimaryShowingEllipsis, isSecondaryShowingEllipsis],\n );\n\n const handleOnBlur = useCallback(() => setShowPopover(false), []);\n\n // eslint-disable-next-line complexity\n const Titles = useMemo(() => {\n if ((isPrimaryShowingEllipsis || isSecondaryShowingEllipsis) && !isDSMobile)\n return (\n <>\n <StyledPrimaryTitle\n ref={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id` } : undefined)}\n disabled={disabled}\n isDSMobile={isDSMobile}\n selected={selected}\n withSecondaryTitle={secondaryTitle}\n >\n {title}\n </StyledPrimaryTitle>\n {!isDSMobile && secondaryTitle && (\n <StyledSecondaryTitle ref={setSecondaryElement} disabled={disabled} selected={selected}>\n {secondaryTitle}\n </StyledSecondaryTitle>\n )}\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover}>\n <StyledTooltipContent>\n <p>{title}</p>\n <p> {secondaryTitle}</p>\n </StyledTooltipContent>\n </DSPopperJS>\n </>\n );\n\n return (\n <>\n <StyledPrimaryTitle\n ref={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id` } : undefined)}\n disabled={disabled}\n isDSMobile={isDSMobile}\n selected={selected}\n withSecondaryTitle={secondaryTitle}\n >\n {title}\n </StyledPrimaryTitle>\n {!isDSMobile && secondaryTitle && (\n <StyledSecondaryTitle ref={setSecondaryElement} disabled={disabled} selected={selected}>\n {secondaryTitle}\n </StyledSecondaryTitle>\n )}\n </>\n );\n }, [\n disabled,\n isDSMobile,\n isPrimaryShowingEllipsis,\n isSecondaryShowingEllipsis,\n referenceElement,\n secondaryTitle,\n setPrimaryElement,\n setSecondaryElement,\n showPopover,\n selected,\n title,\n ]);\n\n return (\n <StyledItemContainer data-testid={DSAccordionDataTestid.ITEM.CONTAINER} className={className} {...xstyledAttrs}>\n <StyledItemHeaderContainer disabled={disabled} ref={setReferenceElement}>\n <StyledItemHeader\n type=\"button\"\n withCustomActions={(customActions?.length > 0 || renderCustomActions !== undefined) && !isDSMobile}\n withSecondaryTitle={secondaryTitle}\n onClick={handleOnClick}\n tabIndex={!disabled ? 0 : undefined}\n disabled={disabled}\n data-disabled={disabled}\n ref={allChildrenReferences[dsIndex]}\n onKeyDown={onKeyDownWithIndex}\n isDSMobile={isDSMobile}\n data-testid={DSAccordionDataTestid.ITEM.HEADER}\n id={`ds-accordion-header-${value}`}\n aria-expanded={selected}\n aria-disabled={disabled}\n aria-controls={`ds-accordion-content-${value}`}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n {...globalAttrs}\n >\n <StyledItemAddon disabled={disabled} isDSMobile={isDSMobile}>\n {selected ? <IconOpened isDSMobile={isDSMobile} /> : <IconClosed isDSMobile={isDSMobile} />}\n </StyledItemAddon>\n <StyledItemTitles\n onMouseEnter={handleOnFocus}\n onMouseLeave={handleOnBlur}\n isDSMobile={isDSMobile}\n withSecondaryTitle={secondaryTitle}\n selected={selected}\n >\n {Titles}\n </StyledItemTitles>\n </StyledItemHeader>\n {CustomActionsContent}\n </StyledItemHeaderContainer>\n {selected && (\n <StyledItemContent\n data-testid={DSAccordionDataTestid.ITEM.CONTENT}\n aria-labelledby={`ds-accordion-header-${value}`}\n role=\"region\"\n isDSMobile={isDSMobile}\n id={`ds-accordion-content-${value}`}\n >\n {children}\n </StyledItemContent>\n )}\n </StyledItemContainer>\n );\n};\n\nDSAccordionItem.displayName = 'DSAccordionItem';\nconst DSAccordionItemWithSchema = describe(DSAccordionItem);\nDSAccordionItemWithSchema.propTypes = accordionItemPropTypes as WeakValidationMap<unknown>;\n\nexport { DSAccordionItem, DSAccordionItemWithSchema };\nexport default DSAccordionItem;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAqF;AACrF,0BAMO;AACP,uBAAsC;AACtC,yBAA2B;AAC3B,0BAA0C;AAC1C,oBAWO;AACP,8BAAiC;AACjC,4BAAmC;AACnC,mCAAsC;AACtC,mCAAuC;AAGvC,MAAM,kBAAkB,CAAC,UAA+C;AACtE,QAAM,oBAAoB,sDACxB,OACA,6CACF;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,OACG;AAAA,MACD;AAEJ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AA,IACA,iBAAe;AAAA,IACf,KAAK,sBAAsB;AAAA,IAC3B,WAAW;AAAA,IACX;AAAA,IACA,eAAa,mDAAsB,KAAK;AAAA,IACxC,IAAI,uBAAuB;AAAA,IAC3B,iBAAe;AAAA,IACf,iBAAe;AAAA,IACf,iBAAe,wBAAwB;AAAA,IACvC,SAAS;AAAA,IACT,QAAQ;AAAA,IACP,GAAG;AAAA,KAEJ,mDAAC;AAAA,IAAgB;AAAA,IAAoB;AAAA,KAClC,WAAW,mDAAC;AAAA,IAAW;AAAA,GAAwB,IAAK,mDAAC;AAAA,IAAW;AAAA,GAAwB,CAC3F,GACA,mDAAC;AAAA,IACC,cAAc;AAAA,IACd,cAAc;AAAA,IACd;AAAA,IACA,oBAAoB;AAAA,IACpB;AAAA,KAEC,MACH,CACF,GACC,oBACH,GACC,YACC,mDAAC;AAAA,IACC,eAAa,mDAAsB,KAAK;AAAA,IACxC,mBAAiB,uBAAuB;AAAA,IACxC,MAAK;AAAA,IACL;AAAA,IACA,IAAI,wBAAwB;AAAA,KAE3B,QACH,CAEJ;AAEJ;AAEA,gBAAgB,cAAc;AAC9B,MAAM,4BAA4B,kCAAS,eAAe;AAC1D,0BAA0B,YAAY;AAGtC,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
8
|
var __export = (target, all) => {
|
|
26
9
|
for (var name in all)
|
|
27
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -44,7 +27,9 @@ __export(react_desc_prop_types_exports, {
|
|
|
44
27
|
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
45
28
|
var React = __toESM(require("react"));
|
|
46
29
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
47
|
-
const accordionItemPropTypes =
|
|
30
|
+
const accordionItemPropTypes = {
|
|
31
|
+
...import_ds_utilities.globalAttributesPropTypes,
|
|
32
|
+
...import_ds_utilities.xstyledPropTypes,
|
|
48
33
|
children: import_ds_utilities.PropTypes.node.description("Dimsum AccordionItem content.").isRequired,
|
|
49
34
|
title: import_ds_utilities.PropTypes.string.description("Set a primary title."),
|
|
50
35
|
value: import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.string, import_ds_utilities.PropTypes.number]).description("Dimsum AccordionItem value, this value should be unique.").isRequired,
|
|
@@ -53,8 +38,10 @@ const accordionItemPropTypes = __spreadProps(__spreadValues(__spreadValues({}, i
|
|
|
53
38
|
secondaryTitle: import_ds_utilities.PropTypes.string.description("Set a secondary title"),
|
|
54
39
|
customActions: import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.object).description("Set Dimsum AccordionItem custom actions.").deprecated({ version: "3.x" }),
|
|
55
40
|
renderCustomActions: import_ds_utilities.PropTypes.func.description("This property will render any JSX in the header controls area. You can access to all references and active values within the props.")
|
|
56
|
-
}
|
|
57
|
-
const accordionPropTypes =
|
|
41
|
+
};
|
|
42
|
+
const accordionPropTypes = {
|
|
43
|
+
...import_ds_utilities.globalAttributesPropTypes,
|
|
44
|
+
...import_ds_utilities.xstyledPropTypes,
|
|
58
45
|
containerProps: import_ds_utilities.PropTypes.object.description("Adds props to the container."),
|
|
59
46
|
activeValue: import_ds_utilities.PropTypes.oneOfType([
|
|
60
47
|
import_ds_utilities.PropTypes.arrayOf(import_ds_utilities.PropTypes.oneOfType([import_ds_utilities.PropTypes.string, import_ds_utilities.PropTypes.number])),
|
|
@@ -64,5 +51,5 @@ const accordionPropTypes = __spreadProps(__spreadValues(__spreadValues({}, impor
|
|
|
64
51
|
children: import_ds_utilities.PropTypes.node.description("Dimsum AccordionItems to show."),
|
|
65
52
|
allowMultipleOpen: import_ds_utilities.PropTypes.bool.description("Allows multiple Dimsum AccordionItems to be open at the same time."),
|
|
66
53
|
onChange: import_ds_utilities.PropTypes.func.description("Callback function once the Dimsum Accordion changes.")
|
|
67
|
-
}
|
|
54
|
+
};
|
|
68
55
|
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/react-desc-prop-types.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport type { DSAccordionInternalsT } from './sharedTypes';\n\nexport declare namespace DSAccordionT {\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n allowMultipleOpen: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n }\n\n export interface OptionalProps {\n activeValue?: DSAccordionInternalsT.InternalActiveValue;\n }\n\n export interface RequiredProps {\n children: React.ReactElement<ItemProps>[];\n }\n\n export interface Props extends OptionalProps, Partial<Omit<DefaultProps, 'children'>>, RequiredProps {}\n\n export interface ItemDefaultProps {\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n title: string;\n customActions: DSAccordionInternalsT.CustomActions[];\n disabled: boolean;\n }\n\n export interface ItemOptionalProps {\n secondaryTitle?: string;\n renderCustomActions?: (props: {\n allRefs: DSAccordionInternalsT.AllChildrenReferences;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n }) => JSX.Element;\n }\n\n export interface ItemRequiredProps {\n children: React.ReactNode;\n value: string | number;\n }\n\n export interface ItemProps extends ItemRequiredProps, ItemOptionalProps, Partial<ItemDefaultProps> {}\n\n export interface InternalItemProps\n extends ItemRequiredProps,\n ItemOptionalProps,\n Omit<ItemDefaultProps, 'disabled' | 'customActions' | 'iconClosed' | 'iconOpened'> {\n dsIndex: number;\n disabled: boolean;\n customActions: DSAccordionInternalsT.CustomActions[];\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n }\n\n export interface InternalProps\n extends OptionalProps,\n Partial<Omit<DefaultProps, 'children' | 'isDSMobile' | 'onChange'>> {\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n }\n}\n\nexport const accordionItemPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.description('Dimsum AccordionItem content.').isRequired,\n title: PropTypes.string.description('Set a primary title.'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Dimsum AccordionItem value, this value should be unique.',\n ).isRequired,\n iconClosed: PropTypes.node.description('Custom Dimsum Icon when it is closed.').deprecated({ version: '3.x' }),\n iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.').deprecated({ version: '3.x' }),\n secondaryTitle: PropTypes.string.description('Set a secondary title'),\n customActions: PropTypes.arrayOf(PropTypes.object)\n .description('Set Dimsum AccordionItem custom actions.')\n .deprecated({ version: '3.x' }),\n renderCustomActions: PropTypes.func.description(\n 'This property will render any JSX in the header controls area. You can access to all references and active values within the props.',\n ),\n};\n\nexport const accordionPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Adds props to the container.'),\n activeValue: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n PropTypes.string,\n PropTypes.number,\n ]).description('Selected active value. This property makes the component a controlled one.'),\n children: PropTypes.node.description('Dimsum AccordionItems to show.'),\n allowMultipleOpen: PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),\n onChange: PropTypes.func.description('Callback function once the Dimsum Accordion changes.'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAuE;AAiEhE,MAAM,yBAAyB;AAAA,EACpC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,8BAAU,KAAK,YAAY,+BAA+B,EAAE;AAAA,EACtE,OAAO,8BAAU,OAAO,YAAY,sBAAsB;AAAA,EAC1D,OAAO,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,CAAC,EAAE,YAC/D,0DACF,EAAE;AAAA,EACF,YAAY,8BAAU,KAAK,YAAY,uCAAuC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC7G,YAAY,8BAAU,KAAK,YAAY,qCAAqC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC3G,gBAAgB,8BAAU,OAAO,YAAY,uBAAuB;AAAA,EACpE,eAAe,8BAAU,QAAQ,8BAAU,MAAM,EAC9C,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAChC,qBAAqB,8BAAU,KAAK,YAClC,qIACF;AACF;AAEO,MAAM,qBAAqB;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,8BAAU,OAAO,YAAY,8BAA8B;AAAA,EAC3E,aAAa,8BAAU,UAAU;AAAA,IAC/B,8BAAU,QAAQ,8BAAU,UAAU,CAAC,8BAAU,QAAQ,8BAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,8BAAU;AAAA,IACV,8BAAU;AAAA,EACZ,CAAC,EAAE,YAAY,4EAA4E;AAAA,EAC3F,UAAU,8BAAU,KAAK,YAAY,gCAAgC;AAAA,EACrE,mBAAmB,8BAAU,KAAK,YAAY,oEAAoE;AAAA,EAClH,UAAU,8BAAU,KAAK,YAAY,sDAAsD;AAC7F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,32 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
-
var __spreadValues = (a, b) => {
|
|
8
|
-
for (var prop in b || (b = {}))
|
|
9
|
-
if (__hasOwnProp.call(b, prop))
|
|
10
|
-
__defNormalProp(a, prop, b[prop]);
|
|
11
|
-
if (__getOwnPropSymbols)
|
|
12
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
-
if (__propIsEnum.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
}
|
|
16
|
-
return a;
|
|
17
|
-
};
|
|
18
|
-
var __objRest = (source, exclude) => {
|
|
19
|
-
var target = {};
|
|
20
|
-
for (var prop in source)
|
|
21
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
22
|
-
target[prop] = source[prop];
|
|
23
|
-
if (source != null && __getOwnPropSymbols)
|
|
24
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
25
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
}
|
|
28
|
-
return target;
|
|
29
|
-
};
|
|
30
2
|
import * as React from "react";
|
|
31
3
|
import React2, { useContext } from "react";
|
|
32
4
|
import { useGetGlobalAttributes, useGetXstyledProps } from "@elliemae/ds-utilities";
|
|
@@ -35,17 +7,20 @@ import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatates
|
|
|
35
7
|
import { StyledContainer } from "./styles";
|
|
36
8
|
const AccordionContent = () => {
|
|
37
9
|
const {
|
|
38
|
-
props:
|
|
39
|
-
} = useContext(DSAccordionContext)
|
|
10
|
+
props: { containerProps, children, ...rest }
|
|
11
|
+
} = useContext(DSAccordionContext);
|
|
40
12
|
const childrenWithIndex = [];
|
|
41
13
|
const xstyledAttrs = useGetXstyledProps(rest);
|
|
42
14
|
const globalAttrs = useGetGlobalAttributes(rest);
|
|
43
15
|
React2.Children.forEach(children, (child, index) => childrenWithIndex.push(React2.cloneElement(child, {
|
|
44
16
|
dsIndex: index
|
|
45
17
|
})));
|
|
46
|
-
return /* @__PURE__ */ React2.createElement(StyledContainer,
|
|
47
|
-
"data-testid": DSAccordionDataTestid.GROUP
|
|
48
|
-
|
|
18
|
+
return /* @__PURE__ */ React2.createElement(StyledContainer, {
|
|
19
|
+
"data-testid": DSAccordionDataTestid.GROUP,
|
|
20
|
+
...containerProps,
|
|
21
|
+
...globalAttrs,
|
|
22
|
+
...xstyledAttrs
|
|
23
|
+
}, childrenWithIndex);
|
|
49
24
|
};
|
|
50
25
|
export {
|
|
51
26
|
AccordionContent
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/accordionContent/AccordionContent.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-utilities';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDatatestid';\nimport { StyledContainer } from './styles';\nimport type { DSAccordionT } from '../../react-desc-prop-types';\n\nexport const AccordionContent = (): JSX.Element => {\n const {\n props: { containerProps, children, ...rest },\n } = useContext(DSAccordionContext);\n\n const childrenWithIndex: React.ReactElement<DSAccordionT.InternalItemProps>[] = [];\n\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const globalAttrs = useGetGlobalAttributes(rest);\n\n React.Children.forEach(children, (child, index) =>\n childrenWithIndex.push(\n React.cloneElement(child, {\n dsIndex: index,\n }),\n ),\n );\n\n return (\n <StyledContainer data-testid={DSAccordionDataTestid.GROUP} {...containerProps} {...globalAttrs} {...xstyledAttrs}>\n {childrenWithIndex}\n </StyledContainer>\n );\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACAA;AACA;AACA;AACA;AACA;AAGO,MAAM,mBAAmB,MAAmB;AACjD,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,aAAa;AAAA,MACpC,WAAW,kBAAkB;AAEjC,QAAM,oBAA0E,CAAC;AAEjF,QAAM,eAAe,mBAAmB,IAAI;AAE5C,QAAM,cAAc,uBAAuB,IAAI;AAE/C,SAAM,SAAS,QAAQ,UAAU,CAAC,OAAO,UACvC,kBAAkB,KAChB,OAAM,aAAa,OAAO;AAAA,IACxB,SAAS;AAAA,EACX,CAAC,CACH,CACF;AAEA,SACE,qCAAC;AAAA,IAAgB,eAAa,sBAAsB;AAAA,IAAQ,GAAG;AAAA,IAAiB,GAAG;AAAA,IAAc,GAAG;AAAA,KACjG,iBACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
2
|
import * as React from "react";
|
|
34
3
|
import React2, { useState, useContext, useCallback, useMemo } from "react";
|
|
35
4
|
import {
|
|
@@ -60,7 +29,7 @@ import { DSAccordionDataTestid } from "../../exported-related/DSAccordionDatates
|
|
|
60
29
|
import { accordionItemPropTypes } from "../../react-desc-prop-types";
|
|
61
30
|
const DSAccordionItem = (props) => {
|
|
62
31
|
const propsWithDefaults = useMemoMergePropsWithDefault(props, accordionItemDefaultProps);
|
|
63
|
-
const
|
|
32
|
+
const {
|
|
64
33
|
children,
|
|
65
34
|
title,
|
|
66
35
|
secondaryTitle,
|
|
@@ -70,20 +39,10 @@ const DSAccordionItem = (props) => {
|
|
|
70
39
|
value,
|
|
71
40
|
disabled,
|
|
72
41
|
dsIndex,
|
|
73
|
-
renderCustomActions
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"secondaryTitle",
|
|
78
|
-
"customActions",
|
|
79
|
-
"iconOpened",
|
|
80
|
-
"iconClosed",
|
|
81
|
-
"value",
|
|
82
|
-
"disabled",
|
|
83
|
-
"dsIndex",
|
|
84
|
-
"renderCustomActions"
|
|
85
|
-
]);
|
|
86
|
-
const _b = useGetGlobalAttributes(rest), { className } = _b, globalAttrs = __objRest(_b, ["className"]);
|
|
42
|
+
renderCustomActions,
|
|
43
|
+
...rest
|
|
44
|
+
} = propsWithDefaults;
|
|
45
|
+
const { className, ...globalAttrs } = useGetGlobalAttributes(rest);
|
|
87
46
|
const xstyledAttrs = useGetXstyledProps(rest);
|
|
88
47
|
const { handleOnClick, handleOnKeyDown, selected } = useAccordionItem({ value, disabled });
|
|
89
48
|
const {
|
|
@@ -100,19 +59,16 @@ const DSAccordionItem = (props) => {
|
|
|
100
59
|
if (!isDSMobile && customActions?.length > 0)
|
|
101
60
|
return /* @__PURE__ */ React2.createElement(StyledItemCustomActions, {
|
|
102
61
|
isDSMobile
|
|
103
|
-
}, customActions?.map((
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
e
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
buttonType: BUTTON_TYPE.SECONDARY
|
|
114
|
-
}));
|
|
115
|
-
}));
|
|
62
|
+
}, customActions?.map(({ onClick, id, ...otherProps }) => /* @__PURE__ */ React2.createElement(DSButton, {
|
|
63
|
+
key: id,
|
|
64
|
+
onClick: (e) => {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
if (onClick)
|
|
67
|
+
onClick(e);
|
|
68
|
+
},
|
|
69
|
+
...otherProps,
|
|
70
|
+
buttonType: BUTTON_TYPE.SECONDARY
|
|
71
|
+
})));
|
|
116
72
|
if (!isDSMobile && renderCustomActions)
|
|
117
73
|
return /* @__PURE__ */ React2.createElement(StyledItemCustomActions, {
|
|
118
74
|
isDSMobile
|
|
@@ -125,14 +81,14 @@ const DSAccordionItem = (props) => {
|
|
|
125
81
|
const handleOnBlur = useCallback(() => setShowPopover(false), []);
|
|
126
82
|
const Titles = useMemo(() => {
|
|
127
83
|
if ((isPrimaryShowingEllipsis || isSecondaryShowingEllipsis) && !isDSMobile)
|
|
128
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledPrimaryTitle,
|
|
129
|
-
ref: setPrimaryElement
|
|
130
|
-
|
|
84
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledPrimaryTitle, {
|
|
85
|
+
ref: setPrimaryElement,
|
|
86
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
131
87
|
disabled,
|
|
132
88
|
isDSMobile,
|
|
133
89
|
selected,
|
|
134
90
|
withSecondaryTitle: secondaryTitle
|
|
135
|
-
}
|
|
91
|
+
}, title), !isDSMobile && secondaryTitle && /* @__PURE__ */ React2.createElement(StyledSecondaryTitle, {
|
|
136
92
|
ref: setSecondaryElement,
|
|
137
93
|
disabled,
|
|
138
94
|
selected
|
|
@@ -140,14 +96,14 @@ const DSAccordionItem = (props) => {
|
|
|
140
96
|
referenceElement,
|
|
141
97
|
showPopover
|
|
142
98
|
}, /* @__PURE__ */ React2.createElement(StyledTooltipContent, null, /* @__PURE__ */ React2.createElement("p", null, title), /* @__PURE__ */ React2.createElement("p", null, " ", secondaryTitle))));
|
|
143
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledPrimaryTitle,
|
|
144
|
-
ref: setPrimaryElement
|
|
145
|
-
|
|
99
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(StyledPrimaryTitle, {
|
|
100
|
+
ref: setPrimaryElement,
|
|
101
|
+
...title ? { id: `accordion_${title || ""}id` } : void 0,
|
|
146
102
|
disabled,
|
|
147
103
|
isDSMobile,
|
|
148
104
|
selected,
|
|
149
105
|
withSecondaryTitle: secondaryTitle
|
|
150
|
-
}
|
|
106
|
+
}, title), !isDSMobile && secondaryTitle && /* @__PURE__ */ React2.createElement(StyledSecondaryTitle, {
|
|
151
107
|
ref: setSecondaryElement,
|
|
152
108
|
disabled,
|
|
153
109
|
selected
|
|
@@ -165,13 +121,14 @@ const DSAccordionItem = (props) => {
|
|
|
165
121
|
selected,
|
|
166
122
|
title
|
|
167
123
|
]);
|
|
168
|
-
return /* @__PURE__ */ React2.createElement(StyledItemContainer,
|
|
124
|
+
return /* @__PURE__ */ React2.createElement(StyledItemContainer, {
|
|
169
125
|
"data-testid": DSAccordionDataTestid.ITEM.CONTAINER,
|
|
170
|
-
className
|
|
171
|
-
|
|
126
|
+
className,
|
|
127
|
+
...xstyledAttrs
|
|
128
|
+
}, /* @__PURE__ */ React2.createElement(StyledItemHeaderContainer, {
|
|
172
129
|
disabled,
|
|
173
130
|
ref: setReferenceElement
|
|
174
|
-
}, /* @__PURE__ */ React2.createElement(StyledItemHeader,
|
|
131
|
+
}, /* @__PURE__ */ React2.createElement(StyledItemHeader, {
|
|
175
132
|
type: "button",
|
|
176
133
|
withCustomActions: (customActions?.length > 0 || renderCustomActions !== void 0) && !isDSMobile,
|
|
177
134
|
withSecondaryTitle: secondaryTitle,
|
|
@@ -188,8 +145,9 @@ const DSAccordionItem = (props) => {
|
|
|
188
145
|
"aria-disabled": disabled,
|
|
189
146
|
"aria-controls": `ds-accordion-content-${value}`,
|
|
190
147
|
onFocus: handleOnFocus,
|
|
191
|
-
onBlur: handleOnBlur
|
|
192
|
-
|
|
148
|
+
onBlur: handleOnBlur,
|
|
149
|
+
...globalAttrs
|
|
150
|
+
}, /* @__PURE__ */ React2.createElement(StyledItemAddon, {
|
|
193
151
|
disabled,
|
|
194
152
|
isDSMobile
|
|
195
153
|
}, selected ? /* @__PURE__ */ React2.createElement(IconOpened, {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/accordionItem/DSAccordionItem.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState, useContext, useCallback, useMemo, WeakValidationMap } from 'react';\nimport {\n useMemoMergePropsWithDefault,\n describe,\n useIsShowingEllipsis,\n useGetGlobalAttributes,\n useGetXstyledProps,\n} from '@elliemae/ds-utilities';\nimport { DSButton, BUTTON_TYPE } from '@elliemae/ds-button';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { accordionItemDefaultProps } from '../../defaultProps';\nimport {\n StyledItemAddon,\n StyledItemContainer,\n StyledItemContent,\n StyledItemCustomActions,\n StyledItemHeader,\n StyledItemHeaderContainer,\n StyledItemTitles,\n StyledPrimaryTitle,\n StyledSecondaryTitle,\n StyledTooltipContent,\n} from './styles';\nimport { useAccordionItem } from './useAccordionItem';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport { DSAccordionDataTestid } from '../../exported-related/DSAccordionDatatestid';\nimport { accordionItemPropTypes } from '../../react-desc-prop-types';\nimport type { DSAccordionT } from '../../react-desc-prop-types';\n\nconst DSAccordionItem = (props: DSAccordionT.ItemProps): JSX.Element => {\n const propsWithDefaults = useMemoMergePropsWithDefault(\n props,\n accordionItemDefaultProps,\n ) as DSAccordionT.InternalItemProps;\n\n const {\n children,\n title,\n secondaryTitle,\n customActions,\n iconOpened: IconOpened,\n iconClosed: IconClosed,\n value,\n disabled,\n dsIndex,\n renderCustomActions,\n ...rest\n } = propsWithDefaults;\n\n const { className, ...globalAttrs } = useGetGlobalAttributes(rest);\n const xstyledAttrs = useGetXstyledProps(rest);\n\n const { handleOnClick, handleOnKeyDown, selected } = useAccordionItem({ value, disabled });\n const {\n allChildrenReferences,\n actualActiveValue,\n props: { isDSMobile },\n } = useContext(DSAccordionContext);\n\n const onKeyDownWithIndex = useCallback(\n (e: React.KeyboardEvent) => {\n handleOnKeyDown(e, dsIndex);\n },\n [dsIndex, handleOnKeyDown],\n );\n\n const [showPopover, setShowPopover] = useState(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>();\n\n const CustomActionsContent = useMemo(() => {\n if (!isDSMobile && customActions?.length > 0)\n return (\n <StyledItemCustomActions isDSMobile={isDSMobile}>\n {customActions?.map(({ onClick, id, ...otherProps }) => (\n <DSButton\n key={id}\n onClick={(e: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement>): void => {\n e.stopPropagation();\n if (onClick) onClick(e as React.MouseEvent<HTMLElement, MouseEvent>);\n }}\n {...otherProps}\n buttonType={BUTTON_TYPE.SECONDARY}\n />\n ))}\n </StyledItemCustomActions>\n );\n\n if (!isDSMobile && renderCustomActions)\n return (\n <StyledItemCustomActions isDSMobile={isDSMobile}>\n {renderCustomActions({ allRefs: allChildrenReferences, actualActiveValue })}\n </StyledItemCustomActions>\n );\n return null;\n }, [actualActiveValue, allChildrenReferences, customActions, isDSMobile, renderCustomActions]);\n\n const { isShowingEllipsis: isPrimaryShowingEllipsis, setElement: setPrimaryElement } = useIsShowingEllipsis();\n\n const { isShowingEllipsis: isSecondaryShowingEllipsis, setElement: setSecondaryElement } = useIsShowingEllipsis();\n\n const handleOnFocus = useCallback(\n () => setShowPopover(isPrimaryShowingEllipsis || isSecondaryShowingEllipsis),\n [isPrimaryShowingEllipsis, isSecondaryShowingEllipsis],\n );\n\n const handleOnBlur = useCallback(() => setShowPopover(false), []);\n\n // eslint-disable-next-line complexity\n const Titles = useMemo(() => {\n if ((isPrimaryShowingEllipsis || isSecondaryShowingEllipsis) && !isDSMobile)\n return (\n <>\n <StyledPrimaryTitle\n ref={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id` } : undefined)}\n disabled={disabled}\n isDSMobile={isDSMobile}\n selected={selected}\n withSecondaryTitle={secondaryTitle}\n >\n {title}\n </StyledPrimaryTitle>\n {!isDSMobile && secondaryTitle && (\n <StyledSecondaryTitle ref={setSecondaryElement} disabled={disabled} selected={selected}>\n {secondaryTitle}\n </StyledSecondaryTitle>\n )}\n <DSPopperJS referenceElement={referenceElement} showPopover={showPopover}>\n <StyledTooltipContent>\n <p>{title}</p>\n <p> {secondaryTitle}</p>\n </StyledTooltipContent>\n </DSPopperJS>\n </>\n );\n\n return (\n <>\n <StyledPrimaryTitle\n ref={setPrimaryElement}\n {...(title ? { id: `accordion_${title || ''}id` } : undefined)}\n disabled={disabled}\n isDSMobile={isDSMobile}\n selected={selected}\n withSecondaryTitle={secondaryTitle}\n >\n {title}\n </StyledPrimaryTitle>\n {!isDSMobile && secondaryTitle && (\n <StyledSecondaryTitle ref={setSecondaryElement} disabled={disabled} selected={selected}>\n {secondaryTitle}\n </StyledSecondaryTitle>\n )}\n </>\n );\n }, [\n disabled,\n isDSMobile,\n isPrimaryShowingEllipsis,\n isSecondaryShowingEllipsis,\n referenceElement,\n secondaryTitle,\n setPrimaryElement,\n setSecondaryElement,\n showPopover,\n selected,\n title,\n ]);\n\n return (\n <StyledItemContainer data-testid={DSAccordionDataTestid.ITEM.CONTAINER} className={className} {...xstyledAttrs}>\n <StyledItemHeaderContainer disabled={disabled} ref={setReferenceElement}>\n <StyledItemHeader\n type=\"button\"\n withCustomActions={(customActions?.length > 0 || renderCustomActions !== undefined) && !isDSMobile}\n withSecondaryTitle={secondaryTitle}\n onClick={handleOnClick}\n tabIndex={!disabled ? 0 : undefined}\n disabled={disabled}\n data-disabled={disabled}\n ref={allChildrenReferences[dsIndex]}\n onKeyDown={onKeyDownWithIndex}\n isDSMobile={isDSMobile}\n data-testid={DSAccordionDataTestid.ITEM.HEADER}\n id={`ds-accordion-header-${value}`}\n aria-expanded={selected}\n aria-disabled={disabled}\n aria-controls={`ds-accordion-content-${value}`}\n onFocus={handleOnFocus}\n onBlur={handleOnBlur}\n {...globalAttrs}\n >\n <StyledItemAddon disabled={disabled} isDSMobile={isDSMobile}>\n {selected ? <IconOpened isDSMobile={isDSMobile} /> : <IconClosed isDSMobile={isDSMobile} />}\n </StyledItemAddon>\n <StyledItemTitles\n onMouseEnter={handleOnFocus}\n onMouseLeave={handleOnBlur}\n isDSMobile={isDSMobile}\n withSecondaryTitle={secondaryTitle}\n selected={selected}\n >\n {Titles}\n </StyledItemTitles>\n </StyledItemHeader>\n {CustomActionsContent}\n </StyledItemHeaderContainer>\n {selected && (\n <StyledItemContent\n data-testid={DSAccordionDataTestid.ITEM.CONTENT}\n aria-labelledby={`ds-accordion-header-${value}`}\n role=\"region\"\n isDSMobile={isDSMobile}\n id={`ds-accordion-content-${value}`}\n >\n {children}\n </StyledItemContent>\n )}\n </StyledItemContainer>\n );\n};\n\nDSAccordionItem.displayName = 'DSAccordionItem';\nconst DSAccordionItemWithSchema = describe(DSAccordionItem);\nDSAccordionItemWithSchema.propTypes = accordionItemPropTypes as WeakValidationMap<unknown>;\n\nexport { DSAccordionItem, DSAccordionItemWithSchema };\nexport default DSAccordionItem;\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACCA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA;AACA;AACA;AACA;AAGA,MAAM,kBAAkB,CAAC,UAA+C;AACtE,QAAM,oBAAoB,6BACxB,OACA,yBACF;AAEA,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,OACG;AAAA,MACD;AAEJ,QAAM,EAAE,cAAc,gBAAgB,uBAAuB,IAAI;AACjE,QAAM,eAAe,mBAAmB,IAAI;AAE5C,QAAM,EAAE,eAAe,iBAAiB,aAAa,iBAAiB,EAAE,OAAO,SAAS,CAAC;AACzF,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,OAAO,EAAE;AAAA,MACP,WAAW,kBAAkB;AAEjC,QAAM,qBAAqB,YACzB,CAAC,MAA2B;AAC1B,oBAAgB,GAAG,OAAO;AAAA,EAC5B,GACA,CAAC,SAAS,eAAe,CAC3B;AAEA,QAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;AACpD,QAAM,CAAC,kBAAkB,uBAAuB,SAA6B;AAE7E,QAAM,uBAAuB,QAAQ,MAAM;AACzC,QAAI,CAAC,cAAc,eAAe,SAAS;AACzC,aACE,qCAAC;AAAA,QAAwB;AAAA,SACtB,eAAe,IAAI,CAAC,EAAE,SAAS,OAAO,iBACrC,qCAAC;AAAA,QACC,KAAK;AAAA,QACL,SAAS,CAAC,MAA0F;AAClG,YAAE,gBAAgB;AAClB,cAAI;AAAS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AAc;AAC9B,MAAM,4BAA4B,SAAS,eAAe;AAC1D,0BAA0B,YAAY;AAGtC,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
import * as React from "react";
|
|
22
3
|
import { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from "@elliemae/ds-utilities";
|
|
23
|
-
const accordionItemPropTypes =
|
|
4
|
+
const accordionItemPropTypes = {
|
|
5
|
+
...globalAttributesPropTypes,
|
|
6
|
+
...xstyledPropTypes,
|
|
24
7
|
children: PropTypes.node.description("Dimsum AccordionItem content.").isRequired,
|
|
25
8
|
title: PropTypes.string.description("Set a primary title."),
|
|
26
9
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description("Dimsum AccordionItem value, this value should be unique.").isRequired,
|
|
@@ -29,8 +12,10 @@ const accordionItemPropTypes = __spreadProps(__spreadValues(__spreadValues({}, g
|
|
|
29
12
|
secondaryTitle: PropTypes.string.description("Set a secondary title"),
|
|
30
13
|
customActions: PropTypes.arrayOf(PropTypes.object).description("Set Dimsum AccordionItem custom actions.").deprecated({ version: "3.x" }),
|
|
31
14
|
renderCustomActions: PropTypes.func.description("This property will render any JSX in the header controls area. You can access to all references and active values within the props.")
|
|
32
|
-
}
|
|
33
|
-
const accordionPropTypes =
|
|
15
|
+
};
|
|
16
|
+
const accordionPropTypes = {
|
|
17
|
+
...globalAttributesPropTypes,
|
|
18
|
+
...xstyledPropTypes,
|
|
34
19
|
containerProps: PropTypes.object.description("Adds props to the container."),
|
|
35
20
|
activeValue: PropTypes.oneOfType([
|
|
36
21
|
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
|
|
@@ -40,7 +25,7 @@ const accordionPropTypes = __spreadProps(__spreadValues(__spreadValues({}, globa
|
|
|
40
25
|
children: PropTypes.node.description("Dimsum AccordionItems to show."),
|
|
41
26
|
allowMultipleOpen: PropTypes.bool.description("Allows multiple Dimsum AccordionItems to be open at the same time."),
|
|
42
27
|
onChange: PropTypes.func.description("Callback function once the Dimsum Accordion changes.")
|
|
43
|
-
}
|
|
28
|
+
};
|
|
44
29
|
export {
|
|
45
30
|
accordionItemPropTypes,
|
|
46
31
|
accordionPropTypes
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, globalAttributesPropTypes, xstyledPropTypes } from '@elliemae/ds-utilities';\nimport type { DSAccordionInternalsT } from './sharedTypes';\n\nexport declare namespace DSAccordionT {\n export interface DefaultProps {\n containerProps: Record<string, unknown>;\n allowMultipleOpen: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n }\n\n export interface OptionalProps {\n activeValue?: DSAccordionInternalsT.InternalActiveValue;\n }\n\n export interface RequiredProps {\n children: React.ReactElement<ItemProps>[];\n }\n\n export interface Props extends OptionalProps, Partial<Omit<DefaultProps, 'children'>>, RequiredProps {}\n\n export interface ItemDefaultProps {\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n title: string;\n customActions: DSAccordionInternalsT.CustomActions[];\n disabled: boolean;\n }\n\n export interface ItemOptionalProps {\n secondaryTitle?: string;\n renderCustomActions?: (props: {\n allRefs: DSAccordionInternalsT.AllChildrenReferences;\n actualActiveValue: DSAccordionInternalsT.InternalActiveValue;\n }) => JSX.Element;\n }\n\n export interface ItemRequiredProps {\n children: React.ReactNode;\n value: string | number;\n }\n\n export interface ItemProps extends ItemRequiredProps, ItemOptionalProps, Partial<ItemDefaultProps> {}\n\n export interface InternalItemProps\n extends ItemRequiredProps,\n ItemOptionalProps,\n Omit<ItemDefaultProps, 'disabled' | 'customActions' | 'iconClosed' | 'iconOpened'> {\n dsIndex: number;\n disabled: boolean;\n customActions: DSAccordionInternalsT.CustomActions[];\n iconClosed: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n iconOpened: React.MemoExoticComponent<React.FunctionComponent<DSAccordionInternalsT.DefaultIconProps>>;\n }\n\n export interface InternalProps\n extends OptionalProps,\n Partial<Omit<DefaultProps, 'children' | 'isDSMobile' | 'onChange'>> {\n children: React.ReactElement<InternalItemProps>[];\n isDSMobile: boolean;\n onChange: (value: (string | number)[] | string | number | null, e: React.MouseEvent | React.KeyboardEvent) => void;\n }\n}\n\nexport const accordionItemPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n children: PropTypes.node.description('Dimsum AccordionItem content.').isRequired,\n title: PropTypes.string.description('Set a primary title.'),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).description(\n 'Dimsum AccordionItem value, this value should be unique.',\n ).isRequired,\n iconClosed: PropTypes.node.description('Custom Dimsum Icon when it is closed.').deprecated({ version: '3.x' }),\n iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.').deprecated({ version: '3.x' }),\n secondaryTitle: PropTypes.string.description('Set a secondary title'),\n customActions: PropTypes.arrayOf(PropTypes.object)\n .description('Set Dimsum AccordionItem custom actions.')\n .deprecated({ version: '3.x' }),\n renderCustomActions: PropTypes.func.description(\n 'This property will render any JSX in the header controls area. You can access to all references and active values within the props.',\n ),\n};\n\nexport const accordionPropTypes = {\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n containerProps: PropTypes.object.description('Adds props to the container.'),\n activeValue: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),\n PropTypes.string,\n PropTypes.number,\n ]).description('Selected active value. This property makes the component a controlled one.'),\n children: PropTypes.node.description('Dimsum AccordionItems to show.'),\n allowMultipleOpen: PropTypes.bool.description('Allows multiple Dimsum AccordionItems to be open at the same time.'),\n onChange: PropTypes.func.description('Callback function once the Dimsum Accordion changes.'),\n};\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";AAAA;ACCA;AAiEO,MAAM,yBAAyB;AAAA,EACpC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,UAAU,KAAK,YAAY,+BAA+B,EAAE;AAAA,EACtE,OAAO,UAAU,OAAO,YAAY,sBAAsB;AAAA,EAC1D,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,EAAE,YAC/D,0DACF,EAAE;AAAA,EACF,YAAY,UAAU,KAAK,YAAY,uCAAuC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC7G,YAAY,UAAU,KAAK,YAAY,qCAAqC,EAAE,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAC3G,gBAAgB,UAAU,OAAO,YAAY,uBAAuB;AAAA,EACpE,eAAe,UAAU,QAAQ,UAAU,MAAM,EAC9C,YAAY,0CAA0C,EACtD,WAAW,EAAE,SAAS,MAAM,CAAC;AAAA,EAChC,qBAAqB,UAAU,KAAK,YAClC,qIACF;AACF;AAEO,MAAM,qBAAqB;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH,gBAAgB,UAAU,OAAO,YAAY,8BAA8B;AAAA,EAC3E,aAAa,UAAU,UAAU;AAAA,IAC/B,UAAU,QAAQ,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC;AAAA,IAC3E,UAAU;AAAA,IACV,UAAU;AAAA,EACZ,CAAC,EAAE,YAAY,4EAA4E;AAAA,EAC3F,UAAU,UAAU,KAAK,YAAY,gCAAgC;AAAA,EACrE,mBAAmB,UAAU,KAAK,YAAY,oEAAoE;AAAA,EAClH,UAAU,UAAU,KAAK,YAAY,sDAAsD;AAC7F;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-accordion",
|
|
3
|
-
"version": "3.3.0-next.
|
|
3
|
+
"version": "3.3.0-next.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Accordion",
|
|
6
6
|
"files": [
|
|
@@ -83,11 +83,11 @@
|
|
|
83
83
|
"indent": 4
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@elliemae/ds-button": "3.3.0-next.
|
|
87
|
-
"@elliemae/ds-icons": "3.3.0-next.
|
|
88
|
-
"@elliemae/ds-popperjs": "3.3.0-next.
|
|
89
|
-
"@elliemae/ds-system": "3.3.0-next.
|
|
90
|
-
"@elliemae/ds-utilities": "3.3.0-next.
|
|
86
|
+
"@elliemae/ds-button": "3.3.0-next.7",
|
|
87
|
+
"@elliemae/ds-icons": "3.3.0-next.7",
|
|
88
|
+
"@elliemae/ds-popperjs": "3.3.0-next.7",
|
|
89
|
+
"@elliemae/ds-system": "3.3.0-next.7",
|
|
90
|
+
"@elliemae/ds-utilities": "3.3.0-next.7"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
93
|
"@testing-library/jest-dom": "~5.16.4",
|