@elliemae/ds-mobile 2.0.0-alpha.10 → 2.0.0-alpha.14
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/Accordion/Accordion.js +5 -5
- package/cjs/Accordion/index.js +5 -5
- package/cjs/CategoryBox/CategoryBox.js +14 -13
- package/cjs/CollectionBox/CollectionBox.js +15 -14
- package/cjs/FullPageContainer/FullPageContainer.js +7 -2
- package/cjs/FullPageContainer/FullPageContainerScroll.js +7 -2
- package/cjs/FullPageContainer/useMobileHeight.js +1 -0
- package/cjs/GlobalHeader/MobileGlobalHeader.js +29 -24
- package/cjs/GlobalHeader/styles.js +5 -11
- package/cjs/GroupBox/GroupBox.js +15 -14
- package/cjs/InfiniteLoader/Infiniteloader.js +11 -9
- package/cjs/InfiniteLoader/Loader.js +12 -9
- package/cjs/InfiniteLoader/VirtualizedInfiniteLoader.js +50 -22
- package/cjs/LoadingPage/Page.js +25 -12
- package/cjs/MobileActionToolbar/MobileActionToolbar.js +8 -7
- package/cjs/MobileActionToolbar/MobileActionToolbarItem.js +6 -1
- package/cjs/MobileBanner/MobileBanner.js +22 -16
- package/cjs/MobileBanner/styles.js +129 -60
- package/cjs/MobileBanner/utils/icons.js +5 -12
- package/cjs/MobileBanner/utils/styleHelpers.js +20 -47
- package/cjs/MobileCard/ActionAddon.js +16 -14
- package/cjs/MobileCard/Card.js +35 -82
- package/cjs/MobileCard/CardIcons.js +21 -16
- package/cjs/MobileCard/ExpandChevron.js +8 -10
- package/cjs/MobileCard/ExpandableRegion.js +7 -7
- package/cjs/MobileCard/Group.js +23 -17
- package/cjs/MobileCard/props.js +62 -0
- package/cjs/MobileCard/useHeight.js +1 -0
- package/cjs/MobileContextMenu/MobileContextMenu.js +37 -28
- package/cjs/MobileContextMenu/MobileContextMenuGroup.js +35 -25
- package/cjs/MobileContextMenu/MobileContextMenuItem.js +30 -36
- package/cjs/MobileDatePicker/Input.js +5 -0
- package/cjs/MobileDatePicker/MobileDatePicker.js +16 -17
- package/cjs/MobileDropdownMenu/MobileDropdownInput.js +27 -17
- package/cjs/MobileDropdownMenu/MobileDropdownMenu.js +21 -17
- package/cjs/MobileEmtpyState/MobileEmptyState.js +10 -8
- package/cjs/MobileFilterbar/Filterbar.js +13 -10
- package/cjs/MobileFilterbar/FilterbarItem.js +15 -12
- package/cjs/MobileFilterbar/FilterbarSort.js +17 -14
- package/cjs/MobileFooter/Action.js +27 -24
- package/cjs/MobileFooter/Footer.js +17 -10
- package/cjs/MobileFooter/Text.js +6 -3
- package/cjs/MobileListItem/MobileListItem.js +15 -14
- package/cjs/MobilePageHeader/MobilePageHeader.js +37 -36
- package/cjs/MobileSelectList/MobileSelectList.js +32 -24
- package/cjs/MobileSelectList/styled.js +9 -11
- package/cjs/MobileSeparator/Separator.js +30 -18
- package/cjs/MobileTimePicker/Input.js +5 -0
- package/cjs/MobileTimePicker/MobileTimePicker.js +16 -17
- package/cjs/MobileTimePicker/MobileTimePicker.stories.js +2 -2
- package/cjs/MobileTouchable/MobileTouchable.js +8 -2
- package/cjs/Modal/Modal.js +32 -27
- package/cjs/Modal/styled.js +11 -12
- package/cjs/PageFilter/PageFilter.js +20 -15
- package/cjs/PageForm/PageForm.js +22 -15
- package/cjs/PageList/PageList.js +12 -11
- package/cjs/PageSearch/PageSearch.js +14 -13
- package/cjs/PageSummary/PageSummary.js +34 -21
- package/cjs/PageSummary/Tags.js +12 -6
- package/cjs/SideNav/SideNav.js +43 -34
- package/cjs/SwipeToRefresh/ProgressIndicator.js +10 -9
- package/cjs/SwipeToRefresh/SwipeToRefresh.js +10 -9
- package/cjs/SwipeToRefresh/styled.js +4 -4
- package/cjs/SwipeToRefresh/useSwipe.js +6 -4
- package/cjs/Tabs/index.js +16 -5
- package/cjs/Tabs/propTypes.js +28 -0
- package/cjs/index.js +11 -5
- package/esm/Accordion/Accordion.js +1 -1
- package/esm/Accordion/index.js +1 -1
- package/esm/CategoryBox/CategoryBox.js +11 -10
- package/esm/CollectionBox/CollectionBox.js +10 -9
- package/esm/FullPageContainer/FullPageContainer.js +6 -1
- package/esm/FullPageContainer/FullPageContainerScroll.js +6 -1
- package/esm/FullPageContainer/useMobileHeight.js +1 -0
- package/esm/GlobalHeader/MobileGlobalHeader.js +21 -14
- package/esm/GlobalHeader/styles.js +4 -11
- package/esm/GroupBox/GroupBox.js +12 -11
- package/esm/InfiniteLoader/Infiniteloader.js +9 -7
- package/esm/InfiniteLoader/Loader.js +12 -9
- package/esm/InfiniteLoader/VirtualizedInfiniteLoader.js +51 -23
- package/esm/LoadingPage/Page.js +25 -12
- package/esm/MobileActionToolbar/MobileActionToolbar.js +7 -6
- package/esm/MobileActionToolbar/MobileActionToolbarItem.js +6 -1
- package/esm/MobileBanner/MobileBanner.js +21 -14
- package/esm/MobileBanner/styles.js +129 -60
- package/esm/MobileBanner/utils/icons.js +1 -4
- package/esm/MobileBanner/utils/styleHelpers.js +16 -47
- package/esm/MobileCard/ActionAddon.js +16 -13
- package/esm/MobileCard/Card.js +29 -76
- package/esm/MobileCard/CardIcons.js +20 -15
- package/esm/MobileCard/ExpandChevron.js +8 -8
- package/esm/MobileCard/ExpandableRegion.js +7 -7
- package/esm/MobileCard/Group.js +21 -15
- package/esm/MobileCard/props.js +58 -0
- package/esm/MobileCard/useHeight.js +1 -0
- package/esm/MobileContextMenu/MobileContextMenu.js +30 -21
- package/esm/MobileContextMenu/MobileContextMenuGroup.js +35 -25
- package/esm/MobileContextMenu/MobileContextMenuItem.js +26 -30
- package/esm/MobileDatePicker/Input.js +5 -0
- package/esm/MobileDatePicker/MobileDatePicker.js +13 -12
- package/esm/MobileDropdownMenu/MobileDropdownInput.js +27 -16
- package/esm/MobileDropdownMenu/MobileDropdownMenu.js +21 -17
- package/esm/MobileEmtpyState/MobileEmptyState.js +10 -7
- package/esm/MobileFilterbar/Filterbar.js +13 -10
- package/esm/MobileFilterbar/FilterbarItem.js +15 -12
- package/esm/MobileFilterbar/FilterbarSort.js +17 -14
- package/esm/MobileFooter/Action.js +26 -23
- package/esm/MobileFooter/Footer.js +14 -7
- package/esm/MobileFooter/Text.js +6 -3
- package/esm/MobileListItem/MobileListItem.js +11 -10
- package/esm/MobilePageHeader/MobilePageHeader.js +19 -17
- package/esm/MobileSelectList/MobileSelectList.js +28 -19
- package/esm/MobileSelectList/styled.js +4 -4
- package/esm/MobileSeparator/Separator.js +28 -16
- package/esm/MobileTimePicker/Input.js +5 -0
- package/esm/MobileTimePicker/MobileTimePicker.js +13 -12
- package/esm/MobileTimePicker/MobileTimePicker.stories.js +1 -1
- package/esm/MobileTouchable/MobileTouchable.js +7 -1
- package/esm/Modal/Modal.js +27 -21
- package/esm/Modal/styled.js +4 -6
- package/esm/PageFilter/PageFilter.js +15 -10
- package/esm/PageForm/PageForm.js +18 -11
- package/esm/PageList/PageList.js +10 -9
- package/esm/PageSearch/PageSearch.js +10 -9
- package/esm/PageSummary/PageSummary.js +32 -19
- package/esm/PageSummary/Tags.js +12 -6
- package/esm/SideNav/SideNav.js +39 -29
- package/esm/SwipeToRefresh/ProgressIndicator.js +9 -8
- package/esm/SwipeToRefresh/SwipeToRefresh.js +9 -8
- package/esm/SwipeToRefresh/styled.js +1 -1
- package/esm/SwipeToRefresh/useSwipe.js +6 -4
- package/esm/Tabs/index.js +13 -4
- package/esm/Tabs/propTypes.js +23 -0
- package/esm/index.js +5 -4
- package/package.json +35 -7
- package/types/Accordion/Accordion.d.ts +1 -1
- package/types/CategoryBox/CategoryBox.d.ts +37 -6
- package/types/CollectionBox/CollectionBox.d.ts +37 -6
- package/types/GlobalHeader/MobileGlobalHeader.d.ts +43 -6
- package/types/GlobalHeader/styles.d.ts +6 -6
- package/types/GroupBox/GroupBox.d.ts +44 -7
- package/types/InfiniteLoader/Infiniteloader.d.ts +30 -5
- package/types/InfiniteLoader/VirtualizedInfiniteLoader.d.ts +56 -8
- package/types/InfiniteLoader/styled.d.ts +1 -1
- package/types/LoadingPage/Page.d.ts +1 -1
- package/types/MobileActionToolbar/MobileActionToolbar.d.ts +16 -4
- package/types/MobileActionToolbar/MobileActionToolbarItem.d.ts +15 -2
- package/types/MobileBanner/MobileBanner.d.ts +72 -12
- package/types/MobileBanner/propTypes.d.ts +67 -11
- package/types/MobileBanner/styles.d.ts +10 -10
- package/types/MobileCard/Card.d.ts +20 -13
- package/types/MobileCard/ExpandableRegion.d.ts +2 -2
- package/types/MobileCard/Group.d.ts +18 -8
- package/types/MobileCard/StyledCard.d.ts +3 -1
- package/types/MobileCard/index.d.ts +13 -12
- package/types/MobileCard/props.d.ts +118 -0
- package/types/MobileContextMenu/MobileContextMenu.d.ts +13 -2
- package/types/MobileContextMenu/MobileContextMenuGroup.d.ts +37 -5
- package/types/MobileContextMenu/MobileContextMenuItem.d.ts +54 -9
- package/types/MobileDatePicker/MobileDatePicker.d.ts +43 -7
- package/types/MobileDropdownMenu/MobileDropdownInput.d.ts +2 -2
- package/types/MobileDropdownMenu/MobileDropdownMenu.d.ts +24 -4
- package/types/MobileEmtpyState/MobileEmptyState.d.ts +14 -2
- package/types/MobileFilterbar/Filterbar.d.ts +9 -2
- package/types/MobileFilterbar/FilterbarItem.d.ts +15 -2
- package/types/MobileFilterbar/FilterbarSort.d.ts +9 -2
- package/types/MobileFooter/Action.d.ts +19 -3
- package/types/MobileFooter/Footer.d.ts +8 -1
- package/types/MobileFooter/Text.d.ts +8 -1
- package/types/MobileListItem/MobileListItem.d.ts +17 -7
- package/types/MobilePageHeader/MobilePageHeader.d.ts +21 -11
- package/types/MobileSelectList/MobileSelectList.d.ts +3 -3
- package/types/MobileSelectList/styled.d.ts +5 -5
- package/types/MobileSeparator/Separator.d.ts +23 -5
- package/types/MobileTimePicker/MobileTimePicker.d.ts +32 -6
- package/types/MobileTouchable/MobileTouchable.d.ts +1 -1
- package/types/Modal/Modal.d.ts +50 -9
- package/types/Modal/styled.d.ts +7 -6
- package/types/PageList/PageList.d.ts +2 -2
- package/types/PageSearch/PageSearch.d.ts +2 -2
- package/types/PageSummary/Tags.d.ts +4 -4
- package/types/SideNav/SideNav.d.ts +26 -5
- package/types/SideNav/styles.d.ts +8 -8
- package/types/SwipeToRefresh/SwipeToRefresh.d.ts +22 -3
- package/types/SwipeToRefresh/styled.d.ts +5 -4
- package/types/Tabs/index.d.ts +24 -9
- package/types/Tabs/propTypes.d.ts +42 -0
- package/types/index.d.ts +5 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import ChevronSmallDown from '@elliemae/ds-icons
|
|
5
|
-
import DSButton from '@elliemae/ds-
|
|
4
|
+
import { ChevronSmallDown } from '@elliemae/ds-icons';
|
|
5
|
+
import DSButton from '@elliemae/ds-button';
|
|
6
6
|
|
|
7
7
|
const Addon = /*#__PURE__*/styled(DSButton).withConfig({
|
|
8
8
|
componentId: "sc-afblfw-0"
|
|
9
9
|
})(["background-color:transparent;padding-right:4px;height:100%;border:none;font-size:12px;font-weight:", ";color:", ";cursor:pointer;&:focus,&::after{background-color:transparent;box-shadow:none !important;border:none !important;}"], props => props.theme.fontWeights.semibold, props => props.theme.colors.brand['700']);
|
|
10
|
-
const ActionAddon =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
10
|
+
const ActionAddon = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
label,
|
|
13
|
+
onClick,
|
|
14
|
+
icon
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(Addon, {
|
|
17
|
+
onClick: onClick,
|
|
18
|
+
labelText: label,
|
|
19
|
+
icon: icon || /*#__PURE__*/_jsx(ChevronSmallDown, {
|
|
20
|
+
color: ['brand-primary', 700]
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
};
|
|
21
24
|
|
|
22
25
|
export { ActionAddon };
|
package/esm/MobileCard/Card.js
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
2
4
|
import { useRef } from 'react';
|
|
3
|
-
import {
|
|
5
|
+
import { describe } from 'react-desc';
|
|
4
6
|
import styled from 'styled-components';
|
|
5
7
|
import { padding } from 'styled-system';
|
|
6
8
|
import { truncate, toMobile, color, __UNSAFE_SPACE_TO_DIMSUM, border, withTheme, op } from '@elliemae/ds-system';
|
|
7
9
|
import GroupItem from '@elliemae/ds-shared/GroupContext/GroupItem';
|
|
8
|
-
import { Grid } from '@elliemae/ds-
|
|
10
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
9
11
|
import { StyledCard } from './StyledCard.js';
|
|
10
12
|
import { ExpandChevron } from './ExpandChevron.js';
|
|
11
13
|
import { useHeight } from './useHeight.js';
|
|
12
14
|
import { ExpandableRegion } from './ExpandableRegion.js';
|
|
15
|
+
import { cardPropsTypes } from './props.js';
|
|
13
16
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
14
17
|
|
|
15
18
|
const TitleEllipsis = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -17,7 +20,7 @@ const TitleEllipsis = /*#__PURE__*/styled.div.withConfig({
|
|
|
17
20
|
})(["", ""], truncate());
|
|
18
21
|
const Title = /*#__PURE__*/styled.div.withConfig({
|
|
19
22
|
componentId: "sc-10tpzm8-1"
|
|
20
|
-
})(["", " ", " font-weight:", ";font-size:", ";width:100%;", ""], padding, truncate(), props => props.theme.fontWeights.semibold, props => toMobile(props.theme.fontSizes.title[600]), color('neutral',
|
|
23
|
+
})(["", " ", " font-weight:", ";font-size:", ";width:100%;", ""], padding, truncate(), props => props.theme.fontWeights.semibold, props => toMobile(props.theme.fontSizes.title[600]), color('neutral', 800));
|
|
21
24
|
const Detail = /*#__PURE__*/styled.span.withConfig({
|
|
22
25
|
componentId: "sc-10tpzm8-2"
|
|
23
26
|
})(["", " ", " font-size:", ";font-weight:", ";"], padding, truncate(), props => toMobile(props.theme.fontSizes.title[500]), props => props.theme.fontWeights.regular);
|
|
@@ -26,7 +29,7 @@ const SubText = /*#__PURE__*/styled.span.withConfig({
|
|
|
26
29
|
})(["margin-top:", ";", " &:nth-child(2){padding-left:", ";}"], props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xs), truncate(), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.s));
|
|
27
30
|
const SubTextWrap = /*#__PURE__*/styled.div.withConfig({
|
|
28
31
|
componentId: "sc-10tpzm8-4"
|
|
29
|
-
})(["", " border-top:", ";margin-top:6px;margin-bottom:2px;padding-bottom:", ";font-size:", ";", " font-weight:", ";display:flex;justify-content:space-between;"], truncate(), props => border(props.theme.colors.neutral['300']), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => toMobile(props.theme.fontSizes.subTitle[400]), color('neutral',
|
|
32
|
+
})(["", " border-top:", ";margin-top:6px;margin-bottom:2px;padding-bottom:", ";font-size:", ";", " font-weight:", ";display:flex;justify-content:space-between;"], truncate(), props => border(props.theme.colors.neutral['300']), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => toMobile(props.theme.fontSizes.subTitle[400]), color('neutral', 500), props => props.theme.fontWeights.regular);
|
|
30
33
|
const LeftIcon = /*#__PURE__*/styled(Grid).withConfig({
|
|
31
34
|
componentId: "sc-10tpzm8-5"
|
|
32
35
|
})(["& > span{height:", ";width:", ";}& > span > svg,svg:not([fill]){height:", ";width:", ";}"], props => props.halfM, props => props.halfM, props => props.halfM, props => props.halfM);
|
|
@@ -34,28 +37,31 @@ const CenterWrap = /*#__PURE__*/styled.div.withConfig({
|
|
|
34
37
|
componentId: "sc-10tpzm8-6"
|
|
35
38
|
})(["display:flex;align-items:center;", ""], truncate());
|
|
36
39
|
|
|
37
|
-
const MobileCard =
|
|
38
|
-
|
|
39
|
-
height = 'm',
|
|
40
|
-
leftAddOn,
|
|
41
|
-
leftProp,
|
|
42
|
-
rightProp,
|
|
43
|
-
subText,
|
|
44
|
-
subIcons,
|
|
45
|
-
details,
|
|
46
|
-
theme,
|
|
47
|
-
expandable = false,
|
|
48
|
-
expandedContent,
|
|
49
|
-
value
|
|
50
|
-
}) => {
|
|
51
|
-
var _TitleEllipsis, _SubText;
|
|
40
|
+
const MobileCard = _ref => {
|
|
41
|
+
var _TitleEllipsis, _SubText, _Grid;
|
|
52
42
|
|
|
43
|
+
let {
|
|
44
|
+
children,
|
|
45
|
+
height = 'm',
|
|
46
|
+
leftAddOn,
|
|
47
|
+
leftProp,
|
|
48
|
+
rightProp,
|
|
49
|
+
subText,
|
|
50
|
+
subIcons,
|
|
51
|
+
details,
|
|
52
|
+
theme,
|
|
53
|
+
expandable = false,
|
|
54
|
+
expandedContent,
|
|
55
|
+
value,
|
|
56
|
+
cardContent
|
|
57
|
+
} = _ref;
|
|
53
58
|
const subTextRef = useRef(null);
|
|
54
59
|
const subTextHeight = useHeight(subTextRef);
|
|
55
60
|
const isJustChildren = !(subText || subIcons || details);
|
|
56
61
|
const halfM = op('/', __UNSAFE_SPACE_TO_DIMSUM(theme.space.m), 2);
|
|
57
62
|
return /*#__PURE__*/_jsx(GroupItem, {
|
|
58
|
-
render: (
|
|
63
|
+
render: function () {
|
|
64
|
+
let context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
59
65
|
const {
|
|
60
66
|
activeValue,
|
|
61
67
|
onChange
|
|
@@ -94,7 +100,7 @@ const MobileCard = ({
|
|
|
94
100
|
}, void 0, _TitleEllipsis || (_TitleEllipsis = /*#__PURE__*/_jsx(TitleEllipsis, {}, void 0, children)), details && /*#__PURE__*/_jsx(Grid, {
|
|
95
101
|
"data-testid": "card-details",
|
|
96
102
|
cols: details.map(() => 'min-content'),
|
|
97
|
-
mb: !(subText || subIcons) && halfM,
|
|
103
|
+
mb: !(subText || subIcons) && halfM || 0,
|
|
98
104
|
pt: op('/', __UNSAFE_SPACE_TO_DIMSUM(theme.space.xxs), 2)
|
|
99
105
|
}, void 0, details.map((d, i) => /*#__PURE__*/_jsx(Detail, {}, i, d, i < details.length - 1 && /*#__PURE__*/_jsx(Detail, {
|
|
100
106
|
px: __UNSAFE_SPACE_TO_DIMSUM(theme.space.xxs)
|
|
@@ -113,66 +119,13 @@ const MobileCard = ({
|
|
|
113
119
|
}), /*#__PURE__*/_jsx(ExpandableRegion, {
|
|
114
120
|
show: selected,
|
|
115
121
|
content: expandedContent
|
|
116
|
-
})));
|
|
122
|
+
}), cardContent && (_Grid || (_Grid = /*#__PURE__*/_jsx(Grid, {}, void 0, cardContent)))));
|
|
117
123
|
}
|
|
118
124
|
});
|
|
119
125
|
};
|
|
120
126
|
|
|
121
|
-
const props = {
|
|
122
|
-
/**
|
|
123
|
-
* card height
|
|
124
|
-
*/
|
|
125
|
-
height: PropTypes.oneOf(['s', 'm']).description('card height'),
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Defines mobile card title
|
|
129
|
-
*/
|
|
130
|
-
children: PropTypes.string.isRequired.description('Defines mobile card title'),
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Wheter if the card is expandable or not
|
|
134
|
-
*/
|
|
135
|
-
expandable: PropTypes.bool.description('Wheter if the card is expandable or not'),
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* content to display in expand card section
|
|
139
|
-
*/
|
|
140
|
-
expandedContent: PropTypes.element.description('content to display in expand card section'),
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Icon to the left of the card. Size is adjusted automatically.
|
|
144
|
-
*/
|
|
145
|
-
leftAddOn: PropTypes.element.description('Icon to the left of the card. Size is adjusted automatically.'),
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Pass an element to render left. For example a Button with an icon
|
|
149
|
-
*/
|
|
150
|
-
leftProp: PropTypes.element.description('Pass an element to render left. For example a Button with an icon'),
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Pass an array of 1 or 2 elements to render right. For example a Button with an icon
|
|
154
|
-
*/
|
|
155
|
-
rightProp: PropTypes.arrayOf(PropTypes.element).description('Pass an array of 1 or 2 elements to render right. For example a Button with an icon'),
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Pass an array of 1 or 2 strings
|
|
159
|
-
*/
|
|
160
|
-
subText: PropTypes.arrayOf(PropTypes.string).description('Pass an array of 1 or 2 strings'),
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* SubIcons component
|
|
164
|
-
*/
|
|
165
|
-
subIcons: PropTypes.element.description('SubIcons component'),
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Pass an array of 1, 2 or 3 strings
|
|
169
|
-
*/
|
|
170
|
-
details: PropTypes.arrayOf(PropTypes.string).description('Pass an array of 1, 2 or 3 strings'),
|
|
171
|
-
theme: PropTypes.object.isRequired.description(''),
|
|
172
|
-
value: PropTypes.number.description('')
|
|
173
|
-
};
|
|
174
127
|
const DSMobileCardWithSchema = describe(MobileCard);
|
|
175
|
-
DSMobileCardWithSchema.propTypes =
|
|
128
|
+
DSMobileCardWithSchema.propTypes = cardPropsTypes;
|
|
176
129
|
var MobileCard$1 = withTheme(MobileCard);
|
|
177
130
|
|
|
178
131
|
export { DSMobileCardWithSchema, MobileCard$1 as default };
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
2
4
|
import 'react';
|
|
3
5
|
import styled from 'styled-components';
|
|
4
|
-
import { Grid } from '@elliemae/ds-
|
|
6
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
5
7
|
|
|
6
8
|
const CardIconsWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
7
9
|
componentId: "sc-1vqygz1-0"
|
|
8
10
|
})(["align-items:center;span,svg{width:12px !important;height:12px !important;}span.icon-color-muted svg,svg:not([fill]){fill:", ";height:12px !important;width:12px !important;& *{fill:", ";}}span.icon-color-warn svg,svg:not([fill]){fill:", ";height:12px !important;width:12px !important;& *{fill:", ";}}span.icon-color-error svg,svg:not([fill]){fill:", ";height:12px !important;width:12px !important;& *{fill:", ";}}span.icon-color-success svg,svg:not([fill]){fill:", ";height:12px !important;width:12px !important;& *{fill:", ";}}span.icon-color-primary svg,svg:not([fill]){fill:", ";}span.icon-color-primary svg,svg:not([fill]){fill:", ";}"], props => props.theme.colors.neutral['600'], props => props.theme.colors.neutral['600'], props => props.theme.colors.warning['600'], props => props.theme.colors.warning['600'], props => props.theme.colors.danger['900'], props => props.theme.colors.danger['900'], props => props.theme.colors.success['900'], props => props.theme.colors.success['900'], props => props.theme.colors.brand[600], props => props.theme.colors.brand[600]);
|
|
9
|
-
const SubIcons =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
const SubIcons = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
icons = [],
|
|
14
|
+
colors = []
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/_jsx(CardIconsWrapper, {
|
|
17
|
+
cols: icons.map(() => '12px'),
|
|
18
|
+
gutter: "6px",
|
|
19
|
+
height: "14px",
|
|
20
|
+
"data-testid": "card-subIcons"
|
|
21
|
+
}, void 0, icons.map((Icon, i) =>
|
|
22
|
+
/*#__PURE__*/
|
|
23
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
24
|
+
_jsx(Icon, {
|
|
25
|
+
className: "icon-color-".concat(colors[i] || 'muted')
|
|
26
|
+
}, i)));
|
|
27
|
+
};
|
|
23
28
|
|
|
24
29
|
export { SubIcons };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import
|
|
5
|
-
import ChevronRight from '@elliemae/ds-icons/ChevronRight';
|
|
4
|
+
import { ChevronDown, ChevronRight } from '@elliemae/ds-icons';
|
|
6
5
|
|
|
7
6
|
const ChevronWrap = /*#__PURE__*/styled.div.withConfig({
|
|
8
7
|
componentId: "sc-1l0ask2-0"
|
|
9
8
|
})(["margin-top:", ";align-self:", ";margin-left:", ";"], props => props.align === 'top' ? '18px' : '0', props => props.align === 'top' ? 'flex-start' : 'center', props => props.theme.space.xs);
|
|
10
|
-
const ExpandChevron =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
const ExpandChevron = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
isExpanded,
|
|
12
|
+
onClick,
|
|
13
|
+
align
|
|
14
|
+
} = _ref;
|
|
15
|
+
const Chevron = isExpanded ? ChevronDown : ChevronRight;
|
|
16
16
|
return /*#__PURE__*/_jsx(ChevronWrap, {
|
|
17
17
|
"data-testid": "ds-card-expand-chevron",
|
|
18
18
|
align: align
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { useRef, useState, useEffect } from 'react';
|
|
3
4
|
import styled from 'styled-components';
|
|
4
5
|
import { truncate, border } from '@elliemae/ds-system';
|
|
@@ -9,15 +10,14 @@ const RegionWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
9
10
|
})(["width:100%;height:100%;"]);
|
|
10
11
|
const Region = /*#__PURE__*/styled.div.withConfig({
|
|
11
12
|
componentId: "sc-mduzz9-1"
|
|
12
|
-
})(["display:flex;", " transition:max-height ", " linear;max-height:0;", " align-items:center;", ";border-top:", ";font-weight:", ";"], props => props.hide ? 'visibility: hidden;' : '', props => props.animate ? '0.25s' : '0.20s', props => props.animate ?
|
|
13
|
-
|
|
14
|
-
` : '', truncate(), props => border(props.theme.colors.neutral['300']), props => props.theme.fontWeights.regular);
|
|
15
|
-
const ExpandableRegion = ({
|
|
16
|
-
show,
|
|
17
|
-
content
|
|
18
|
-
}) => {
|
|
13
|
+
})(["display:flex;", " transition:max-height ", " linear;max-height:0;", " align-items:center;", ";border-top:", ";font-weight:", ";"], props => props.hide ? 'visibility: hidden;' : '', props => props.animate ? '0.25s' : '0.20s', props => props.animate ? "\n max-height: ".concat(props.refHeight, "px;\n ") : '', truncate(), props => border(props.theme.colors.neutral['300']), props => props.theme.fontWeights.regular);
|
|
14
|
+
const ExpandableRegion = _ref => {
|
|
19
15
|
var _ref$current;
|
|
20
16
|
|
|
17
|
+
let {
|
|
18
|
+
show,
|
|
19
|
+
content
|
|
20
|
+
} = _ref;
|
|
21
21
|
const ref = useRef(null); // triggers transition
|
|
22
22
|
|
|
23
23
|
const [animate, setAnimate] = useState(show); // needed to properly handle the transition. Hide after transition ends
|
package/esm/MobileCard/Group.js
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import { PropTypes, describe } from 'react-desc';
|
|
4
6
|
import styled from 'styled-components';
|
|
5
7
|
import Group from '@elliemae/ds-shared/GroupContext/Group';
|
|
6
|
-
import { Grid } from '@elliemae/ds-
|
|
8
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
7
9
|
import { truncate, __UNSAFE_SPACE_TO_DIMSUM, color, border, withTheme } from '@elliemae/ds-system';
|
|
8
10
|
import { StyledCard } from './StyledCard.js';
|
|
9
11
|
|
|
10
12
|
const GroupGrid = /*#__PURE__*/styled(Grid).withConfig({
|
|
11
13
|
componentId: "sc-17xukaf-0"
|
|
12
|
-
})(["", "{border-top:none;}", ""], StyledCard,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
})(["", "{border-top:none;}", ""], StyledCard, _ref => {
|
|
15
|
+
let {
|
|
16
|
+
theme,
|
|
17
|
+
withTopBorder
|
|
18
|
+
} = _ref;
|
|
19
|
+
return withTopBorder ? "border-top: ".concat(border(theme.colors.neutral['100'])) : '';
|
|
20
|
+
});
|
|
16
21
|
const GroupTitle = /*#__PURE__*/styled.span.withConfig({
|
|
17
22
|
componentId: "sc-17xukaf-1"
|
|
18
23
|
})(["", ""], truncate());
|
|
19
24
|
const GroupTitleGrid = /*#__PURE__*/styled.div.withConfig({
|
|
20
25
|
componentId: "sc-17xukaf-2"
|
|
21
|
-
})(["display:flex;justify-content:space-between;padding:0 ", ";font-size:", ";", " font-weight:", ";background-color:", ";border-top:", ";line-height:", ";@media (min-width:1024px){background-color:", ";border-top:", ";}"], props => props.theme.space.xs, props =>
|
|
26
|
+
})(["display:flex;justify-content:space-between;padding:0 ", ";font-size:", ";", " font-weight:", ";background-color:", ";border-top:", ";line-height:", ";@media (min-width:1024px){background-color:", ";border-top:", ";}"], props => props.theme.space.xs, props => "calc(".concat(__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m), " / 2)"), color('neutral', '700'), props => props.theme.fontWeights.semibold, props => props.theme.colors.brand['200'], props => border(props.theme.colors.brand['300']), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.m), props => props.theme.colors.neutral['080'], props => border(props.theme.colors.neutral['080']));
|
|
22
27
|
|
|
23
|
-
const MobileCardGroup =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const MobileCardGroup = _ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
children,
|
|
31
|
+
theme,
|
|
32
|
+
title,
|
|
33
|
+
action,
|
|
34
|
+
activeValue,
|
|
35
|
+
allowMultipleOpen = false,
|
|
36
|
+
onChange = () => null
|
|
37
|
+
} = _ref2;
|
|
32
38
|
const rows = !title ? ['auto'] : [__UNSAFE_SPACE_TO_DIMSUM(theme.space.m), 'auto'];
|
|
33
39
|
return /*#__PURE__*/_jsx(Group, {
|
|
34
40
|
activeValue: activeValue,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { PropTypes } from 'react-desc';
|
|
2
|
+
|
|
3
|
+
const cardPropsTypes = {
|
|
4
|
+
/**
|
|
5
|
+
* card height
|
|
6
|
+
*/
|
|
7
|
+
height: PropTypes.oneOf(['s', 'm']).description('card height'),
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Defines mobile card title
|
|
11
|
+
*/
|
|
12
|
+
children: PropTypes.string.description('Defines mobile card title').isRequired,
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Wheter if the card is expandable or not
|
|
16
|
+
*/
|
|
17
|
+
expandable: PropTypes.bool.description('Wheter if the card is expandable or not'),
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* content to display in expand card section
|
|
21
|
+
*/
|
|
22
|
+
expandedContent: PropTypes.element.description('content to display in expand card section'),
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Icon to the left of the card. Size is adjusted automatically.
|
|
26
|
+
*/
|
|
27
|
+
leftAddOn: PropTypes.element.description('Icon to the left of the card. Size is adjusted automatically.'),
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Pass an element to render left. For example a Button with an icon
|
|
31
|
+
*/
|
|
32
|
+
leftProp: PropTypes.element.description('Pass an element to render left. For example a Button with an icon'),
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Pass an array of 1 or 2 elements to render right. For example a Button with an icon
|
|
36
|
+
*/
|
|
37
|
+
rightProp: PropTypes.arrayOf(PropTypes.element).description('Pass an array of 1 or 2 elements to render right. For example a Button with an icon'),
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Pass an array of 1 or 2 strings
|
|
41
|
+
*/
|
|
42
|
+
subText: PropTypes.arrayOf(PropTypes.string).description('Pass an array of 1 or 2 strings'),
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* SubIcons component
|
|
46
|
+
*/
|
|
47
|
+
subIcons: PropTypes.element.description('SubIcons component'),
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Pass an array of 1, 2 or 3 strings
|
|
51
|
+
*/
|
|
52
|
+
details: PropTypes.arrayOf(PropTypes.string).description('Pass an array of 1, 2 or 3 strings'),
|
|
53
|
+
theme: PropTypes.object.description('').isRequired,
|
|
54
|
+
value: PropTypes.number.description(''),
|
|
55
|
+
cardContent: PropTypes.node.description('JSX content for the card')
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { cardPropsTypes };
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
11
|
import React, { useState, useMemo, useRef } from 'react';
|
|
4
12
|
import { noop } from 'lodash';
|
|
5
13
|
import { PropTypes, describe } from 'react-desc';
|
|
6
14
|
import styled from 'styled-components';
|
|
7
|
-
import { Grid } from '@elliemae/ds-
|
|
8
|
-
import { DSBackdrop } from '@elliemae/ds-
|
|
15
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
16
|
+
import { DSBackdrop } from '@elliemae/ds-backdrop';
|
|
9
17
|
import { truncate, withTheme } from '@elliemae/ds-system';
|
|
10
18
|
import Group from '@elliemae/ds-shared/GroupContext/Group';
|
|
11
19
|
import { DSMobileContextMenuGroup } from './MobileContextMenuGroup.js';
|
|
@@ -18,7 +26,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
18
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
27
|
const StyledContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
20
28
|
componentId: "sc-15ys5tq-0"
|
|
21
|
-
})(["background:", ";z-index:", ";width:", ";position:fixed;bottom:0;left:", ";max-height:90vh;border-top-left-radius:5px;border-top-right-radius:5px;box-shadow:0 0px 24px 0 rgba(0,0,0,0.5),0 0px 11px 0 rgba(0,0,0,0.5);"], props => props.theme.colors.neutral['000'], props => props.zIndex, props =>
|
|
29
|
+
})(["background:", ";z-index:", ";width:", ";position:fixed;bottom:0;left:", ";max-height:90vh;border-top-left-radius:5px;border-top-right-radius:5px;box-shadow:0 0px 24px 0 rgba(0,0,0,0.5),0 0px 11px 0 rgba(0,0,0,0.5);"], props => props.theme.colors.neutral['000'], props => props.zIndex, props => "calc(100% - ".concat(props.theme.space.xs, ")"), props => props.theme.space.xxs);
|
|
22
30
|
const StyledTitle = /*#__PURE__*/styled(Grid).withConfig({
|
|
23
31
|
componentId: "sc-15ys5tq-1"
|
|
24
32
|
})(["font-size:16px;font-weight:", ";color:", ";", " & > span{height:20px;width:20px;}& > span > svg,svg:not([fill]){height:20px;width:20px;fill:", ";}"], props => props.theme.fontWeights.semibold, props => props.theme.colors.neutral['000'], truncate(), props => props.theme.colors.neutral['000']);
|
|
@@ -28,22 +36,23 @@ const HeaderContainer = /*#__PURE__*/styled(Grid).withConfig({
|
|
|
28
36
|
|
|
29
37
|
const isArr = prop => Array.isArray(prop);
|
|
30
38
|
|
|
31
|
-
const DSMobileContextMenu = withTheme(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
const DSMobileContextMenu = withTheme(_ref => {
|
|
40
|
+
let {
|
|
41
|
+
open = false,
|
|
42
|
+
title = '',
|
|
43
|
+
multiple = false,
|
|
44
|
+
singleSelect = false,
|
|
45
|
+
onChange = noop,
|
|
46
|
+
onClickOutside = noop,
|
|
47
|
+
children,
|
|
48
|
+
theme,
|
|
49
|
+
backdropZIndex,
|
|
50
|
+
zIndex = 1,
|
|
51
|
+
dataTestid = 'mobile-context-menu',
|
|
52
|
+
buttonFooter = null,
|
|
53
|
+
onApply = noop,
|
|
54
|
+
selecteds: initSelecteds
|
|
55
|
+
} = _ref;
|
|
47
56
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
48
57
|
const trueSelected = useMemo(() => initSelecteds !== undefined ? initSelecteds : [...selectedItems], [initSelecteds, selectedItems]);
|
|
49
58
|
const containerRef = useRef(null);
|
|
@@ -111,7 +120,7 @@ const DSMobileContextMenu = withTheme(({
|
|
|
111
120
|
if (singleSelect) isSelected = trueSelected === value;else if (multiple) isSelected = trueSelected.includes(value);
|
|
112
121
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
113
122
|
value,
|
|
114
|
-
key:
|
|
123
|
+
key: "cm.".concat(ii),
|
|
115
124
|
isMulti: multiple,
|
|
116
125
|
singleSelect,
|
|
117
126
|
isSelected,
|
|
@@ -124,7 +133,7 @@ const DSMobileContextMenu = withTheme(({
|
|
|
124
133
|
alignItems: "center"
|
|
125
134
|
}, void 0, /*#__PURE__*/React.cloneElement(buttonFooter, _objectSpread(_objectSpread({}, buttonFooter.props), {}, {
|
|
126
135
|
containerProps: {
|
|
127
|
-
'data-testid':
|
|
136
|
+
'data-testid': "".concat(dataTestid, "--btn")
|
|
128
137
|
},
|
|
129
138
|
buttonType: 'primary',
|
|
130
139
|
size: 'l',
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
10
|
import React from 'react';
|
|
4
11
|
import styled from 'styled-components';
|
|
5
|
-
import { Grid } from '@elliemae/ds-
|
|
12
|
+
import { Grid } from '@elliemae/ds-grid';
|
|
6
13
|
import { noop } from 'lodash';
|
|
7
14
|
import { PropTypes, describe } from 'react-desc';
|
|
8
15
|
|
|
@@ -13,32 +20,35 @@ const Title = /*#__PURE__*/styled.div.withConfig({
|
|
|
13
20
|
componentId: "sc-atfpfh-0"
|
|
14
21
|
})(["height:24px;line-height:24px;font-size:12px;border-top:1px solid ", ";background:", ";padding:0 ", ";color:", ";font-weight:", ";"], props => props.theme.colors.brand['300'], props => props.theme.colors.brand['200'], props => props.theme.space.xs, props => props.theme.colors.neutral['700'], props => props.theme.fontWeights.semibold);
|
|
15
22
|
|
|
16
|
-
const DSMobileContextMenuGroup =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
singleSelect,
|
|
20
|
-
children,
|
|
21
|
-
value: groupValue,
|
|
22
|
-
selectedItems
|
|
23
|
-
}) => /*#__PURE__*/_jsx(Grid, {}, void 0, /*#__PURE__*/_jsx(Grid, {}, void 0, /*#__PURE__*/_jsx(Title, {}, void 0, title)), /*#__PURE__*/_jsx(Grid, {}, void 0, React.Children.map(children, (child, index) => {
|
|
24
|
-
const {
|
|
25
|
-
onClick = noop
|
|
26
|
-
} = child.props;
|
|
27
|
-
const value = `${groupValue}:${index}`;
|
|
28
|
-
let isSelected;
|
|
29
|
-
if (singleSelect) isSelected = selectedItems === value;else if (isMulti) isSelected = selectedItems.includes(value);
|
|
30
|
-
return /*#__PURE__*/React.cloneElement(child, {
|
|
31
|
-
value,
|
|
32
|
-
key: 'group.'.concat(index),
|
|
33
|
-
isGroup: true,
|
|
23
|
+
const DSMobileContextMenuGroup = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
title,
|
|
34
26
|
isMulti,
|
|
35
27
|
singleSelect,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
41
|
-
|
|
28
|
+
children,
|
|
29
|
+
value: groupValue,
|
|
30
|
+
selectedItems
|
|
31
|
+
} = _ref;
|
|
32
|
+
return /*#__PURE__*/_jsx(Grid, {}, void 0, /*#__PURE__*/_jsx(Grid, {}, void 0, /*#__PURE__*/_jsx(Title, {}, void 0, title)), /*#__PURE__*/_jsx(Grid, {}, void 0, React.Children.map(children, (child, index) => {
|
|
33
|
+
const {
|
|
34
|
+
onClick = noop
|
|
35
|
+
} = child.props;
|
|
36
|
+
const value = "".concat(groupValue, ":").concat(index);
|
|
37
|
+
let isSelected;
|
|
38
|
+
if (singleSelect) isSelected = selectedItems === value;else if (isMulti) isSelected = selectedItems.includes(value);
|
|
39
|
+
return /*#__PURE__*/React.cloneElement(child, {
|
|
40
|
+
value,
|
|
41
|
+
key: 'group.'.concat(index),
|
|
42
|
+
isGroup: true,
|
|
43
|
+
isMulti,
|
|
44
|
+
singleSelect,
|
|
45
|
+
isSelected,
|
|
46
|
+
onClick: e => onClick(e, _objectSpread({
|
|
47
|
+
value
|
|
48
|
+
}, child.props))
|
|
49
|
+
});
|
|
50
|
+
})));
|
|
51
|
+
};
|
|
42
52
|
|
|
43
53
|
const props = {
|
|
44
54
|
/**
|