@elliemae/ds-accordion 2.2.0-alpha.1 → 2.2.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSAccordion.js +50 -29
- package/cjs/DSAccordion.js.map +7 -0
- package/cjs/DSAccordionCTX.js +40 -14
- package/cjs/DSAccordionCTX.js.map +7 -0
- package/cjs/DSAccordionDatatestid.js +38 -10
- package/cjs/DSAccordionDatatestid.js.map +7 -0
- package/cjs/DSAccordionTypes.js +27 -2
- package/cjs/DSAccordionTypes.js.map +7 -0
- package/cjs/config/useAccordion.js +59 -36
- package/cjs/config/useAccordion.js.map +7 -0
- package/cjs/config/useAccordionRefs.js +46 -39
- package/cjs/config/useAccordionRefs.js.map +7 -0
- package/cjs/defaultProps.js +49 -39
- package/cjs/defaultProps.js.map +7 -0
- package/cjs/index.js +37 -14
- package/cjs/index.js.map +7 -0
- package/cjs/parts/accordionContent/AccordionContent.js +44 -35
- package/cjs/parts/accordionContent/AccordionContent.js.map +7 -0
- package/cjs/parts/accordionItem/DSAccordionItem.js +147 -174
- package/cjs/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/cjs/parts/accordionItem/styles.js +142 -128
- package/cjs/parts/accordionItem/styles.js.map +7 -0
- package/cjs/parts/accordionItem/useAccordionItem.js +52 -39
- package/cjs/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/cjs/parts/accordionItem/useIsShowingEllipsis.js +42 -21
- package/cjs/parts/accordionItem/useIsShowingEllipsis.js.map +7 -0
- package/cjs/propTypes.js +53 -22
- package/cjs/propTypes.js.map +7 -0
- package/esm/DSAccordion.js +18 -16
- package/esm/DSAccordion.js.map +7 -0
- package/esm/DSAccordionCTX.js +10 -9
- package/esm/DSAccordionCTX.js.map +7 -0
- package/esm/DSAccordionDatatestid.js +9 -6
- package/esm/DSAccordionDatatestid.js.map +7 -0
- package/esm/DSAccordionTypes.js +2 -1
- package/esm/DSAccordionTypes.js.map +7 -0
- package/esm/config/useAccordion.js +25 -27
- package/esm/config/useAccordion.js.map +7 -0
- package/esm/config/useAccordionRefs.js +17 -31
- package/esm/config/useAccordionRefs.js.map +7 -0
- package/esm/defaultProps.js +21 -31
- package/esm/defaultProps.js.map +7 -0
- package/esm/index.js +8 -2
- package/esm/index.js.map +7 -0
- package/esm/parts/accordionContent/AccordionContent.js +14 -25
- package/esm/parts/accordionContent/AccordionContent.js.map +7 -0
- package/esm/parts/accordionItem/DSAccordionItem.js +114 -147
- package/esm/parts/accordionItem/DSAccordionItem.js.map +7 -0
- package/esm/parts/accordionItem/styles.js +116 -115
- package/esm/parts/accordionItem/styles.js.map +7 -0
- package/esm/parts/accordionItem/useAccordionItem.js +21 -33
- package/esm/parts/accordionItem/useAccordionItem.js.map +7 -0
- package/esm/parts/accordionItem/useIsShowingEllipsis.js +11 -15
- package/esm/parts/accordionItem/useIsShowingEllipsis.js.map +7 -0
- package/esm/propTypes.js +24 -17
- package/esm/propTypes.js.map +7 -0
- package/package.json +7 -7
|
@@ -1,133 +1,147 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styles_exports = {};
|
|
29
|
+
__export(styles_exports, {
|
|
30
|
+
StyledItemAddon: () => StyledItemAddon,
|
|
31
|
+
StyledItemContainer: () => StyledItemContainer,
|
|
32
|
+
StyledItemContent: () => StyledItemContent,
|
|
33
|
+
StyledItemCustomActions: () => StyledItemCustomActions,
|
|
34
|
+
StyledItemHeader: () => StyledItemHeader,
|
|
35
|
+
StyledItemHeaderContainer: () => StyledItemHeaderContainer,
|
|
36
|
+
StyledItemTitles: () => StyledItemTitles,
|
|
37
|
+
StyledPrimaryTitle: () => StyledPrimaryTitle,
|
|
38
|
+
StyledSecondaryTitle: () => StyledSecondaryTitle
|
|
39
|
+
});
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
42
|
+
const StyledItemContainer = import_styled_components.default.div`
|
|
43
|
+
display: grid;
|
|
44
|
+
grid-template-rows: auto auto;
|
|
45
|
+
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[200]};
|
|
46
|
+
align-items: center;
|
|
47
|
+
`;
|
|
48
|
+
const StyledItemHeader = import_styled_components.default.button`
|
|
49
|
+
display: grid;
|
|
50
|
+
height: ${({ withSecondaryTitle }) => withSecondaryTitle ? "48px" : "32px"};
|
|
51
|
+
grid-template-columns: ${({ withCustomActions, isDSMobile }) => withCustomActions ? "32px auto" : `${isDSMobile ? `auto 32px` : `32px auto`}`};
|
|
52
|
+
width: 100%;
|
|
53
|
+
align-items: center;
|
|
54
|
+
border: none;
|
|
55
|
+
outline: none;
|
|
56
|
+
background: none;
|
|
4
57
|
|
|
5
|
-
|
|
58
|
+
&:hover {
|
|
59
|
+
cursor: ${({ disabled }) => disabled ? "not-allowed" : "pointer"};
|
|
60
|
+
}
|
|
6
61
|
|
|
7
|
-
|
|
62
|
+
padding: ${({ isDSMobile }) => isDSMobile ? `0 16px` : `0`};
|
|
8
63
|
|
|
9
|
-
|
|
64
|
+
${({ isDSMobile }) => isDSMobile ? `grid-template-areas: 'title addon';` : ``}
|
|
10
65
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
let {
|
|
39
|
-
isDSMobile
|
|
40
|
-
} = _ref5;
|
|
41
|
-
return isDSMobile ? "0 16px" : "0";
|
|
42
|
-
}, _ref6 => {
|
|
43
|
-
let {
|
|
44
|
-
isDSMobile
|
|
45
|
-
} = _ref6;
|
|
46
|
-
return isDSMobile ? "grid-template-areas: 'title addon';" : "";
|
|
47
|
-
}, _ref7 => {
|
|
48
|
-
let {
|
|
49
|
-
theme
|
|
50
|
-
} = _ref7;
|
|
51
|
-
return theme.colors.brand[700];
|
|
52
|
-
});
|
|
53
|
-
const StyledItemContent = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
54
|
-
componentId: "sc-fnpjby-2"
|
|
55
|
-
})(["margin:", ";grid-column:1/2;"], _ref8 => {
|
|
56
|
-
let {
|
|
57
|
-
isDSMobile
|
|
58
|
-
} = _ref8;
|
|
59
|
-
return isDSMobile ? "16px 16px 24px 16px" : "16px 16px 16px 32px";
|
|
60
|
-
});
|
|
61
|
-
const StyledItemAddon = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
62
|
-
componentId: "sc-fnpjby-3"
|
|
63
|
-
})(["", " height:100%;display:grid;place-items:center;& .em-ds-icon svg{fill:", ";}"], _ref9 => {
|
|
64
|
-
let {
|
|
65
|
-
isDSMobile
|
|
66
|
-
} = _ref9;
|
|
67
|
-
return !isDSMobile ? " padding: 0 8px;\n \n" : "\n grid-area: addon;\n ";
|
|
68
|
-
}, _ref10 => {
|
|
69
|
-
let {
|
|
70
|
-
disabled,
|
|
71
|
-
theme
|
|
72
|
-
} = _ref10;
|
|
73
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.brand[800];
|
|
74
|
-
});
|
|
75
|
-
const StyledItemTitles = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
76
|
-
componentId: "sc-fnpjby-4"
|
|
77
|
-
})(["display:grid;grid-template-columns:100%;align-content:center;", ""], _ref11 => {
|
|
78
|
-
let {
|
|
79
|
-
isDSMobile
|
|
80
|
-
} = _ref11;
|
|
81
|
-
return isDSMobile ? "grid-area: title;" : "";
|
|
82
|
-
});
|
|
83
|
-
const StyledPrimaryTitle = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
84
|
-
componentId: "sc-fnpjby-5"
|
|
85
|
-
})(["margin:0;font-size:16px;color:", ";font-weight:", ";text-overflow:ellipsis;overflow:hidden;height:16px;width:100%;text-align:left;display:block;white-space:nowrap;"], _ref12 => {
|
|
86
|
-
let {
|
|
87
|
-
disabled,
|
|
88
|
-
theme
|
|
89
|
-
} = _ref12;
|
|
90
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.neutral[700];
|
|
91
|
-
}, _ref13 => {
|
|
92
|
-
let {
|
|
93
|
-
theme,
|
|
94
|
-
isDSMobile
|
|
95
|
-
} = _ref13;
|
|
96
|
-
return isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular;
|
|
97
|
-
});
|
|
98
|
-
const StyledSecondaryTitle = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
99
|
-
componentId: "sc-fnpjby-6"
|
|
100
|
-
})(["margin:0;font-size:", ";text-align:left;color:", ";text-overflow:ellipsis;overflow:hidden;height:16px;width:100%;text-align:left;display:block;white-space:nowrap;"], _ref14 => {
|
|
101
|
-
let {
|
|
102
|
-
theme
|
|
103
|
-
} = _ref14;
|
|
104
|
-
return theme.fontSizes.label[200];
|
|
105
|
-
}, _ref15 => {
|
|
106
|
-
let {
|
|
107
|
-
disabled,
|
|
108
|
-
theme
|
|
109
|
-
} = _ref15;
|
|
110
|
-
return disabled ? theme.colors.neutral[200] : theme.colors.neutral[500];
|
|
111
|
-
});
|
|
112
|
-
const StyledItemCustomActions = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
113
|
-
componentId: "sc-fnpjby-7"
|
|
114
|
-
})(["display:grid;grid-auto-flow:column;grid-gap:8px;margin:0 16px;justify-content:flex-end;"]);
|
|
115
|
-
const StyledItemHeaderContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
116
|
-
componentId: "sc-fnpjby-8"
|
|
117
|
-
})(["display:grid;grid-template-columns:auto max-content;place-items:center;position:relative;&:hover{", ";}"], _ref16 => {
|
|
118
|
-
let {
|
|
119
|
-
disabled,
|
|
120
|
-
theme
|
|
121
|
-
} = _ref16;
|
|
122
|
-
return !disabled ? "background: ".concat(theme.colors.brand[200]) : "";
|
|
123
|
-
});
|
|
66
|
+
&:focus {
|
|
67
|
+
&:after {
|
|
68
|
+
position: absolute;
|
|
69
|
+
content: '';
|
|
70
|
+
left: 0;
|
|
71
|
+
top: 0;
|
|
72
|
+
width: 100%;
|
|
73
|
+
height: 100%;
|
|
74
|
+
border-radius: 2px;
|
|
75
|
+
border: 2px solid ${({ theme }) => theme.colors.brand[700]};
|
|
76
|
+
pointer-events: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
const StyledItemContent = import_styled_components.default.div`
|
|
81
|
+
margin: ${({ isDSMobile }) => isDSMobile ? `16px 16px 24px 16px` : `16px 16px 16px 32px`};
|
|
82
|
+
grid-column: 1/2;
|
|
83
|
+
`;
|
|
84
|
+
const StyledItemAddon = import_styled_components.default.div`
|
|
85
|
+
${({ isDSMobile }) => !isDSMobile ? ` padding: 0 8px;
|
|
86
|
+
|
|
87
|
+
` : `
|
|
88
|
+
grid-area: addon;
|
|
89
|
+
`}
|
|
90
|
+
height: 100%;
|
|
91
|
+
display: grid;
|
|
92
|
+
place-items: center;
|
|
124
93
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
94
|
+
& .em-ds-icon svg {
|
|
95
|
+
fill: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.brand[800]};
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
const StyledItemTitles = import_styled_components.default.div`
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: 100%;
|
|
101
|
+
align-content: center;
|
|
102
|
+
${({ isDSMobile }) => isDSMobile ? `grid-area: title;` : ``}
|
|
103
|
+
`;
|
|
104
|
+
const StyledPrimaryTitle = import_styled_components.default.div`
|
|
105
|
+
margin: 0;
|
|
106
|
+
font-size: 16px;
|
|
107
|
+
color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.neutral[700]};
|
|
108
|
+
font-weight: ${({ theme, isDSMobile }) => isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular};
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
height: 16px;
|
|
112
|
+
width: 100%;
|
|
113
|
+
text-align: left;
|
|
114
|
+
display: block;
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
`;
|
|
117
|
+
const StyledSecondaryTitle = import_styled_components.default.span`
|
|
118
|
+
margin: 0;
|
|
119
|
+
font-size: ${({ theme }) => theme.fontSizes.label[200]};
|
|
120
|
+
text-align: left;
|
|
121
|
+
color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[200] : theme.colors.neutral[500]};
|
|
122
|
+
text-overflow: ellipsis;
|
|
123
|
+
overflow: hidden;
|
|
124
|
+
height: 16px;
|
|
125
|
+
width: 100%;
|
|
126
|
+
text-align: left;
|
|
127
|
+
display: block;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
`;
|
|
130
|
+
const StyledItemCustomActions = import_styled_components.default.div`
|
|
131
|
+
display: grid;
|
|
132
|
+
grid-auto-flow: column;
|
|
133
|
+
grid-gap: 8px;
|
|
134
|
+
margin: 0 16px;
|
|
135
|
+
justify-content: flex-end;
|
|
136
|
+
`;
|
|
137
|
+
const StyledItemHeaderContainer = import_styled_components.default.div`
|
|
138
|
+
display: grid;
|
|
139
|
+
grid-template-columns: auto max-content;
|
|
140
|
+
place-items: center;
|
|
141
|
+
position: relative;
|
|
142
|
+
&:hover {
|
|
143
|
+
${({ disabled, theme }) => !disabled ? `background: ${theme.colors.brand[200]}` : ``};
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
module.exports = __toCommonJS(styles_exports);
|
|
147
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/accordionItem/styles.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import styled from 'styled-components';\nimport type {\n StyledItemAddonPropsT,\n StyledItemHeaderPropsT,\n StyledItemTitlesPropsT,\n StyledPrimaryTitlePropsT,\n StyledSecondaryTitlePropsT,\n StyledItemContentPropsT,\n} from '../../DSAccordionTypes';\n\nexport const StyledItemContainer = styled.div`\n display: grid;\n grid-template-rows: auto auto;\n border-bottom: 1px solid ${({ theme }) => theme.colors.neutral[200]};\n align-items: center;\n`;\n\nexport const StyledItemHeader = styled.button<StyledItemHeaderPropsT>`\n display: grid;\n height: ${({ withSecondaryTitle }) => (withSecondaryTitle ? '48px' : '32px')};\n grid-template-columns: ${({ withCustomActions, isDSMobile }) =>\n withCustomActions ? '32px auto' : `${isDSMobile ? `auto 32px` : `32px auto`}`};\n width: 100%;\n align-items: center;\n border: none;\n outline: none;\n background: none;\n\n &:hover {\n cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};\n }\n\n padding: ${({ isDSMobile }) => (isDSMobile ? `0 16px` : `0`)};\n\n ${({ isDSMobile }) => (isDSMobile ? `grid-template-areas: 'title addon';` : ``)}\n\n &:focus {\n &:after {\n position: absolute;\n content: '';\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n border-radius: 2px;\n border: 2px solid ${({ theme }) => theme.colors.brand[700]};\n pointer-events: none;\n }\n }\n`;\n\nexport const StyledItemContent = styled.div<StyledItemContentPropsT>`\n margin: ${({ isDSMobile }) => (isDSMobile ? `16px 16px 24px 16px` : `16px 16px 16px 32px`)};\n grid-column: 1/2;\n`;\n\nexport const StyledItemAddon = styled.div<StyledItemAddonPropsT>`\n ${({ isDSMobile }) =>\n !isDSMobile\n ? ` padding: 0 8px;\n \n`\n : `\n grid-area: addon;\n `}\n height: 100%;\n display: grid;\n place-items: center;\n\n & .em-ds-icon svg {\n fill: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.brand[800])};\n }\n`;\n\nexport const StyledItemTitles = styled.div<StyledItemTitlesPropsT>`\n display: grid;\n grid-template-columns: 100%;\n align-content: center;\n ${({ isDSMobile }) => (isDSMobile ? `grid-area: title;` : ``)}\n`;\n\nexport const StyledPrimaryTitle = styled.div<StyledPrimaryTitlePropsT>`\n margin: 0;\n font-size: 16px;\n color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.neutral[700])};\n font-weight: ${({ theme, isDSMobile }) => (isDSMobile ? theme.fontWeights.regular : theme.fontWeights.regular)};\n text-overflow: ellipsis;\n overflow: hidden;\n height: 16px;\n width: 100%;\n text-align: left;\n display: block;\n white-space: nowrap;\n`;\n\nexport const StyledSecondaryTitle = styled.span<StyledSecondaryTitlePropsT>`\n margin: 0;\n font-size: ${({ theme }) => theme.fontSizes.label[200]};\n text-align: left;\n color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[200] : theme.colors.neutral[500])};\n text-overflow: ellipsis;\n overflow: hidden;\n height: 16px;\n width: 100%;\n text-align: left;\n display: block;\n white-space: nowrap;\n`;\n\nexport const StyledItemCustomActions = styled.div`\n display: grid;\n grid-auto-flow: column;\n grid-gap: 8px;\n margin: 0 16px;\n justify-content: flex-end;\n`;\n\nexport const StyledItemHeaderContainer = styled.div`\n display: grid;\n grid-template-columns: auto max-content;\n place-items: center;\n position: relative;\n &:hover {\n ${({ disabled, theme }) => (!disabled ? `background: ${theme.colors.brand[200]}` : ``)};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAmB;AAUZ,MAAM,sBAAsB,iCAAO;AAAA;AAAA;AAAA,6BAGb,CAAC,EAAE,YAAY,MAAM,OAAO,QAAQ;AAAA;AAAA;AAI1D,MAAM,mBAAmB,iCAAO;AAAA;AAAA,YAE3B,CAAC,EAAE,yBAA0B,qBAAqB,SAAS;AAAA,2BAC5C,CAAC,EAAE,mBAAmB,iBAC7C,oBAAoB,cAAc,GAAG,aAAa,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAQtD,CAAC,EAAE,eAAgB,WAAW,gBAAgB;AAAA;AAAA;AAAA,aAG/C,CAAC,EAAE,iBAAkB,aAAa,WAAW;AAAA;AAAA,IAEtD,CAAC,EAAE,iBAAkB,aAAa,wCAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAWpD,CAAC,EAAE,YAAY,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAMrD,MAAM,oBAAoB,iCAAO;AAAA,YAC5B,CAAC,EAAE,iBAAkB,aAAa,wBAAwB;AAAA;AAAA;AAI/D,MAAM,kBAAkB,iCAAO;AAAA,IAClC,CAAC,EAAE,iBACH,CAAC,aACG;AAAA;AAAA,IAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAQI,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA;AAAA;AAIzF,MAAM,mBAAmB,iCAAO;AAAA;AAAA;AAAA;AAAA,IAInC,CAAC,EAAE,iBAAkB,aAAa,sBAAsB;AAAA;AAGrD,MAAM,qBAAqB,iCAAO;AAAA;AAAA;AAAA,WAG9B,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAAA,iBAChF,CAAC,EAAE,OAAO,iBAAkB,aAAa,MAAM,YAAY,UAAU,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUjG,MAAM,uBAAuB,iCAAO;AAAA;AAAA,eAE5B,CAAC,EAAE,YAAY,MAAM,UAAU,MAAM;AAAA;AAAA,WAEzC,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU1F,MAAM,0BAA0B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQvC,MAAM,4BAA4B,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAM1C,CAAC,EAAE,UAAU,YAAa,CAAC,WAAW,eAAe,MAAM,OAAO,MAAM,SAAS;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,46 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useAccordionItem_exports = {};
|
|
29
|
+
__export(useAccordionItem_exports, {
|
|
30
|
+
useAccordionItem: () => useAccordionItem
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = __toESM(require("react"));
|
|
34
|
+
var import_DSAccordionCTX = __toESM(require("../../DSAccordionCTX"));
|
|
35
|
+
const useAccordionItem = ({ value, disabled }) => {
|
|
36
|
+
const { actualActiveValue, setActiveValues, focusableChildrenReferences } = (0, import_react.useContext)(import_DSAccordionCTX.DSAccordionContext);
|
|
37
|
+
const selected = (0, import_react.useMemo)(() => {
|
|
22
38
|
if (Array.isArray(actualActiveValue)) {
|
|
23
|
-
return actualActiveValue.some(currentValue => currentValue === value);
|
|
39
|
+
return actualActiveValue.some((currentValue) => currentValue === value);
|
|
24
40
|
}
|
|
25
|
-
|
|
26
41
|
return value === actualActiveValue;
|
|
27
42
|
}, [actualActiveValue, value]);
|
|
28
|
-
const handleOnClick =
|
|
29
|
-
if (!disabled)
|
|
43
|
+
const handleOnClick = (0, import_react.useCallback)((e) => {
|
|
44
|
+
if (!disabled)
|
|
45
|
+
setActiveValues(value, e);
|
|
30
46
|
}, [disabled, setActiveValues, value]);
|
|
31
|
-
const handleOnKeyDown =
|
|
32
|
-
if (!disabled && e.key ===
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if ((_focusableChildrenRef = focusableChildrenReferences[currentIndex + 1]) !== null && _focusableChildrenRef !== void 0 && (_focusableChildrenRef2 = _focusableChildrenRef.ref) !== null && _focusableChildrenRef2 !== void 0 && _focusableChildrenRef2.current) (_focusableChildrenRef3 = focusableChildrenReferences[currentIndex + 1]) === null || _focusableChildrenRef3 === void 0 ? void 0 : (_focusableChildrenRef4 = _focusableChildrenRef3.ref) === null || _focusableChildrenRef4 === void 0 ? void 0 : (_focusableChildrenRef5 = _focusableChildrenRef4.current) === null || _focusableChildrenRef5 === void 0 ? void 0 : _focusableChildrenRef5.focus();
|
|
47
|
+
const handleOnKeyDown = (0, import_react.useCallback)((e, _dsIndex) => {
|
|
48
|
+
if (!disabled && e.key === "ArrowDown") {
|
|
49
|
+
const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);
|
|
50
|
+
if (focusableChildrenReferences[currentIndex + 1]?.ref?.current)
|
|
51
|
+
focusableChildrenReferences[currentIndex + 1]?.ref?.current?.focus();
|
|
37
52
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const currentIndex = focusableChildrenReferences.findIndex(item => item.index === _dsIndex);
|
|
43
|
-
if ((_focusableChildrenRef6 = focusableChildrenReferences[currentIndex - 1]) !== null && _focusableChildrenRef6 !== void 0 && (_focusableChildrenRef7 = _focusableChildrenRef6.ref) !== null && _focusableChildrenRef7 !== void 0 && _focusableChildrenRef7.current) (_focusableChildrenRef8 = focusableChildrenReferences[currentIndex - 1]) === null || _focusableChildrenRef8 === void 0 ? void 0 : (_focusableChildrenRef9 = _focusableChildrenRef8.ref) === null || _focusableChildrenRef9 === void 0 ? void 0 : (_focusableChildrenRef10 = _focusableChildrenRef9.current) === null || _focusableChildrenRef10 === void 0 ? void 0 : _focusableChildrenRef10.focus();
|
|
53
|
+
if (!disabled && e.key === "ArrowUp") {
|
|
54
|
+
const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);
|
|
55
|
+
if (focusableChildrenReferences[currentIndex - 1]?.ref?.current)
|
|
56
|
+
focusableChildrenReferences[currentIndex - 1]?.ref?.current?.focus();
|
|
44
57
|
}
|
|
45
58
|
}, [disabled, focusableChildrenReferences]);
|
|
46
59
|
return {
|
|
@@ -49,5 +62,5 @@ const useAccordionItem = _ref => {
|
|
|
49
62
|
selected
|
|
50
63
|
};
|
|
51
64
|
};
|
|
52
|
-
|
|
53
|
-
|
|
65
|
+
module.exports = __toCommonJS(useAccordionItem_exports);
|
|
66
|
+
//# sourceMappingURL=useAccordionItem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/accordionItem/useAccordionItem.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useCallback, useContext, useMemo } from 'react';\nimport { DSAccordionContext } from '../../DSAccordionCTX';\nimport type { UseAccordionPropsT, UseAccordionItemReturnTypeT } from '../../DSAccordionTypes';\n\nexport const useAccordionItem = ({ value, disabled }: UseAccordionPropsT): UseAccordionItemReturnTypeT => {\n const { actualActiveValue, setActiveValues, focusableChildrenReferences } = useContext(DSAccordionContext);\n\n const selected = useMemo(() => {\n if (Array.isArray(actualActiveValue)) {\n return actualActiveValue.some((currentValue) => currentValue === value);\n }\n return value === actualActiveValue;\n }, [actualActiveValue, value]);\n\n const handleOnClick = useCallback(\n (e: React.MouseEvent) => {\n if (!disabled) setActiveValues(value, e);\n },\n [disabled, setActiveValues, value],\n );\n\n const handleOnKeyDown = useCallback(\n (e: React.KeyboardEvent, _dsIndex: number) => {\n if (!disabled && e.key === 'ArrowDown') {\n const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);\n if (focusableChildrenReferences[currentIndex + 1]?.ref?.current)\n focusableChildrenReferences[currentIndex + 1]?.ref?.current?.focus();\n }\n\n if (!disabled && e.key === 'ArrowUp') {\n const currentIndex = focusableChildrenReferences.findIndex((item) => item.index === _dsIndex);\n if (focusableChildrenReferences[currentIndex - 1]?.ref?.current)\n focusableChildrenReferences[currentIndex - 1]?.ref?.current?.focus();\n }\n },\n [disabled, focusableChildrenReferences],\n );\n\n return {\n handleOnClick,\n handleOnKeyDown,\n selected,\n };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwD;AACxD,4BAAmC;AAG5B,MAAM,mBAAmB,CAAC,EAAE,OAAO,eAAgE;AACxG,QAAM,EAAE,mBAAmB,iBAAiB,gCAAgC,6BAAW;AAEvF,QAAM,WAAW,0BAAQ,MAAM;AAC7B,QAAI,MAAM,QAAQ,oBAAoB;AACpC,aAAO,kBAAkB,KAAK,CAAC,iBAAiB,iBAAiB;AAAA;AAEnE,WAAO,UAAU;AAAA,KAChB,CAAC,mBAAmB;AAEvB,QAAM,gBAAgB,8BACpB,CAAC,MAAwB;AACvB,QAAI,CAAC;AAAU,sBAAgB,OAAO;AAAA,KAExC,CAAC,UAAU,iBAAiB;AAG9B,QAAM,kBAAkB,8BACtB,CAAC,GAAwB,aAAqB;AAC5C,QAAI,CAAC,YAAY,EAAE,QAAQ,aAAa;AACtC,YAAM,eAAe,4BAA4B,UAAU,CAAC,SAAS,KAAK,UAAU;AACpF,UAAI,4BAA4B,eAAe,IAAI,KAAK;AACtD,oCAA4B,eAAe,IAAI,KAAK,SAAS;AAAA;AAGjE,QAAI,CAAC,YAAY,EAAE,QAAQ,WAAW;AACpC,YAAM,eAAe,4BAA4B,UAAU,CAAC,SAAS,KAAK,UAAU;AACpF,UAAI,4BAA4B,eAAe,IAAI,KAAK;AACtD,oCAA4B,eAAe,IAAI,KAAK,SAAS;AAAA;AAAA,KAGnE,CAAC,UAAU;AAGb,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,37 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useIsShowingEllipsis_exports = {};
|
|
29
|
+
__export(useIsShowingEllipsis_exports, {
|
|
30
|
+
useIsShowingEllipsis: () => useIsShowingEllipsis
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = __toESM(require("react"));
|
|
8
34
|
const useIsShowingEllipsis = () => {
|
|
9
|
-
const [element, setElement] =
|
|
10
|
-
const [isShowingEllipsis, setIsShowingEllipsis] =
|
|
11
|
-
|
|
12
|
-
const resizeObserver = React.useMemo(() => new ResizeObserver(entries => {
|
|
35
|
+
const [element, setElement] = (0, import_react.useState)();
|
|
36
|
+
const [isShowingEllipsis, setIsShowingEllipsis] = (0, import_react.useState)(false);
|
|
37
|
+
const resizeObserver = (0, import_react.useMemo)(() => new ResizeObserver((entries) => {
|
|
13
38
|
if (entries.length) {
|
|
14
39
|
const [textWrapperEntry] = entries;
|
|
15
40
|
const el = textWrapperEntry.target;
|
|
16
|
-
setIsShowingEllipsis(
|
|
41
|
+
setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
|
|
17
42
|
}
|
|
18
43
|
}), []);
|
|
19
|
-
|
|
44
|
+
(0, import_react.useEffect)(() => {
|
|
20
45
|
if (element) {
|
|
21
|
-
setIsShowingEllipsis(
|
|
46
|
+
setIsShowingEllipsis(element?.scrollWidth > element?.clientWidth);
|
|
22
47
|
resizeObserver.observe(element);
|
|
23
48
|
}
|
|
24
|
-
|
|
25
49
|
return () => {
|
|
26
50
|
if (element) {
|
|
27
51
|
resizeObserver.unobserve(element);
|
|
28
52
|
}
|
|
29
53
|
};
|
|
30
54
|
}, [resizeObserver, element]);
|
|
31
|
-
return {
|
|
32
|
-
setElement,
|
|
33
|
-
isShowingEllipsis
|
|
34
|
-
};
|
|
55
|
+
return { setElement, isShowingEllipsis };
|
|
35
56
|
};
|
|
36
|
-
|
|
37
|
-
|
|
57
|
+
module.exports = __toCommonJS(useIsShowingEllipsis_exports);
|
|
58
|
+
//# sourceMappingURL=useIsShowingEllipsis.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/parts/accordionItem/useIsShowingEllipsis.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { useEffect, useState, useMemo } from 'react';\n\nexport const useIsShowingEllipsis = () => {\n const [element, setElement] = useState<HTMLSpanElement>();\n\n const [isShowingEllipsis, setIsShowingEllipsis] = useState(false);\n // const isShowingEllipsis = element?.scrollWidth > primaryTitleWrapperEl?.clientWidth;\n\n const resizeObserver = useMemo(\n () =>\n new ResizeObserver((entries) => {\n if (entries.length) {\n const [textWrapperEntry] = entries;\n const el = textWrapperEntry.target;\n setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);\n }\n }),\n [],\n );\n\n useEffect(() => {\n if (element) {\n setIsShowingEllipsis(element?.scrollWidth > element?.clientWidth);\n resizeObserver.observe(element);\n }\n return () => {\n if (element) {\n resizeObserver.unobserve(element);\n }\n };\n }, [resizeObserver, element]);\n\n return { setElement, isShowingEllipsis };\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoD;AAE7C,MAAM,uBAAuB,MAAM;AACxC,QAAM,CAAC,SAAS,cAAc;AAE9B,QAAM,CAAC,mBAAmB,wBAAwB,2BAAS;AAG3D,QAAM,iBAAiB,0BACrB,MACE,IAAI,eAAe,CAAC,YAAY;AAC9B,QAAI,QAAQ,QAAQ;AAClB,YAAM,CAAC,oBAAoB;AAC3B,YAAM,KAAK,iBAAiB;AAC5B,2BAAqB,IAAI,cAAc,IAAI;AAAA;AAAA,MAGjD;AAGF,8BAAU,MAAM;AACd,QAAI,SAAS;AACX,2BAAqB,SAAS,cAAc,SAAS;AACrD,qBAAe,QAAQ;AAAA;AAEzB,WAAO,MAAM;AACX,UAAI,SAAS;AACX,uBAAe,UAAU;AAAA;AAAA;AAAA,KAG5B,CAAC,gBAAgB;AAEpB,SAAO,EAAE,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/propTypes.js
CHANGED
|
@@ -1,26 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var propTypes_exports = {};
|
|
29
|
+
__export(propTypes_exports, {
|
|
30
|
+
accordionItemPropTypes: () => accordionItemPropTypes,
|
|
31
|
+
accordionPropTypes: () => accordionPropTypes
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react_desc = __toESM(require("react-desc"));
|
|
7
35
|
const accordionItemPropTypes = {
|
|
8
|
-
children:
|
|
9
|
-
title:
|
|
10
|
-
value:
|
|
11
|
-
iconClosed:
|
|
12
|
-
iconOpened:
|
|
13
|
-
secondaryTitle:
|
|
14
|
-
customActions:
|
|
15
|
-
renderCustomActions:
|
|
36
|
+
children: import_react_desc.PropTypes.node.description("Dimsum AccordionItem content.").isRequired,
|
|
37
|
+
title: import_react_desc.PropTypes.string.description("Set a primary title."),
|
|
38
|
+
value: import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number]).description("Dimsum AccordionItem value, this value should be unique.").isRequired,
|
|
39
|
+
iconClosed: import_react_desc.PropTypes.node.description("Custom Dimsum Icon when it is closed."),
|
|
40
|
+
iconOpened: import_react_desc.PropTypes.node.description("Custom Dimsum Icon when it is open."),
|
|
41
|
+
secondaryTitle: import_react_desc.PropTypes.string.description("Set a secondary title"),
|
|
42
|
+
customActions: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.object).description("Set Dimsum AccordionItem custom actions."),
|
|
43
|
+
renderCustomActions: import_react_desc.PropTypes.func.description("This property will render any JSX in the custom actions area. You can access to all references and active values within the props.")
|
|
16
44
|
};
|
|
17
45
|
const accordionPropTypes = {
|
|
18
|
-
containerProps:
|
|
19
|
-
activeValue:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
46
|
+
containerProps: import_react_desc.PropTypes.object.description("Adds props to the container."),
|
|
47
|
+
activeValue: import_react_desc.PropTypes.oneOfType([
|
|
48
|
+
import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number])),
|
|
49
|
+
import_react_desc.PropTypes.string,
|
|
50
|
+
import_react_desc.PropTypes.number
|
|
51
|
+
]).description("Selected active value. This property makes the component a controlled one."),
|
|
52
|
+
children: import_react_desc.PropTypes.node.description("Dimsum AccordionItems to show."),
|
|
53
|
+
allowMultipleOpen: import_react_desc.PropTypes.bool.description("Allows multiple Dimsum AccordionItems to be open at the same time."),
|
|
54
|
+
onChange: import_react_desc.PropTypes.func.description("Callback function once the Dimsum Accordion changes.")
|
|
23
55
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
exports.accordionPropTypes = accordionPropTypes;
|
|
56
|
+
module.exports = __toCommonJS(propTypes_exports);
|
|
57
|
+
//# sourceMappingURL=propTypes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/propTypes.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const accordionItemPropTypes = {\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.'),\n iconOpened: PropTypes.node.description('Custom Dimsum Icon when it is open.'),\n secondaryTitle: PropTypes.string.description('Set a secondary title'),\n customActions: PropTypes.arrayOf(PropTypes.object).description('Set Dimsum AccordionItem custom actions.'),\n renderCustomActions: PropTypes.func.description(\n 'This property will render any JSX in the custom actions area. You can access to all references and active values within the props.',\n ),\n};\n\nexport const accordionPropTypes = {\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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,yBAAyB;AAAA,EACpC,UAAU,4BAAU,KAAK,YAAY,iCAAiC;AAAA,EACtE,OAAO,4BAAU,OAAO,YAAY;AAAA,EACpC,OAAO,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,SAAS,YAC/D,4DACA;AAAA,EACF,YAAY,4BAAU,KAAK,YAAY;AAAA,EACvC,YAAY,4BAAU,KAAK,YAAY;AAAA,EACvC,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAC7C,eAAe,4BAAU,QAAQ,4BAAU,QAAQ,YAAY;AAAA,EAC/D,qBAAqB,4BAAU,KAAK,YAClC;AAAA;AAIG,MAAM,qBAAqB;AAAA,EAChC,gBAAgB,4BAAU,OAAO,YAAY;AAAA,EAC7C,aAAa,4BAAU,UAAU;AAAA,IAC/B,4BAAU,QAAQ,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU;AAAA,IACnE,4BAAU;AAAA,IACV,4BAAU;AAAA,KACT,YAAY;AAAA,EACf,UAAU,4BAAU,KAAK,YAAY;AAAA,EACrC,mBAAmB,4BAAU,KAAK,YAAY;AAAA,EAC9C,UAAU,4BAAU,KAAK,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|