@elliemae/ds-data-table-expand-cell 3.31.0-next.6
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/DSDataTableExpandCell.js +129 -0
- package/dist/cjs/DSDataTableExpandCell.js.map +7 -0
- package/dist/cjs/config/useDataTableExpandCell.js +54 -0
- package/dist/cjs/config/useDataTableExpandCell.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +40 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +47 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +41 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +54 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/esm/DSDataTableExpandCell.js +99 -0
- package/dist/esm/DSDataTableExpandCell.js.map +7 -0
- package/dist/esm/config/useDataTableExpandCell.js +24 -0
- package/dist/esm/config/useDataTableExpandCell.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +10 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +17 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +24 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/types/DSDataTableExpandCell.d.ts +9 -0
- package/dist/types/config/useDataTableExpandCell.d.ts +11 -0
- package/dist/types/config/useValidateProps.d.ts +3 -0
- package/dist/types/constants/index.d.ts +6 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/react-desc-prop-types.d.ts +24 -0
- package/dist/types/tests/DSDataTableExpandCell.test.d.ts +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSDataTableExpandCell_exports = {};
|
|
30
|
+
__export(DSDataTableExpandCell_exports, {
|
|
31
|
+
DSDataTableExpandCell: () => DSDataTableExpandCell,
|
|
32
|
+
DSDataTableExpandCellWithSchema: () => DSDataTableExpandCellWithSchema,
|
|
33
|
+
StyledCaretContainer: () => StyledCaretContainer,
|
|
34
|
+
disabledCss: () => disabledCss
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(DSDataTableExpandCell_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var import_react = require("react");
|
|
40
|
+
var import_ds_icons = require("@elliemae/ds-icons");
|
|
41
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
42
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
43
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
44
|
+
var import_useDataTableExpandCell = require("./config/useDataTableExpandCell.js");
|
|
45
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
46
|
+
var import_constants = require("./constants/index.js");
|
|
47
|
+
var import_ds_data_table_cell = require("@elliemae/ds-data-table-cell");
|
|
48
|
+
const StyledWrapper = (0, import_ds_system.styled)(import_ds_data_table_cell.DSDataTableCell, {
|
|
49
|
+
name: import_constants.DSDataTableExpandCellName,
|
|
50
|
+
slot: import_constants.DATA_TABLE_EXPAND_CELL_SLOTS.ROOT
|
|
51
|
+
})`
|
|
52
|
+
justify-content: center;
|
|
53
|
+
:focus-within {
|
|
54
|
+
&:after {
|
|
55
|
+
display: block;
|
|
56
|
+
content: ' ';
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
left: 0;
|
|
60
|
+
right: 0;
|
|
61
|
+
bottom: 0;
|
|
62
|
+
border: 2px solid brand-700;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
z-index: 7;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
svg {
|
|
68
|
+
fill: brand-800;
|
|
69
|
+
}
|
|
70
|
+
`;
|
|
71
|
+
const disabledCss = import_ds_system.css`
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
`;
|
|
75
|
+
const StyledCaretContainer = (0, import_ds_system.styled)("span", {
|
|
76
|
+
name: import_constants.DSDataTableExpandCellName,
|
|
77
|
+
slot: import_constants.DATA_TABLE_EXPAND_CELL_SLOTS.CARET_CONTAINER
|
|
78
|
+
})`
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
box-sizing: border-box;
|
|
81
|
+
outline: none;
|
|
82
|
+
display: flex;
|
|
83
|
+
justify-content: center;
|
|
84
|
+
align-items: center;
|
|
85
|
+
${({ disabled }) => disabled && disabledCss}
|
|
86
|
+
`;
|
|
87
|
+
const DSDataTableExpandCell = (props) => {
|
|
88
|
+
const { propsWithDefault, xstyledProps } = (0, import_useDataTableExpandCell.useDataTableExpandCell)(props);
|
|
89
|
+
const ownerPropsConfig = (0, import_ds_utilities.useOwnerProps)(propsWithDefault);
|
|
90
|
+
const { className, icon, onClick, expanded, disabled } = propsWithDefault;
|
|
91
|
+
const shouldPrintCaret = icon === "caret";
|
|
92
|
+
const shouldPrintArrow = icon === "arrow";
|
|
93
|
+
const Caret = expanded ? import_ds_icons.ArrowheadDown : import_ds_icons.ArrowheadRight;
|
|
94
|
+
const onKeyDownHandler = (0, import_react.useCallback)(
|
|
95
|
+
(e) => {
|
|
96
|
+
if (["Enter", "Space"].includes(e.code)) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
onClick?.(e);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
[onClick]
|
|
102
|
+
);
|
|
103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledWrapper, { className, ...ownerPropsConfig, ...xstyledProps, children: shouldPrintCaret ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
104
|
+
StyledCaretContainer,
|
|
105
|
+
{
|
|
106
|
+
role: "button",
|
|
107
|
+
title: "Toggle Row Expanded",
|
|
108
|
+
onClick,
|
|
109
|
+
onKeyDown: onKeyDownHandler,
|
|
110
|
+
"aria-expanded": expanded,
|
|
111
|
+
disabled,
|
|
112
|
+
"aria-disabled": disabled,
|
|
113
|
+
...ownerPropsConfig,
|
|
114
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
115
|
+
Caret,
|
|
116
|
+
{
|
|
117
|
+
size: "s",
|
|
118
|
+
"data-is-col-expanded": expanded,
|
|
119
|
+
"data-role": "row-expander-col",
|
|
120
|
+
color: disabled ? ["neutral", "400"] : ["brand-primary", "600"]
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
) : shouldPrintArrow ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.ArrowShortReturn, { size: "s", style: { transform: "rotate(90deg) scaleY(-1)" }, color: ["brand-primary", "600"] }) : null });
|
|
125
|
+
};
|
|
126
|
+
DSDataTableExpandCell.displayName = import_constants.DSDataTableExpandCellName;
|
|
127
|
+
const DSDataTableExpandCellWithSchema = (0, import_ds_props_helpers.describe)(DSDataTableExpandCell);
|
|
128
|
+
DSDataTableExpandCellWithSchema.propTypes = import_react_desc_prop_types.DSDataTableExpandCellPropTypesSchema;
|
|
129
|
+
//# sourceMappingURL=DSDataTableExpandCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSDataTableExpandCell.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { ArrowShortReturn, ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { css, styled } from '@elliemae/ds-system';\nimport { type DSDataTableExpandCellT, DSDataTableExpandCellPropTypesSchema } from './react-desc-prop-types.js';\nimport { useDataTableExpandCell } from './config/useDataTableExpandCell.js';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { DATA_TABLE_EXPAND_CELL_SLOTS, DSDataTableExpandCellName } from './constants/index.js';\nimport { DSDataTableCell } from '@elliemae/ds-data-table-cell';\n\nconst StyledWrapper = styled(DSDataTableCell, {\n name: DSDataTableExpandCellName,\n slot: DATA_TABLE_EXPAND_CELL_SLOTS.ROOT,\n})`\n justify-content: center;\n :focus-within {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid brand-700;\n pointer-events: none;\n z-index: 7;\n }\n }\n svg {\n fill: brand-800;\n }\n`;\n\nexport const disabledCss = css`\n cursor: not-allowed;\n pointer-events: none;\n`;\n\nexport const StyledCaretContainer = styled('span', {\n name: DSDataTableExpandCellName,\n slot: DATA_TABLE_EXPAND_CELL_SLOTS.CARET_CONTAINER,\n})<{ disabled: boolean }>`\n cursor: pointer;\n box-sizing: border-box;\n outline: none;\n display: flex;\n justify-content: center;\n align-items: center;\n ${({ disabled }) => disabled && disabledCss}\n`;\n\nconst DSDataTableExpandCell: React.ComponentType<DSDataTableExpandCellT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = useDataTableExpandCell(props);\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n const { className, icon, onClick, expanded, disabled } = propsWithDefault;\n\n const shouldPrintCaret = icon === 'caret';\n const shouldPrintArrow = icon === 'arrow';\n const Caret = expanded ? ArrowheadDown : ArrowheadRight;\n\n const onKeyDownHandler = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n onClick?.(e);\n }\n },\n [onClick],\n );\n\n return (\n <StyledWrapper className={className} {...ownerPropsConfig} {...xstyledProps}>\n {shouldPrintCaret ? (\n <StyledCaretContainer\n role=\"button\"\n title=\"Toggle Row Expanded\"\n onClick={onClick}\n onKeyDown={onKeyDownHandler}\n aria-expanded={expanded}\n disabled={disabled}\n aria-disabled={disabled}\n {...ownerPropsConfig}\n >\n <Caret\n size=\"s\"\n data-is-col-expanded={expanded}\n data-role=\"row-expander-col\"\n color={disabled ? ['neutral', '400'] : ['brand-primary', '600']}\n />\n </StyledCaretContainer>\n ) : shouldPrintArrow ? (\n <ArrowShortReturn size=\"s\" style={{ transform: 'rotate(90deg) scaleY(-1)' }} color={['brand-primary', '600']} />\n ) : null}\n </StyledWrapper>\n );\n};\n\nDSDataTableExpandCell.displayName = DSDataTableExpandCellName;\nconst DSDataTableExpandCellWithSchema = describe(DSDataTableExpandCell);\nDSDataTableExpandCellWithSchema.propTypes = DSDataTableExpandCellPropTypesSchema;\n\nexport { DSDataTableExpandCell, DSDataTableExpandCellWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoFb;AApFV,mBAAmC;AACnC,sBAAgE;AAChE,8BAAyB;AACzB,uBAA4B;AAC5B,mCAAkF;AAClF,oCAAuC;AACvC,0BAA8B;AAC9B,uBAAwE;AACxE,gCAAgC;AAEhC,MAAM,oBAAgB,yBAAO,2CAAiB;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,8CAA6B;AACrC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBM,MAAM,cAAc;AAAA;AAAA;AAAA;AAKpB,MAAM,2BAAuB,yBAAO,QAAQ;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,8CAA6B;AACrC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOG,CAAC,EAAE,SAAS,MAAM,YAAY;AAAA;AAGlC,MAAM,wBAA2E,CAAC,UAAU;AAC1F,QAAM,EAAE,kBAAkB,aAAa,QAAI,sDAAuB,KAAK;AACvE,QAAM,uBAAmB,mCAAc,gBAAgB;AACvD,QAAM,EAAE,WAAW,MAAM,SAAS,UAAU,SAAS,IAAI;AAEzD,QAAM,mBAAmB,SAAS;AAClC,QAAM,mBAAmB,SAAS;AAClC,QAAM,QAAQ,WAAW,gCAAgB;AAEzC,QAAM,uBAAmB;AAAA,IACvB,CAAC,MAA2B;AAC1B,UAAI,CAAC,SAAS,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG;AACvC,UAAE,eAAe;AACjB,kBAAU,CAAC;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SACE,4CAAC,iBAAc,WAAuB,GAAG,kBAAmB,GAAG,cAC5D,6BACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAM;AAAA,MACN;AAAA,MACA,WAAW;AAAA,MACX,iBAAe;AAAA,MACf;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,wBAAsB;AAAA,UACtB,aAAU;AAAA,UACV,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK;AAAA;AAAA,MAChE;AAAA;AAAA,EACF,IACE,mBACF,4CAAC,oCAAiB,MAAK,KAAI,OAAO,EAAE,WAAW,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAC5G,MACN;AAEJ;AAEA,sBAAsB,cAAc;AACpC,MAAM,sCAAkC,kCAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useDataTableExpandCell_exports = {};
|
|
30
|
+
__export(useDataTableExpandCell_exports, {
|
|
31
|
+
useDataTableExpandCell: () => useDataTableExpandCell
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useDataTableExpandCell_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
|
38
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
|
39
|
+
const useDataTableExpandCell = (propsFromUser) => {
|
|
40
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
|
41
|
+
propsFromUser,
|
|
42
|
+
import_react_desc_prop_types.defaultProps
|
|
43
|
+
);
|
|
44
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSDataTableExpandCellPropTypes);
|
|
45
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
|
46
|
+
return import_react.default.useMemo(
|
|
47
|
+
() => ({
|
|
48
|
+
propsWithDefault,
|
|
49
|
+
xstyledProps
|
|
50
|
+
}),
|
|
51
|
+
[propsWithDefault, xstyledProps]
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=useDataTableExpandCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useDataTableExpandCell.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSDataTableExpandCellT, DSDataTableExpandCellPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DataTableExpandCellCTX {\n propsWithDefault: DSDataTableExpandCellT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDataTableExpandCell = (propsFromUser: DSDataTableExpandCellT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDataTableExpandCellT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSDataTableExpandCellPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n }),\n [propsWithDefault, xstyledProps],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,8BAAiE;AACjE,mCAA0F;AAC1F,8BAAiC;AAQ1B,MAAM,yBAAyB,CAAC,kBAAgD;AAIrF,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,2DAA8B;AAIjE,QAAM,mBAAe,4CAAmB,gBAAgB;AAExD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,YAAY;AAAA,EACjC;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useValidateProps_exports = {};
|
|
30
|
+
__export(useValidateProps_exports, {
|
|
31
|
+
useValidateProps: () => useValidateProps
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
|
+
var import_constants = require("../constants/index.js");
|
|
37
|
+
const useValidateProps = (props, propTypes) => {
|
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSDataTableExpandCellName);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSDataTableExpandCellT } from '../react-desc-prop-types.js';\nimport { DSDataTableExpandCellName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSDataTableExpandCellT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSDataTableExpandCellName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAA0C;AAEnC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,0CAAyB;AAC5E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var constants_exports = {};
|
|
30
|
+
__export(constants_exports, {
|
|
31
|
+
DATA_TABLE_EXPAND_CELL_DATA_TESTID: () => DATA_TABLE_EXPAND_CELL_DATA_TESTID,
|
|
32
|
+
DATA_TABLE_EXPAND_CELL_SLOTS: () => DATA_TABLE_EXPAND_CELL_SLOTS,
|
|
33
|
+
DSDataTableExpandCellName: () => DSDataTableExpandCellName
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
+
const DSDataTableExpandCellName = "DSDataTableExpandCell";
|
|
39
|
+
const DATA_TABLE_EXPAND_CELL_SLOTS = {
|
|
40
|
+
ROOT: "root",
|
|
41
|
+
CARET_CONTAINER: "caret-container"
|
|
42
|
+
};
|
|
43
|
+
const DATA_TABLE_EXPAND_CELL_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(
|
|
44
|
+
DSDataTableExpandCellName,
|
|
45
|
+
DATA_TABLE_EXPAND_CELL_SLOTS
|
|
46
|
+
);
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSDataTableExpandCellName = 'DSDataTableExpandCell';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_EXPAND_CELL_SLOTS = {\n ROOT: 'root',\n CARET_CONTAINER: 'caret-container',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_EXPAND_CELL_DATA_TESTID = slotObjectToDataTestIds(\n DSDataTableExpandCellName,\n DATA_TABLE_EXPAND_CELL_SLOTS,\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,4BAA4B;AAGlC,MAAM,+BAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,iBAAiB;AACnB;AAGO,MAAM,yCAAqC;AAAA,EAChD;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
DATA_TABLE_EXPAND_CELL_DATA_TESTID: () => import_constants.DATA_TABLE_EXPAND_CELL_DATA_TESTID,
|
|
32
|
+
DATA_TABLE_EXPAND_CELL_SLOTS: () => import_constants.DATA_TABLE_EXPAND_CELL_SLOTS,
|
|
33
|
+
DSDataTableExpandCell: () => import_DSDataTableExpandCell.DSDataTableExpandCell,
|
|
34
|
+
DSDataTableExpandCellWithSchema: () => import_DSDataTableExpandCell.DSDataTableExpandCellWithSchema
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(src_exports);
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
var import_DSDataTableExpandCell = require("./DSDataTableExpandCell.js");
|
|
39
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
40
|
+
var import_constants = require("./constants/index.js");
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSDataTableExpandCell, DSDataTableExpandCellWithSchema } from './DSDataTableExpandCell.js';\nexport { type DSDataTableExpandCellT } from './react-desc-prop-types.js';\nexport { DATA_TABLE_EXPAND_CELL_SLOTS, DATA_TABLE_EXPAND_CELL_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mCAAuE;AACvE,mCAA4C;AAC5C,uBAAiF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
DSDataTableExpandCellPropTypes: () => DSDataTableExpandCellPropTypes,
|
|
32
|
+
DSDataTableExpandCellPropTypesSchema: () => DSDataTableExpandCellPropTypesSchema,
|
|
33
|
+
defaultProps: () => defaultProps
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_constants = require("./constants/index.js");
|
|
39
|
+
const defaultProps = {
|
|
40
|
+
icon: "none",
|
|
41
|
+
expanded: false,
|
|
42
|
+
disabled: false
|
|
43
|
+
};
|
|
44
|
+
const DSDataTableExpandCellPropTypes = {
|
|
45
|
+
...import_ds_props_helpers.xstyledPropTypes,
|
|
46
|
+
...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSDataTableExpandCellName, import_constants.DATA_TABLE_EXPAND_CELL_SLOTS),
|
|
47
|
+
className: import_ds_props_helpers.PropTypes.string.description("className for the wrapper"),
|
|
48
|
+
expanded: import_ds_props_helpers.PropTypes.bool.description("Determines which caret to print"),
|
|
49
|
+
disabled: import_ds_props_helpers.PropTypes.bool.description("Whether its disabled or not"),
|
|
50
|
+
icon: import_ds_props_helpers.PropTypes.oneOf(["none", "arrow", "caret"]).description("Icon to print"),
|
|
51
|
+
onClick: import_ds_props_helpers.PropTypes.func.description("onClick callback")
|
|
52
|
+
};
|
|
53
|
+
const DSDataTableExpandCellPropTypesSchema = DSDataTableExpandCellPropTypes;
|
|
54
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 type { XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, xstyledPropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS } from './constants/index.js';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSDataTableExpandCellT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n icon: 'none' | 'arrow' | 'caret';\n expanded: boolean;\n disabled: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDataTableExpandCellName,\n typeof DATA_TABLE_EXPAND_CELL_SLOTS\n > {\n className?: string;\n onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, XstyledProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, XstyledProps, RequiredProps {}\n}\n\nexport const defaultProps: DSDataTableExpandCellT.DefaultProps = {\n icon: 'none',\n expanded: false,\n disabled: false,\n};\n\nexport const DSDataTableExpandCellPropTypes: DSPropTypesSchema<DSDataTableExpandCellT.Props> = {\n ...xstyledPropTypes,\n ...getPropsPerSlotPropTypes(DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS),\n className: PropTypes.string.description('className for the wrapper'),\n expanded: PropTypes.bool.description('Determines which caret to print'),\n disabled: PropTypes.bool.description('Whether its disabled or not'),\n icon: PropTypes.oneOf(['none', 'arrow', 'caret']).description('Icon to print'),\n onClick: PropTypes.func.description('onClick callback'),\n};\n\nexport const DSDataTableExpandCellPropTypesSchema =\n DSDataTableExpandCellPropTypes as unknown as WeakValidationMap<DSDataTableExpandCellT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAAsE;AAEtE,uBAAwE;AA0BjE,MAAM,eAAoD;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ;AAEO,MAAM,iCAAkF;AAAA,EAC7F,GAAG;AAAA,EACH,OAAG,kDAAyB,4CAA2B,6CAA4B;AAAA,EACnF,WAAW,kCAAU,OAAO,YAAY,2BAA2B;AAAA,EACnE,UAAU,kCAAU,KAAK,YAAY,iCAAiC;AAAA,EACtE,UAAU,kCAAU,KAAK,YAAY,6BAA6B;AAAA,EAClE,MAAM,kCAAU,MAAM,CAAC,QAAQ,SAAS,OAAO,CAAC,EAAE,YAAY,eAAe;AAAA,EAC7E,SAAS,kCAAU,KAAK,YAAY,kBAAkB;AACxD;AAEO,MAAM,uCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { ArrowShortReturn, ArrowheadDown, ArrowheadRight } from "@elliemae/ds-icons";
|
|
5
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
6
|
+
import { css, styled } from "@elliemae/ds-system";
|
|
7
|
+
import { DSDataTableExpandCellPropTypesSchema } from "./react-desc-prop-types.js";
|
|
8
|
+
import { useDataTableExpandCell } from "./config/useDataTableExpandCell.js";
|
|
9
|
+
import { useOwnerProps } from "@elliemae/ds-utilities";
|
|
10
|
+
import { DATA_TABLE_EXPAND_CELL_SLOTS, DSDataTableExpandCellName } from "./constants/index.js";
|
|
11
|
+
import { DSDataTableCell } from "@elliemae/ds-data-table-cell";
|
|
12
|
+
const StyledWrapper = styled(DSDataTableCell, {
|
|
13
|
+
name: DSDataTableExpandCellName,
|
|
14
|
+
slot: DATA_TABLE_EXPAND_CELL_SLOTS.ROOT
|
|
15
|
+
})`
|
|
16
|
+
justify-content: center;
|
|
17
|
+
:focus-within {
|
|
18
|
+
&:after {
|
|
19
|
+
display: block;
|
|
20
|
+
content: ' ';
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
right: 0;
|
|
25
|
+
bottom: 0;
|
|
26
|
+
border: 2px solid brand-700;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
z-index: 7;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
svg {
|
|
32
|
+
fill: brand-800;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
const disabledCss = css`
|
|
36
|
+
cursor: not-allowed;
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
`;
|
|
39
|
+
const StyledCaretContainer = styled("span", {
|
|
40
|
+
name: DSDataTableExpandCellName,
|
|
41
|
+
slot: DATA_TABLE_EXPAND_CELL_SLOTS.CARET_CONTAINER
|
|
42
|
+
})`
|
|
43
|
+
cursor: pointer;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
outline: none;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
align-items: center;
|
|
49
|
+
${({ disabled }) => disabled && disabledCss}
|
|
50
|
+
`;
|
|
51
|
+
const DSDataTableExpandCell = (props) => {
|
|
52
|
+
const { propsWithDefault, xstyledProps } = useDataTableExpandCell(props);
|
|
53
|
+
const ownerPropsConfig = useOwnerProps(propsWithDefault);
|
|
54
|
+
const { className, icon, onClick, expanded, disabled } = propsWithDefault;
|
|
55
|
+
const shouldPrintCaret = icon === "caret";
|
|
56
|
+
const shouldPrintArrow = icon === "arrow";
|
|
57
|
+
const Caret = expanded ? ArrowheadDown : ArrowheadRight;
|
|
58
|
+
const onKeyDownHandler = useCallback(
|
|
59
|
+
(e) => {
|
|
60
|
+
if (["Enter", "Space"].includes(e.code)) {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
onClick?.(e);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
[onClick]
|
|
66
|
+
);
|
|
67
|
+
return /* @__PURE__ */ jsx(StyledWrapper, { className, ...ownerPropsConfig, ...xstyledProps, children: shouldPrintCaret ? /* @__PURE__ */ jsx(
|
|
68
|
+
StyledCaretContainer,
|
|
69
|
+
{
|
|
70
|
+
role: "button",
|
|
71
|
+
title: "Toggle Row Expanded",
|
|
72
|
+
onClick,
|
|
73
|
+
onKeyDown: onKeyDownHandler,
|
|
74
|
+
"aria-expanded": expanded,
|
|
75
|
+
disabled,
|
|
76
|
+
"aria-disabled": disabled,
|
|
77
|
+
...ownerPropsConfig,
|
|
78
|
+
children: /* @__PURE__ */ jsx(
|
|
79
|
+
Caret,
|
|
80
|
+
{
|
|
81
|
+
size: "s",
|
|
82
|
+
"data-is-col-expanded": expanded,
|
|
83
|
+
"data-role": "row-expander-col",
|
|
84
|
+
color: disabled ? ["neutral", "400"] : ["brand-primary", "600"]
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
) : shouldPrintArrow ? /* @__PURE__ */ jsx(ArrowShortReturn, { size: "s", style: { transform: "rotate(90deg) scaleY(-1)" }, color: ["brand-primary", "600"] }) : null });
|
|
89
|
+
};
|
|
90
|
+
DSDataTableExpandCell.displayName = DSDataTableExpandCellName;
|
|
91
|
+
const DSDataTableExpandCellWithSchema = describe(DSDataTableExpandCell);
|
|
92
|
+
DSDataTableExpandCellWithSchema.propTypes = DSDataTableExpandCellPropTypesSchema;
|
|
93
|
+
export {
|
|
94
|
+
DSDataTableExpandCell,
|
|
95
|
+
DSDataTableExpandCellWithSchema,
|
|
96
|
+
StyledCaretContainer,
|
|
97
|
+
disabledCss
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=DSDataTableExpandCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSDataTableExpandCell.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ArrowShortReturn, ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { css, styled } from '@elliemae/ds-system';\nimport { type DSDataTableExpandCellT, DSDataTableExpandCellPropTypesSchema } from './react-desc-prop-types.js';\nimport { useDataTableExpandCell } from './config/useDataTableExpandCell.js';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\nimport { DATA_TABLE_EXPAND_CELL_SLOTS, DSDataTableExpandCellName } from './constants/index.js';\nimport { DSDataTableCell } from '@elliemae/ds-data-table-cell';\n\nconst StyledWrapper = styled(DSDataTableCell, {\n name: DSDataTableExpandCellName,\n slot: DATA_TABLE_EXPAND_CELL_SLOTS.ROOT,\n})`\n justify-content: center;\n :focus-within {\n &:after {\n display: block;\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n border: 2px solid brand-700;\n pointer-events: none;\n z-index: 7;\n }\n }\n svg {\n fill: brand-800;\n }\n`;\n\nexport const disabledCss = css`\n cursor: not-allowed;\n pointer-events: none;\n`;\n\nexport const StyledCaretContainer = styled('span', {\n name: DSDataTableExpandCellName,\n slot: DATA_TABLE_EXPAND_CELL_SLOTS.CARET_CONTAINER,\n})<{ disabled: boolean }>`\n cursor: pointer;\n box-sizing: border-box;\n outline: none;\n display: flex;\n justify-content: center;\n align-items: center;\n ${({ disabled }) => disabled && disabledCss}\n`;\n\nconst DSDataTableExpandCell: React.ComponentType<DSDataTableExpandCellT.Props> = (props) => {\n const { propsWithDefault, xstyledProps } = useDataTableExpandCell(props);\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n const { className, icon, onClick, expanded, disabled } = propsWithDefault;\n\n const shouldPrintCaret = icon === 'caret';\n const shouldPrintArrow = icon === 'arrow';\n const Caret = expanded ? ArrowheadDown : ArrowheadRight;\n\n const onKeyDownHandler = useCallback(\n (e: React.KeyboardEvent) => {\n if (['Enter', 'Space'].includes(e.code)) {\n e.preventDefault();\n onClick?.(e);\n }\n },\n [onClick],\n );\n\n return (\n <StyledWrapper className={className} {...ownerPropsConfig} {...xstyledProps}>\n {shouldPrintCaret ? (\n <StyledCaretContainer\n role=\"button\"\n title=\"Toggle Row Expanded\"\n onClick={onClick}\n onKeyDown={onKeyDownHandler}\n aria-expanded={expanded}\n disabled={disabled}\n aria-disabled={disabled}\n {...ownerPropsConfig}\n >\n <Caret\n size=\"s\"\n data-is-col-expanded={expanded}\n data-role=\"row-expander-col\"\n color={disabled ? ['neutral', '400'] : ['brand-primary', '600']}\n />\n </StyledCaretContainer>\n ) : shouldPrintArrow ? (\n <ArrowShortReturn size=\"s\" style={{ transform: 'rotate(90deg) scaleY(-1)' }} color={['brand-primary', '600']} />\n ) : null}\n </StyledWrapper>\n );\n};\n\nDSDataTableExpandCell.displayName = DSDataTableExpandCellName;\nconst DSDataTableExpandCellWithSchema = describe(DSDataTableExpandCell);\nDSDataTableExpandCellWithSchema.propTypes = DSDataTableExpandCellPropTypesSchema;\n\nexport { DSDataTableExpandCell, DSDataTableExpandCellWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACoFb;AApFV,SAAgB,mBAAmB;AACnC,SAAS,kBAAkB,eAAe,sBAAsB;AAChE,SAAS,gBAAgB;AACzB,SAAS,KAAK,cAAc;AAC5B,SAAsC,4CAA4C;AAClF,SAAS,8BAA8B;AACvC,SAAS,qBAAqB;AAC9B,SAAS,8BAA8B,iCAAiC;AACxE,SAAS,uBAAuB;AAEhC,MAAM,gBAAgB,OAAO,iBAAiB;AAAA,EAC5C,MAAM;AAAA,EACN,MAAM,6BAA6B;AACrC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBM,MAAM,cAAc;AAAA;AAAA;AAAA;AAKpB,MAAM,uBAAuB,OAAO,QAAQ;AAAA,EACjD,MAAM;AAAA,EACN,MAAM,6BAA6B;AACrC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOG,CAAC,EAAE,SAAS,MAAM,YAAY;AAAA;AAGlC,MAAM,wBAA2E,CAAC,UAAU;AAC1F,QAAM,EAAE,kBAAkB,aAAa,IAAI,uBAAuB,KAAK;AACvE,QAAM,mBAAmB,cAAc,gBAAgB;AACvD,QAAM,EAAE,WAAW,MAAM,SAAS,UAAU,SAAS,IAAI;AAEzD,QAAM,mBAAmB,SAAS;AAClC,QAAM,mBAAmB,SAAS;AAClC,QAAM,QAAQ,WAAW,gBAAgB;AAEzC,QAAM,mBAAmB;AAAA,IACvB,CAAC,MAA2B;AAC1B,UAAI,CAAC,SAAS,OAAO,EAAE,SAAS,EAAE,IAAI,GAAG;AACvC,UAAE,eAAe;AACjB,kBAAU,CAAC;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAEA,SACE,oBAAC,iBAAc,WAAuB,GAAG,kBAAmB,GAAG,cAC5D,6BACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAM;AAAA,MACN;AAAA,MACA,WAAW;AAAA,MACX,iBAAe;AAAA,MACf;AAAA,MACA,iBAAe;AAAA,MACd,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,wBAAsB;AAAA,UACtB,aAAU;AAAA,UACV,OAAO,WAAW,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,KAAK;AAAA;AAAA,MAChE;AAAA;AAAA,EACF,IACE,mBACF,oBAAC,oBAAiB,MAAK,KAAI,OAAO,EAAE,WAAW,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,KAAK,GAAG,IAC5G,MACN;AAEJ;AAEA,sBAAsB,cAAc;AACpC,MAAM,kCAAkC,SAAS,qBAAqB;AACtE,gCAAgC,YAAY;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { useGetXstyledProps, useMemoMergePropsWithDefault } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { DSDataTableExpandCellPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
5
|
+
import { useValidateProps } from "./useValidateProps.js";
|
|
6
|
+
const useDataTableExpandCell = (propsFromUser) => {
|
|
7
|
+
const propsWithDefault = useMemoMergePropsWithDefault(
|
|
8
|
+
propsFromUser,
|
|
9
|
+
defaultProps
|
|
10
|
+
);
|
|
11
|
+
useValidateProps(propsWithDefault, DSDataTableExpandCellPropTypes);
|
|
12
|
+
const xstyledProps = useGetXstyledProps(propsWithDefault);
|
|
13
|
+
return React2.useMemo(
|
|
14
|
+
() => ({
|
|
15
|
+
propsWithDefault,
|
|
16
|
+
xstyledProps
|
|
17
|
+
}),
|
|
18
|
+
[propsWithDefault, xstyledProps]
|
|
19
|
+
);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
useDataTableExpandCell
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=useDataTableExpandCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useDataTableExpandCell.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { type DSDataTableExpandCellT, DSDataTableExpandCellPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\n\nexport interface DataTableExpandCellCTX {\n propsWithDefault: DSDataTableExpandCellT.InternalProps;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n instanceUid: string;\n}\n\nexport const useDataTableExpandCell = (propsFromUser: DSDataTableExpandCellT.Props) => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSDataTableExpandCellT.InternalProps>(\n propsFromUser,\n defaultProps,\n );\n useValidateProps(propsWithDefault, DSDataTableExpandCellPropTypes);\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n }),\n [propsWithDefault, xstyledProps],\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAOA,YAAW;AAClB,SAAS,oBAAoB,oCAAoC;AACjE,SAAsC,gCAAgC,oBAAoB;AAC1F,SAAS,wBAAwB;AAQ1B,MAAM,yBAAyB,CAAC,kBAAgD;AAIrF,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,mBAAiB,kBAAkB,8BAA8B;AAIjE,QAAM,eAAe,mBAAmB,gBAAgB;AAExD,SAAOA,OAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,kBAAkB,YAAY;AAAA,EACjC;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSDataTableExpandCellName } from "../constants/index.js";
|
|
4
|
+
const useValidateProps = (props, propTypes) => {
|
|
5
|
+
useValidateTypescriptPropTypes(props, propTypes, DSDataTableExpandCellName);
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
useValidateProps
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useValidateProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useValidateProps.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSDataTableExpandCellT } from '../react-desc-prop-types.js';\nimport { DSDataTableExpandCellName } from '../constants/index.js';\n\nexport const useValidateProps = (\n props: DSDataTableExpandCellT.InternalProps,\n propTypes: WeakValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSDataTableExpandCellName);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sCAAsC;AAG/C,SAAS,iCAAiC;AAEnC,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,iCAA+B,OAAO,WAAW,yBAAyB;AAC5E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { slotObjectToDataTestIds } from "@elliemae/ds-system";
|
|
3
|
+
const DSDataTableExpandCellName = "DSDataTableExpandCell";
|
|
4
|
+
const DATA_TABLE_EXPAND_CELL_SLOTS = {
|
|
5
|
+
ROOT: "root",
|
|
6
|
+
CARET_CONTAINER: "caret-container"
|
|
7
|
+
};
|
|
8
|
+
const DATA_TABLE_EXPAND_CELL_DATA_TESTID = slotObjectToDataTestIds(
|
|
9
|
+
DSDataTableExpandCellName,
|
|
10
|
+
DATA_TABLE_EXPAND_CELL_SLOTS
|
|
11
|
+
);
|
|
12
|
+
export {
|
|
13
|
+
DATA_TABLE_EXPAND_CELL_DATA_TESTID,
|
|
14
|
+
DATA_TABLE_EXPAND_CELL_SLOTS,
|
|
15
|
+
DSDataTableExpandCellName
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSDataTableExpandCellName = 'DSDataTableExpandCell';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_EXPAND_CELL_SLOTS = {\n ROOT: 'root',\n CARET_CONTAINER: 'caret-container',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_EXPAND_CELL_DATA_TESTID = slotObjectToDataTestIds(\n DSDataTableExpandCellName,\n DATA_TABLE_EXPAND_CELL_SLOTS,\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AAEjC,MAAM,4BAA4B;AAGlC,MAAM,+BAA+B;AAAA,EAC1C,MAAM;AAAA,EACN,iBAAiB;AACnB;AAGO,MAAM,qCAAqC;AAAA,EAChD;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DSDataTableExpandCell, DSDataTableExpandCellWithSchema } from "./DSDataTableExpandCell.js";
|
|
3
|
+
import {} from "./react-desc-prop-types.js";
|
|
4
|
+
import { DATA_TABLE_EXPAND_CELL_SLOTS, DATA_TABLE_EXPAND_CELL_DATA_TESTID } from "./constants/index.js";
|
|
5
|
+
export {
|
|
6
|
+
DATA_TABLE_EXPAND_CELL_DATA_TESTID,
|
|
7
|
+
DATA_TABLE_EXPAND_CELL_SLOTS,
|
|
8
|
+
DSDataTableExpandCell,
|
|
9
|
+
DSDataTableExpandCellWithSchema
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSDataTableExpandCell, DSDataTableExpandCellWithSchema } from './DSDataTableExpandCell.js';\nexport { type DSDataTableExpandCellT } from './react-desc-prop-types.js';\nexport { DATA_TABLE_EXPAND_CELL_SLOTS, DATA_TABLE_EXPAND_CELL_DATA_TESTID } from './constants/index.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,uBAAuB,uCAAuC;AACvE,eAA4C;AAC5C,SAAS,8BAA8B,0CAA0C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes, xstyledPropTypes, getPropsPerSlotPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS } from "./constants/index.js";
|
|
4
|
+
const defaultProps = {
|
|
5
|
+
icon: "none",
|
|
6
|
+
expanded: false,
|
|
7
|
+
disabled: false
|
|
8
|
+
};
|
|
9
|
+
const DSDataTableExpandCellPropTypes = {
|
|
10
|
+
...xstyledPropTypes,
|
|
11
|
+
...getPropsPerSlotPropTypes(DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS),
|
|
12
|
+
className: PropTypes.string.description("className for the wrapper"),
|
|
13
|
+
expanded: PropTypes.bool.description("Determines which caret to print"),
|
|
14
|
+
disabled: PropTypes.bool.description("Whether its disabled or not"),
|
|
15
|
+
icon: PropTypes.oneOf(["none", "arrow", "caret"]).description("Icon to print"),
|
|
16
|
+
onClick: PropTypes.func.description("onClick callback")
|
|
17
|
+
};
|
|
18
|
+
const DSDataTableExpandCellPropTypesSchema = DSDataTableExpandCellPropTypes;
|
|
19
|
+
export {
|
|
20
|
+
DSDataTableExpandCellPropTypes,
|
|
21
|
+
DSDataTableExpandCellPropTypesSchema,
|
|
22
|
+
defaultProps
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 type { XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';\nimport { PropTypes, xstyledPropTypes, getPropsPerSlotPropTypes } from '@elliemae/ds-props-helpers';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS } from './constants/index.js';\nimport type { WeakValidationMap } from 'react';\n\nexport declare namespace DSDataTableExpandCellT {\n export interface RequiredProps {}\n\n export interface DefaultProps {\n icon: 'none' | 'arrow' | 'caret';\n expanded: boolean;\n disabled: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<\n typeof DSDataTableExpandCellName,\n typeof DATA_TABLE_EXPAND_CELL_SLOTS\n > {\n className?: string;\n onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;\n }\n\n export interface Props extends Partial<DefaultProps>, OptionalProps, XstyledProps, RequiredProps {}\n\n export interface InternalProps extends DefaultProps, OptionalProps, XstyledProps, RequiredProps {}\n}\n\nexport const defaultProps: DSDataTableExpandCellT.DefaultProps = {\n icon: 'none',\n expanded: false,\n disabled: false,\n};\n\nexport const DSDataTableExpandCellPropTypes: DSPropTypesSchema<DSDataTableExpandCellT.Props> = {\n ...xstyledPropTypes,\n ...getPropsPerSlotPropTypes(DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS),\n className: PropTypes.string.description('className for the wrapper'),\n expanded: PropTypes.bool.description('Determines which caret to print'),\n disabled: PropTypes.bool.description('Whether its disabled or not'),\n icon: PropTypes.oneOf(['none', 'arrow', 'caret']).description('Icon to print'),\n onClick: PropTypes.func.description('onClick callback'),\n};\n\nexport const DSDataTableExpandCellPropTypesSchema =\n DSDataTableExpandCellPropTypes as unknown as WeakValidationMap<DSDataTableExpandCellT.Props>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,kBAAkB,gCAAgC;AAEtE,SAAS,2BAA2B,oCAAoC;AA0BjE,MAAM,eAAoD;AAAA,EAC/D,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AACZ;AAEO,MAAM,iCAAkF;AAAA,EAC7F,GAAG;AAAA,EACH,GAAG,yBAAyB,2BAA2B,4BAA4B;AAAA,EACnF,WAAW,UAAU,OAAO,YAAY,2BAA2B;AAAA,EACnE,UAAU,UAAU,KAAK,YAAY,iCAAiC;AAAA,EACtE,UAAU,UAAU,KAAK,YAAY,6BAA6B;AAAA,EAClE,MAAM,UAAU,MAAM,CAAC,QAAQ,SAAS,OAAO,CAAC,EAAE,YAAY,eAAe;AAAA,EAC7E,SAAS,UAAU,KAAK,YAAY,kBAAkB;AACxD;AAEO,MAAM,uCACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DSDataTableExpandCellT } from './react-desc-prop-types.js';
|
|
3
|
+
export declare const disabledCss: import("styled-components").FlattenSimpleInterpolation;
|
|
4
|
+
export declare const StyledCaretContainer: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, {
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
7
|
+
declare const DSDataTableExpandCell: React.ComponentType<DSDataTableExpandCellT.Props>;
|
|
8
|
+
declare const DSDataTableExpandCellWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<DSDataTableExpandCellT.Props>;
|
|
9
|
+
export { DSDataTableExpandCell, DSDataTableExpandCellWithSchema };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useGetXstyledProps } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import { type DSDataTableExpandCellT } from '../react-desc-prop-types.js';
|
|
3
|
+
export interface DataTableExpandCellCTX {
|
|
4
|
+
propsWithDefault: DSDataTableExpandCellT.InternalProps;
|
|
5
|
+
xstyledProps: ReturnType<typeof useGetXstyledProps>;
|
|
6
|
+
instanceUid: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const useDataTableExpandCell: (propsFromUser: DSDataTableExpandCellT.Props) => {
|
|
9
|
+
propsWithDefault: DSDataTableExpandCellT.InternalProps;
|
|
10
|
+
xstyledProps: import("@elliemae/ds-props-helpers").XstyledProps;
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DSDataTableExpandCellName = "DSDataTableExpandCell";
|
|
2
|
+
export declare const DATA_TABLE_EXPAND_CELL_SLOTS: {
|
|
3
|
+
readonly ROOT: "root";
|
|
4
|
+
readonly CARET_CONTAINER: "caret-container";
|
|
5
|
+
};
|
|
6
|
+
export declare const DATA_TABLE_EXPAND_CELL_DATA_TESTID: Record<string, string>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DSDataTableExpandCell, DSDataTableExpandCellWithSchema } from './DSDataTableExpandCell.js';
|
|
2
|
+
export { type DSDataTableExpandCellT } from './react-desc-prop-types.js';
|
|
3
|
+
export { DATA_TABLE_EXPAND_CELL_SLOTS, DATA_TABLE_EXPAND_CELL_DATA_TESTID } from './constants/index.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { XstyledProps, DSPropTypesSchema } from '@elliemae/ds-props-helpers';
|
|
2
|
+
import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';
|
|
3
|
+
import { DSDataTableExpandCellName, DATA_TABLE_EXPAND_CELL_SLOTS } from './constants/index.js';
|
|
4
|
+
import type { WeakValidationMap } from 'react';
|
|
5
|
+
export declare namespace DSDataTableExpandCellT {
|
|
6
|
+
interface RequiredProps {
|
|
7
|
+
}
|
|
8
|
+
interface DefaultProps {
|
|
9
|
+
icon: 'none' | 'arrow' | 'caret';
|
|
10
|
+
expanded: boolean;
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface OptionalProps extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSDataTableExpandCellName, typeof DATA_TABLE_EXPAND_CELL_SLOTS> {
|
|
14
|
+
className?: string;
|
|
15
|
+
onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
|
|
16
|
+
}
|
|
17
|
+
interface Props extends Partial<DefaultProps>, OptionalProps, XstyledProps, RequiredProps {
|
|
18
|
+
}
|
|
19
|
+
interface InternalProps extends DefaultProps, OptionalProps, XstyledProps, RequiredProps {
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export declare const defaultProps: DSDataTableExpandCellT.DefaultProps;
|
|
23
|
+
export declare const DSDataTableExpandCellPropTypes: DSPropTypesSchema<DSDataTableExpandCellT.Props>;
|
|
24
|
+
export declare const DSDataTableExpandCellPropTypesSchema: WeakValidationMap<DSDataTableExpandCellT.Props>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-data-table-expand-cell",
|
|
3
|
+
"version": "3.31.0-next.6",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Data Table Expand Cell",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"*.css",
|
|
20
|
+
"*.scss"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"pnpm": ">=6",
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"author": "ICE MT",
|
|
31
|
+
"jestSonar": {
|
|
32
|
+
"sonar56x": true,
|
|
33
|
+
"reportPath": "reports",
|
|
34
|
+
"reportFile": "tests.xml",
|
|
35
|
+
"indent": 4
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@xstyled/styled-components": "~3.6.0",
|
|
39
|
+
"@elliemae/ds-data-table-cell": "3.31.0-next.6",
|
|
40
|
+
"@elliemae/ds-typescript-helpers": "3.31.0-next.6",
|
|
41
|
+
"@elliemae/ds-utilities": "3.31.0-next.6",
|
|
42
|
+
"@elliemae/ds-icons": "3.31.0-next.6",
|
|
43
|
+
"@elliemae/ds-system": "3.31.0-next.6",
|
|
44
|
+
"@elliemae/ds-props-helpers": "3.31.0-next.6"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
48
|
+
"styled-components": "~5.3.9",
|
|
49
|
+
"@elliemae/ds-monorepo-devops": "3.31.0-next.6"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@testing-library/jest-dom": "~5.16.4",
|
|
53
|
+
"@testing-library/react": "~12.1.3",
|
|
54
|
+
"@testing-library/user-event": "~13.5.0",
|
|
55
|
+
"react": "^17.0.2",
|
|
56
|
+
"react-dom": "^17.0.2",
|
|
57
|
+
"styled-components": "~5.3.9"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public",
|
|
61
|
+
"typeSafety": true
|
|
62
|
+
},
|
|
63
|
+
"scripts": {
|
|
64
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
65
|
+
"test": "pui-cli test --passWithNoTests",
|
|
66
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
67
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
68
|
+
"dts": "node ../../scripts/dts.mjs",
|
|
69
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
70
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
71
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
72
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
73
|
+
"checkDeps": "npx -yes ../../util/ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
74
|
+
}
|
|
75
|
+
}
|