@zohodesk/components 1.0.0-alpha-260 → 1.0.0-alpha-262
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/README.md +16 -0
- package/es/DateTime/DateTimePopupHeader.js +1 -1
- package/es/DateTime/DateWidget.js +1 -1
- package/es/DateTime/YearView.js +1 -1
- package/es/DateTime/index.js +1 -1
- package/es/DropBox/DropBox.module.css +0 -1
- package/es/DropDown/index.js +7 -0
- package/es/Layout/index.js +9 -9
- package/es/ListItem/ListItem.js +4 -3
- package/es/ListItem/ListItem.module.css +5 -0
- package/es/ListItem/ListItemWithAvatar.js +4 -3
- package/es/ListItem/ListItemWithCheckBox.js +3 -2
- package/es/ListItem/ListItemWithIcon.js +4 -3
- package/es/ListItem/ListItemWithRadio.js +3 -2
- package/es/ListItem/index.js +6 -0
- package/es/ListItem/props/defaultProps.js +12 -6
- package/es/ListItem/props/propTypes.js +7 -1
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +1 -1
- package/es/MultiSelect/AdvancedMultiSelect.js +1 -1
- package/es/MultiSelect/MultiSelect.js +19 -6
- package/es/MultiSelect/MultiSelectWithAvatar.js +19 -6
- package/es/MultiSelect/index.js +4 -0
- package/es/MultiSelect/props/defaultProps.js +5 -2
- package/es/MultiSelect/props/propTypes.js +7 -1
- package/es/PopOver/index.js +3 -0
- package/es/Provider/IdProvider.js +8 -7
- package/es/Provider/index.js +4 -0
- package/es/Responsive/index.js +11 -8
- package/es/Select/GroupSelect.js +1 -1
- package/es/Select/Select.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/Select/index.js +4 -0
- package/es/Tab/Tab.module.css +0 -1
- package/es/Tab/Tabs.js +1 -1
- package/es/Tab/Tabs.module.css +0 -1
- package/es/Tag/Tag.js +1 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/VelocityAnimation/index.js +2 -0
- package/es/index.js +30 -146
- package/es/semantic/index.js +1 -0
- package/es/utils/Common.js +0 -1
- package/es/utils/css/compileClassNames.js +23 -0
- package/es/utils/css/mergeStyle.js +42 -0
- package/es/utils/css/utils.js +23 -0
- package/es/utils/dropDownUtils.js +3 -2
- package/es/utils/index.js +3 -0
- package/lib/DateTime/DateTimePopupHeader.js +4 -4
- package/lib/DateTime/DateWidget.js +2 -2
- package/lib/DateTime/YearView.js +2 -2
- package/lib/DateTime/index.js +1 -1
- package/lib/DropBox/DropBox.module.css +0 -1
- package/lib/DropDown/index.js +56 -0
- package/lib/Layout/index.js +1 -11
- package/lib/ListItem/ListItem.js +5 -4
- package/lib/ListItem/ListItem.module.css +5 -0
- package/lib/ListItem/ListItemWithAvatar.js +5 -4
- package/lib/ListItem/ListItemWithCheckBox.js +3 -2
- package/lib/ListItem/ListItemWithIcon.js +6 -5
- package/lib/ListItem/ListItemWithRadio.js +3 -2
- package/lib/ListItem/index.js +48 -0
- package/lib/ListItem/props/defaultProps.js +12 -6
- package/lib/ListItem/props/propTypes.js +7 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -2
- package/lib/MultiSelect/AdvancedMultiSelect.js +2 -2
- package/lib/MultiSelect/MultiSelect.js +20 -7
- package/lib/MultiSelect/MultiSelectWithAvatar.js +20 -7
- package/lib/MultiSelect/index.js +34 -0
- package/lib/MultiSelect/props/defaultProps.js +5 -2
- package/lib/MultiSelect/props/propTypes.js +7 -1
- package/lib/PopOver/index.js +27 -0
- package/lib/Provider/IdProvider.js +8 -8
- package/lib/Provider/index.js +76 -0
- package/lib/Responsive/index.js +45 -22
- package/lib/Select/GroupSelect.js +2 -2
- package/lib/Select/Select.js +2 -2
- package/lib/Select/SelectWithIcon.js +3 -3
- package/lib/Select/index.js +34 -0
- package/lib/Tab/Tab.module.css +0 -1
- package/lib/Tab/Tabs.js +2 -2
- package/lib/Tab/Tabs.module.css +0 -1
- package/lib/Tag/Tag.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +2 -2
- package/lib/VelocityAnimation/index.js +20 -0
- package/lib/index.js +157 -210
- package/lib/semantic/index.js +13 -0
- package/lib/utils/Common.js +0 -1
- package/lib/utils/css/compileClassNames.js +31 -0
- package/lib/utils/css/mergeStyle.js +52 -0
- package/lib/utils/css/utils.js +33 -0
- package/lib/utils/dropDownUtils.js +5 -2
- package/lib/utils/index.js +117 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -32,6 +32,22 @@ In this Package, we Provide Some Basic Components to Build Web App
|
|
|
32
32
|
- TextBoxIcon
|
|
33
33
|
- Tooltip
|
|
34
34
|
|
|
35
|
+
# 1.0.0-alpha-262
|
|
36
|
+
|
|
37
|
+
- **ListItem, ListItemWithAvatar, ListItemWithCheckbox, ListItemWithIcon, ListItemWithRadio** - Added New Prop `needMultiLineText`
|
|
38
|
+
|
|
39
|
+
- **MultiSelect, MultiSelectWithAvatar** - `keepSelectedOptions` prop added. When this prop is true, it won't remove selected items from the dropdown instead it highlights each selected item with tick mark.
|
|
40
|
+
|
|
41
|
+
- **MultiSelectWithAvatar** - `customProps` support.
|
|
42
|
+
|
|
43
|
+
# 1.0.0-alpha-261
|
|
44
|
+
|
|
45
|
+
- **Tab,Tabs** - Removed offsection property from css.
|
|
46
|
+
|
|
47
|
+
- compileClassNames , mergeStyle utils added.
|
|
48
|
+
|
|
49
|
+
- index export object fixed.
|
|
50
|
+
|
|
35
51
|
# 1.0.0-alpha-260
|
|
36
52
|
|
|
37
53
|
- **TextBoxIcon** - OnClear Focus in TextBox issue Resolved.
|
|
@@ -5,7 +5,7 @@ import React, { PureComponent } from 'react';
|
|
|
5
5
|
|
|
6
6
|
/** ** Components *** */
|
|
7
7
|
import { Container, Box } from '../Layout';
|
|
8
|
-
import Icon from '@zohodesk/icons
|
|
8
|
+
import { Icon } from '@zohodesk/icons';
|
|
9
9
|
import Heading from '../Heading/Heading';
|
|
10
10
|
|
|
11
11
|
/** ** CSS *** */
|
|
@@ -7,7 +7,7 @@ import datetime from '@zohodesk/datetimejs';
|
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
import DateTime from './DateTime';
|
|
9
9
|
import Popup from '../Popup/Popup';
|
|
10
|
-
import Icon from '@zohodesk/icons
|
|
10
|
+
import { Icon } from '@zohodesk/icons';
|
|
11
11
|
import { Container } from '../Layout';
|
|
12
12
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
13
13
|
|
package/es/DateTime/YearView.js
CHANGED
|
@@ -6,7 +6,7 @@ import { YearView_defaultProps } from './props/defaultProps';
|
|
|
6
6
|
/**** Components ****/
|
|
7
7
|
import { Virtualizer } from '@zohodesk/virtualizer';
|
|
8
8
|
import { Container, Box } from '../Layout';
|
|
9
|
-
import Icon from '@zohodesk/icons
|
|
9
|
+
import { Icon } from '@zohodesk/icons';
|
|
10
10
|
import Heading from '../Heading/Heading';
|
|
11
11
|
/**** CSS ****/
|
|
12
12
|
import style from './YearView.module.css';
|
package/es/DateTime/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as DateWidget } from './DateWidget
|
|
1
|
+
export { default as DateWidget } from './DateWidget';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as DropDown } from './DropDown';
|
|
2
|
+
export { DropDownTarget } from './DropDown';
|
|
3
|
+
export { DropDownItemContainer } from './DropDown';
|
|
4
|
+
export { default as DropDownHeading } from './DropDownHeading';
|
|
5
|
+
export { default as DropDownItem } from './DropDownItem';
|
|
6
|
+
export { default as DropDownSearch } from './DropDownSearch';
|
|
7
|
+
export { default as DropDownSeparator } from './DropDownSeparator';
|
package/es/Layout/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export { default as Container } from './Container';
|
|
2
2
|
export { default as Box } from './Box';
|
|
3
|
-
let Layout = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
export { Layout };
|
|
3
|
+
// let Layout = {
|
|
4
|
+
// docs: {
|
|
5
|
+
// componentGroup: 'Layout',
|
|
6
|
+
// folderName: 'Style Guide',
|
|
7
|
+
// external: true,
|
|
8
|
+
// description: ' '
|
|
9
|
+
// }
|
|
10
|
+
// };
|
|
11
|
+
// export { Layout };
|
package/es/ListItem/ListItem.js
CHANGED
|
@@ -6,7 +6,7 @@ import ListContainer from './ListContainer';
|
|
|
6
6
|
import { ListItemDefaultProps } from './props/defaultProps';
|
|
7
7
|
import { ListItem_Props } from './props/propTypes';
|
|
8
8
|
/**** Components ****/
|
|
9
|
-
import Icon from '@zohodesk/icons
|
|
9
|
+
import { Icon } from '@zohodesk/icons';
|
|
10
10
|
/**** CSS ****/
|
|
11
11
|
import style from './ListItem.module.css';
|
|
12
12
|
export default class ListItem extends React.Component {
|
|
@@ -64,7 +64,8 @@ export default class ListItem extends React.Component {
|
|
|
64
64
|
dataSelectorId,
|
|
65
65
|
a11y,
|
|
66
66
|
customClass,
|
|
67
|
-
customProps
|
|
67
|
+
customProps,
|
|
68
|
+
needMultiLineText
|
|
68
69
|
} = this.props;
|
|
69
70
|
let {
|
|
70
71
|
ListItemProps = {},
|
|
@@ -104,7 +105,7 @@ export default class ListItem extends React.Component {
|
|
|
104
105
|
}, ContainerProps), value ? /*#__PURE__*/React.createElement(Box, {
|
|
105
106
|
shrink: true,
|
|
106
107
|
adjust: true,
|
|
107
|
-
className: style.value
|
|
108
|
+
className: needMultiLineText ? style.multiLineValue : style.value
|
|
108
109
|
}, value) : null, children ? /*#__PURE__*/React.createElement(Box, {
|
|
109
110
|
shrink: true,
|
|
110
111
|
adjust: true,
|
|
@@ -74,6 +74,11 @@
|
|
|
74
74
|
.children {
|
|
75
75
|
composes: dotted from '../common/common.module.css';
|
|
76
76
|
}
|
|
77
|
+
.multiLineValue{
|
|
78
|
+
word-break: break-word;
|
|
79
|
+
line-height: var(--zd_size18);
|
|
80
|
+
composes: clamp from '../common/common.module.css'
|
|
81
|
+
}
|
|
77
82
|
.iconBox {
|
|
78
83
|
width: var(--zd_size20);
|
|
79
84
|
text-align: center;
|
|
@@ -9,7 +9,7 @@ import { ListItemWithAvatar_Props } from './props/propTypes';
|
|
|
9
9
|
/**** Components ****/
|
|
10
10
|
import Avatar from '../Avatar/Avatar';
|
|
11
11
|
import AvatarTeam from '../AvatarTeam/AvatarTeam';
|
|
12
|
-
import Icon from '@zohodesk/icons
|
|
12
|
+
import { Icon } from '@zohodesk/icons';
|
|
13
13
|
/**** CSS ****/
|
|
14
14
|
import style from './ListItem.module.css';
|
|
15
15
|
export default class ListItemWithAvatar extends React.PureComponent {
|
|
@@ -69,7 +69,8 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
69
69
|
avatarPalette,
|
|
70
70
|
a11y,
|
|
71
71
|
customClass,
|
|
72
|
-
customProps
|
|
72
|
+
customProps,
|
|
73
|
+
needMultiLineText
|
|
73
74
|
} = this.props;
|
|
74
75
|
let {
|
|
75
76
|
ListItemProps = {},
|
|
@@ -130,7 +131,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
130
131
|
flexible: true,
|
|
131
132
|
shrink: true,
|
|
132
133
|
"data-title": isDisabled ? null : title,
|
|
133
|
-
className: style.value
|
|
134
|
+
className: needMultiLineText ? style.multiLineValue : style.value
|
|
134
135
|
}, value) : null, needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
135
136
|
className: style.tickIcon,
|
|
136
137
|
"aria-hidden": ariaHidden,
|
|
@@ -55,7 +55,8 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
55
55
|
disableTitle,
|
|
56
56
|
a11y,
|
|
57
57
|
customClass,
|
|
58
|
-
customProps
|
|
58
|
+
customProps,
|
|
59
|
+
needMultiLineText
|
|
59
60
|
} = this.props;
|
|
60
61
|
let {
|
|
61
62
|
ListItemProps = {},
|
|
@@ -98,7 +99,7 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
98
99
|
flexible: true,
|
|
99
100
|
shrink: true,
|
|
100
101
|
"data-title": isDisabled ? null : title,
|
|
101
|
-
className: style.value
|
|
102
|
+
className: needMultiLineText ? style.multiLineValue : style.value
|
|
102
103
|
}, value));
|
|
103
104
|
}
|
|
104
105
|
}
|
|
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
/**** Libraries ****/
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Box } from '../Layout';
|
|
5
|
-
import Icon from '@zohodesk/icons
|
|
5
|
+
import { Icon } from '@zohodesk/icons';
|
|
6
6
|
import ListContainer from './ListContainer';
|
|
7
7
|
import { ListItemWithIconDefaultProps } from './props/defaultProps';
|
|
8
8
|
import { ListItemWithIcon_Props } from './props/propTypes';
|
|
@@ -65,7 +65,8 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
65
65
|
disableTitle,
|
|
66
66
|
a11y,
|
|
67
67
|
customClass,
|
|
68
|
-
customProps
|
|
68
|
+
customProps,
|
|
69
|
+
needMultiLineText
|
|
69
70
|
} = this.props;
|
|
70
71
|
let {
|
|
71
72
|
ListItemProps = {},
|
|
@@ -110,7 +111,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
110
111
|
}) : null, value && /*#__PURE__*/React.createElement(Box, {
|
|
111
112
|
flexible: true,
|
|
112
113
|
shrink: true,
|
|
113
|
-
className: style.value,
|
|
114
|
+
className: needMultiLineText ? style.multiLineValue : style.value,
|
|
114
115
|
"data-title": isDisabled ? null : title,
|
|
115
116
|
dataId: `${dataIdString}_Text`
|
|
116
117
|
}, value), needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
@@ -56,7 +56,8 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
56
56
|
disableTitle,
|
|
57
57
|
a11y,
|
|
58
58
|
customClass,
|
|
59
|
-
customProps
|
|
59
|
+
customProps,
|
|
60
|
+
needMultiLineText
|
|
60
61
|
} = this.props;
|
|
61
62
|
let {
|
|
62
63
|
ListItemProps = {},
|
|
@@ -100,7 +101,7 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
100
101
|
flexible: true,
|
|
101
102
|
shrink: true,
|
|
102
103
|
"data-title": disableTitle ? null : title,
|
|
103
|
-
className: style.value
|
|
104
|
+
className: needMultiLineText ? style.multiLineValue : style.value
|
|
104
105
|
}, value));
|
|
105
106
|
}
|
|
106
107
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default as ListContainer } from './ListContainer';
|
|
2
|
+
export { default as ListItem } from './ListItem';
|
|
3
|
+
export { default as ListItemWithAvatar } from './ListItemWithAvatar';
|
|
4
|
+
export { default as ListItemWithCheckBox } from './ListItemWithCheckBox';
|
|
5
|
+
export { default as ListItemWithIcon } from './ListItemWithIcon';
|
|
6
|
+
export { default as ListItemWithRadio } from './ListItemWithRadio';
|
|
@@ -11,7 +11,8 @@ export const ListContainerDefaultProps = {
|
|
|
11
11
|
a11y: {},
|
|
12
12
|
customClass: '',
|
|
13
13
|
customProps: {},
|
|
14
|
-
dataSelectorId: 'listContainer'
|
|
14
|
+
dataSelectorId: 'listContainer',
|
|
15
|
+
needMultiLineText: false
|
|
15
16
|
};
|
|
16
17
|
export const ListItemDefaultProps = {
|
|
17
18
|
active: false,
|
|
@@ -27,7 +28,8 @@ export const ListItemDefaultProps = {
|
|
|
27
28
|
a11y: {},
|
|
28
29
|
customClass: {},
|
|
29
30
|
customProps: {},
|
|
30
|
-
dataSelectorId: 'listItem'
|
|
31
|
+
dataSelectorId: 'listItem',
|
|
32
|
+
needMultiLineText: false
|
|
31
33
|
};
|
|
32
34
|
export const ListItemWithAvatarDefaultProps = {
|
|
33
35
|
active: false,
|
|
@@ -44,7 +46,8 @@ export const ListItemWithAvatarDefaultProps = {
|
|
|
44
46
|
a11y: {},
|
|
45
47
|
customClass: {},
|
|
46
48
|
customProps: {},
|
|
47
|
-
dataSelectorId: 'listItemWithAvatar'
|
|
49
|
+
dataSelectorId: 'listItemWithAvatar',
|
|
50
|
+
needMultiLineText: false
|
|
48
51
|
};
|
|
49
52
|
export const ListItemWithCheckBoxDefaultProps = {
|
|
50
53
|
active: false,
|
|
@@ -57,7 +60,8 @@ export const ListItemWithCheckBoxDefaultProps = {
|
|
|
57
60
|
a11y: {},
|
|
58
61
|
customClass: {},
|
|
59
62
|
customProps: {},
|
|
60
|
-
dataSelectorId: 'listItemWithCheckBox'
|
|
63
|
+
dataSelectorId: 'listItemWithCheckBox',
|
|
64
|
+
needMultiLineText: false
|
|
61
65
|
};
|
|
62
66
|
export const ListItemWithIconDefaultProps = {
|
|
63
67
|
active: false,
|
|
@@ -73,7 +77,8 @@ export const ListItemWithIconDefaultProps = {
|
|
|
73
77
|
a11y: {},
|
|
74
78
|
customClass: '',
|
|
75
79
|
customProps: {},
|
|
76
|
-
dataSelectorId: 'listItemWithIcon'
|
|
80
|
+
dataSelectorId: 'listItemWithIcon',
|
|
81
|
+
needMultiLineText: false
|
|
77
82
|
};
|
|
78
83
|
export const ListItemWithRadioDefaultProps = {
|
|
79
84
|
active: false,
|
|
@@ -87,5 +92,6 @@ export const ListItemWithRadioDefaultProps = {
|
|
|
87
92
|
a11y: {},
|
|
88
93
|
customClass: {},
|
|
89
94
|
customProps: {},
|
|
90
|
-
dataSelectorId: 'listItemWithRadio'
|
|
95
|
+
dataSelectorId: 'listItemWithRadio',
|
|
96
|
+
needMultiLineText: false
|
|
91
97
|
};
|
|
@@ -24,7 +24,8 @@ export const ListContainer_Props = {
|
|
|
24
24
|
ariaSelected: PropTypes.bool
|
|
25
25
|
}),
|
|
26
26
|
customClass: PropTypes.string,
|
|
27
|
-
customProps: PropTypes.object
|
|
27
|
+
customProps: PropTypes.object,
|
|
28
|
+
needMultiLineText: PropTypes.bool
|
|
28
29
|
};
|
|
29
30
|
export const ListItem_Props = {
|
|
30
31
|
active: PropTypes.bool,
|
|
@@ -53,6 +54,7 @@ export const ListItem_Props = {
|
|
|
53
54
|
role: PropTypes.string,
|
|
54
55
|
ariaSelected: PropTypes.bool
|
|
55
56
|
}),
|
|
57
|
+
needMultiLineText: PropTypes.bool,
|
|
56
58
|
customClass: PropTypes.shape({
|
|
57
59
|
customListItem: PropTypes.string,
|
|
58
60
|
customTickIcon: PropTypes.string
|
|
@@ -97,6 +99,7 @@ export const ListItemWithAvatar_Props = {
|
|
|
97
99
|
customAvatar: PropTypes.string,
|
|
98
100
|
customAvatarTeam: PropTypes.string
|
|
99
101
|
}),
|
|
102
|
+
needMultiLineText: PropTypes.bool,
|
|
100
103
|
customProps: PropTypes.shape({
|
|
101
104
|
ListItemProps: PropTypes.object
|
|
102
105
|
})
|
|
@@ -123,6 +126,7 @@ export const ListItemWithCheckBox_Props = {
|
|
|
123
126
|
role: PropTypes.string,
|
|
124
127
|
ariaSelected: PropTypes.bool
|
|
125
128
|
}),
|
|
129
|
+
needMultiLineText: PropTypes.bool,
|
|
126
130
|
customClass: PropTypes.shape({
|
|
127
131
|
customListItem: PropTypes.string,
|
|
128
132
|
customCheckBox: PropTypes.string,
|
|
@@ -156,6 +160,7 @@ export const ListItemWithIcon_Props = {
|
|
|
156
160
|
ariaSelected: PropTypes.bool,
|
|
157
161
|
ariaHidden: PropTypes.bool
|
|
158
162
|
}),
|
|
163
|
+
needMultiLineText: PropTypes.bool,
|
|
159
164
|
customClass: PropTypes.string,
|
|
160
165
|
customProps: PropTypes.shape({
|
|
161
166
|
ListItemProps: PropTypes.object
|
|
@@ -183,6 +188,7 @@ export const ListItemWithRadio_Props = {
|
|
|
183
188
|
role: PropTypes.string,
|
|
184
189
|
ariaSelected: PropTypes.bool
|
|
185
190
|
}),
|
|
191
|
+
needMultiLineText: PropTypes.bool,
|
|
186
192
|
customClass: PropTypes.shape({
|
|
187
193
|
customListItem: PropTypes.string,
|
|
188
194
|
customRadio: PropTypes.string,
|
|
@@ -17,7 +17,7 @@ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
|
17
17
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
18
18
|
|
|
19
19
|
/**** Icons ****/
|
|
20
|
-
import Icon from '@zohodesk/icons
|
|
20
|
+
import { Icon } from '@zohodesk/icons';
|
|
21
21
|
/**** CSS ****/
|
|
22
22
|
import style from './MultiSelect.module.css';
|
|
23
23
|
|
|
@@ -14,7 +14,7 @@ import Popup from '../Popup/Popup';
|
|
|
14
14
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
15
15
|
import { Container, Box } from '../Layout';
|
|
16
16
|
import Card, { CardContent, CardHeader, CardFooter } from '../Card/Card';
|
|
17
|
-
import Icon from '@zohodesk/icons
|
|
17
|
+
import { Icon } from '@zohodesk/icons';
|
|
18
18
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
19
19
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
20
20
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
@@ -18,7 +18,7 @@ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
|
18
18
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
19
19
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
20
20
|
/**** Icons ****/
|
|
21
|
-
import Icon from '@zohodesk/icons
|
|
21
|
+
import { Icon } from '@zohodesk/icons';
|
|
22
22
|
/**** CSS ****/
|
|
23
23
|
import style from './MultiSelect.module.css';
|
|
24
24
|
|
|
@@ -249,7 +249,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
249
249
|
} = this.state;
|
|
250
250
|
const {
|
|
251
251
|
selectedOptions,
|
|
252
|
-
needLocalSearch
|
|
252
|
+
needLocalSearch,
|
|
253
|
+
keepSelectedOptions
|
|
253
254
|
} = this.props;
|
|
254
255
|
const {
|
|
255
256
|
suggestions,
|
|
@@ -258,7 +259,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
258
259
|
options,
|
|
259
260
|
selectedOptions,
|
|
260
261
|
searchStr: getSearchString(searchStr),
|
|
261
|
-
needSearch: needLocalSearch
|
|
262
|
+
needSearch: needLocalSearch,
|
|
263
|
+
keepSelectedOptions
|
|
262
264
|
});
|
|
263
265
|
this.suggestionsOrder = suggestionIds;
|
|
264
266
|
return suggestions;
|
|
@@ -450,7 +452,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
450
452
|
handleSelectOption(option, value, index, e) {
|
|
451
453
|
const {
|
|
452
454
|
selectedOptions,
|
|
453
|
-
isSearchClearOnSelect
|
|
455
|
+
isSearchClearOnSelect,
|
|
456
|
+
keepSelectedOptions
|
|
454
457
|
} = this.props;
|
|
455
458
|
const {
|
|
456
459
|
searchStr
|
|
@@ -458,7 +461,15 @@ export class MultiSelectComponent extends React.Component {
|
|
|
458
461
|
if (searchStr.trim() != '' && isSearchClearOnSelect) {
|
|
459
462
|
this.handleSearch('');
|
|
460
463
|
}
|
|
461
|
-
|
|
464
|
+
if (keepSelectedOptions && selectedOptions.indexOf(option) != -1) {
|
|
465
|
+
let newSelectedOptions = selectedOptions.filter(id => {
|
|
466
|
+
return id != option;
|
|
467
|
+
});
|
|
468
|
+
this.handleChange(newSelectedOptions, e);
|
|
469
|
+
} else {
|
|
470
|
+
this.handleChange([...selectedOptions, option], e);
|
|
471
|
+
}
|
|
472
|
+
|
|
462
473
|
// e && e.stopPropagation && this.handlePopupClose(e);
|
|
463
474
|
}
|
|
464
475
|
|
|
@@ -841,7 +852,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
841
852
|
highLightedSelectOptions,
|
|
842
853
|
options,
|
|
843
854
|
isFetchingOptions,
|
|
844
|
-
isActive
|
|
855
|
+
isActive,
|
|
856
|
+
selectedOptionIds
|
|
845
857
|
} = this.state;
|
|
846
858
|
const suggestions = this.handleFilterSuggestions();
|
|
847
859
|
const setAriaId = this.getNextAriaId();
|
|
@@ -985,6 +997,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
985
997
|
needBorder: false,
|
|
986
998
|
dataId: `${dataId}_Options`,
|
|
987
999
|
palette: palette,
|
|
1000
|
+
selectedOptions: selectedOptionIds,
|
|
988
1001
|
a11y: {
|
|
989
1002
|
role: 'option'
|
|
990
1003
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
2
|
/**** Libraries ****/
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { MultiSelectWithAvatar_propTypes } from './props/propTypes';
|
|
@@ -20,7 +21,7 @@ import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
|
20
21
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
21
22
|
|
|
22
23
|
/**** Icons ****/
|
|
23
|
-
import Icon from '@zohodesk/icons
|
|
24
|
+
import { Icon } from '@zohodesk/icons';
|
|
24
25
|
/**** CSS ****/
|
|
25
26
|
import style from './MultiSelect.module.css';
|
|
26
27
|
|
|
@@ -99,8 +100,14 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
99
100
|
customChildrenClass,
|
|
100
101
|
isBoxPaddingNeed,
|
|
101
102
|
needEffect,
|
|
102
|
-
isLoading
|
|
103
|
+
isLoading,
|
|
104
|
+
keepSelectedOptions,
|
|
105
|
+
customProps
|
|
103
106
|
} = this.props;
|
|
107
|
+
let {
|
|
108
|
+
TextBoxProps = {},
|
|
109
|
+
SuggestionsProps = {}
|
|
110
|
+
} = customProps;
|
|
104
111
|
const {
|
|
105
112
|
clearText = 'Clear all'
|
|
106
113
|
} = i18nKeys;
|
|
@@ -119,7 +126,8 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
119
126
|
highLightedSelectOptions,
|
|
120
127
|
options,
|
|
121
128
|
isFetchingOptions,
|
|
122
|
-
isActive
|
|
129
|
+
isActive,
|
|
130
|
+
selectedOptionIds
|
|
123
131
|
} = this.state;
|
|
124
132
|
const suggestions = this.handleFilterSuggestions();
|
|
125
133
|
const setAriaId = this.getNextAriaId();
|
|
@@ -183,7 +191,10 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
183
191
|
customClass: {
|
|
184
192
|
customTBoxWrap: style.custmInputWrapper
|
|
185
193
|
},
|
|
186
|
-
autoComplete: false
|
|
194
|
+
autoComplete: false,
|
|
195
|
+
customProps: {
|
|
196
|
+
TextBoxProps: TextBoxProps
|
|
197
|
+
}
|
|
187
198
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
188
199
|
isCover: false,
|
|
189
200
|
alignBox: "row",
|
|
@@ -245,7 +256,8 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
245
256
|
shrink: true,
|
|
246
257
|
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
247
258
|
eleRef: this.suggestionContainerRef
|
|
248
|
-
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
259
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
|
|
260
|
+
needTick: keepSelectedOptions,
|
|
249
261
|
suggestions: suggestions,
|
|
250
262
|
getRef: this.suggestionItemRef,
|
|
251
263
|
hoverOption: hoverOption,
|
|
@@ -254,10 +266,11 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
254
266
|
needBorder: false,
|
|
255
267
|
dataId: `${dataId}_Options`,
|
|
256
268
|
palette: palette,
|
|
269
|
+
selectedOptions: selectedOptionIds,
|
|
257
270
|
a11y: {
|
|
258
271
|
role: 'option'
|
|
259
272
|
}
|
|
260
|
-
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
273
|
+
}, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
261
274
|
isLoading: isFetchingOptions,
|
|
262
275
|
options: options,
|
|
263
276
|
searchString: searchStr,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as MultiSelect } from './MultiSelect';
|
|
2
|
+
export { default as MultiSelectWithAvatar } from './MultiSelectWithAvatar';
|
|
3
|
+
export { default as AdvancedMultiSelect } from './AdvancedMultiSelect';
|
|
4
|
+
export { default as AdvancedGroupMultiSelect } from './AdvancedGroupMultiSelect';
|
|
@@ -106,7 +106,8 @@ export const MultiSelect_defaultProps = {
|
|
|
106
106
|
needEffect: true,
|
|
107
107
|
boxSize: 'default',
|
|
108
108
|
isLoading: false,
|
|
109
|
-
dataSelectorId: 'multiSelect'
|
|
109
|
+
dataSelectorId: 'multiSelect',
|
|
110
|
+
keepSelectedOptions: false
|
|
110
111
|
};
|
|
111
112
|
export const MultiSelectHeader_defaultProps = {
|
|
112
113
|
dataId: 'MultiSelectHeader'
|
|
@@ -138,7 +139,9 @@ export const MultiSelectWithAvatar_defaultProps = {
|
|
|
138
139
|
isSearchClearOnSelect: true,
|
|
139
140
|
needEffect: true,
|
|
140
141
|
isLoading: false,
|
|
141
|
-
dataSelectorId: 'multiSelectWithAvatar'
|
|
142
|
+
dataSelectorId: 'multiSelectWithAvatar',
|
|
143
|
+
keepSelectedOptions: false,
|
|
144
|
+
customProps: {}
|
|
142
145
|
};
|
|
143
146
|
export const SelectedOptions_defaultProps = {
|
|
144
147
|
size: 'medium'
|
|
@@ -239,7 +239,8 @@ export const MultiSelect_propTypes = {
|
|
|
239
239
|
needEffect: PropTypes.bool,
|
|
240
240
|
boxSize: PropTypes.string,
|
|
241
241
|
isLoading: PropTypes.bool,
|
|
242
|
-
dataSelectorId: PropTypes.string
|
|
242
|
+
dataSelectorId: PropTypes.string,
|
|
243
|
+
keepSelectedOptions: PropTypes.bool
|
|
243
244
|
};
|
|
244
245
|
export const MultiSelectHeader_propTypes = {
|
|
245
246
|
dataId: PropTypes.string,
|
|
@@ -294,6 +295,11 @@ export const MultiSelectWithAvatar_propTypes = {
|
|
|
294
295
|
htmlId: PropTypes.string,
|
|
295
296
|
isBoxPaddingNeed: PropTypes.bool,
|
|
296
297
|
needEffect: PropTypes.bool,
|
|
298
|
+
keepSelectedOptions: PropTypes.bool,
|
|
299
|
+
customProps: PropTypes.shape({
|
|
300
|
+
SuggestionsProps: PropTypes.object,
|
|
301
|
+
DropBoxProps: PropTypes.object
|
|
302
|
+
}),
|
|
297
303
|
/**** Popup props ****/
|
|
298
304
|
isPopupOpen: PropTypes.bool,
|
|
299
305
|
isPopupReady: PropTypes.bool,
|
|
@@ -51,10 +51,11 @@ export function getUniqueId(Component, prefix) {
|
|
|
51
51
|
callback
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
54
|
+
|
|
55
|
+
// let Provider = {
|
|
56
|
+
// docs: {
|
|
57
|
+
// componentGroup: 'Provider',
|
|
58
|
+
// folderName: 'Functions'
|
|
59
|
+
// }
|
|
60
|
+
// };
|
|
61
|
+
// export { Provider };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getLibraryConfig, setLibraryConfig } from './Config';
|
|
2
|
+
export { default as LibraryContextProvider } from './LibraryContext';
|
|
3
|
+
export { removeGlobalZIndexPrefix, setInitialZIndex, useZIndex, getZIndex } from './ZindexProvider';
|
|
4
|
+
export { setGlobalIdPrefix, removeGlobalIdPrefix, useUniqueId, getUniqueId } from './IdProvider';
|
package/es/Responsive/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
export { ResponsiveSender as CustomResponsiveSender, ResponsiveReceiver as CustomResponsiveReceiver, useResponsiveReceiver as useCustomResponsiveReceiver } from './CustomResponsive';
|
|
2
|
+
export { ResponsiveSender, ResponsiveReceiver, useResponsiveReceiver } from './Responsive';
|
|
3
|
+
export { default as ResizeComponent } from './ResizeComponent';
|
|
4
|
+
|
|
5
|
+
// let Responsive = {
|
|
6
|
+
// docs: {
|
|
7
|
+
// componentGroup: 'Layout',
|
|
8
|
+
// folderName: 'Style Guide'
|
|
9
|
+
// }
|
|
10
|
+
// };
|
|
11
|
+
// export { Responsive };
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -10,7 +10,7 @@ import Textbox from '../TextBox/TextBox';
|
|
|
10
10
|
import Card, { CardHeader, CardContent, CardFooter } from '../Card/Card';
|
|
11
11
|
import Suggestions from '../MultiSelect/Suggestions';
|
|
12
12
|
import EmptyState from '../MultiSelect/EmptyState';
|
|
13
|
-
import Icon from '@zohodesk/icons
|
|
13
|
+
import { Icon } from '@zohodesk/icons';
|
|
14
14
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
15
15
|
import DropDownHeading from '../DropDown/DropDownHeading';
|
|
16
16
|
import { Container, Box } from '../Layout';
|
package/es/Select/Select.js
CHANGED
|
@@ -12,7 +12,7 @@ import Card, { CardHeader, CardContent, CardFooter } from '../Card/Card';
|
|
|
12
12
|
import Suggestions from '../MultiSelect/Suggestions';
|
|
13
13
|
import EmptyState from '../MultiSelect/EmptyState';
|
|
14
14
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
15
|
-
import Icon from '@zohodesk/icons
|
|
15
|
+
import { Icon } from '@zohodesk/icons';
|
|
16
16
|
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
17
17
|
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
18
18
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
@@ -4,7 +4,7 @@ import { SelectWithIcon_propTypes } from './props/propTypes';
|
|
|
4
4
|
/**** Components ****/
|
|
5
5
|
import Popup from '../Popup/Popup';
|
|
6
6
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
7
|
-
import Icon from '@zohodesk/icons
|
|
7
|
+
import { Icon } from '@zohodesk/icons';
|
|
8
8
|
import ListItemWithIcon from '../ListItem/ListItemWithIcon';
|
|
9
9
|
import Card, { CardHeader, CardContent } from '../Card/Card';
|
|
10
10
|
import EmptyState from '../MultiSelect/EmptyState';
|