@zohodesk/dot 1.3.0 → 1.3.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/.cli/PropLessFiles.html +1 -1
- package/.cli/PropValidationExcludeFilesArray.js +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +21 -12
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +163 -553
- package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +3 -12
- package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +3 -12
- package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +3 -12
- package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +3 -12
- package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +3 -12
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +163 -553
- package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +3 -12
- package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +3 -12
- package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +3 -12
- package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +3 -12
- package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +3 -12
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +163 -553
- package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +3 -12
- package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +3 -12
- package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +3 -12
- package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +3 -12
- package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +3 -12
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/IconButton/IconButton.js.html +466 -0
- package/coverage/IconButton/IconButton.module.css.html +151 -0
- package/coverage/IconButton/index.html +131 -0
- package/coverage/IconButton/props/defaultProps.js.html +136 -0
- package/coverage/IconButton/props/index.html +131 -0
- package/coverage/IconButton/props/propTypes.js.html +187 -0
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +4 -0
- package/coverage/coverage-summary.json +5 -1
- package/coverage/index.html +40 -10
- package/es/IconButton/__tests__/IconButton.spec.js +148 -0
- package/es/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
- package/es/form/fields/FieldContainer/props/propTypes.js +1 -1
- package/es/v1/ActionButton/ActionButton.js +2 -2
- package/es/v1/AlphabeticList/AlphabeticList.js +6 -2
- package/es/v1/Attachment/Attachment.js +78 -75
- package/es/v1/AttachmentViewer/AttachmentImage.js +44 -63
- package/es/v1/Image/Image.js +26 -33
- package/es/v1/Loader/Loader.js +12 -18
- package/es/v1/Message/Message.js +16 -42
- package/es/v1/PlusIcon/PlusIcon.js +25 -37
- package/es/v1/Separator/Separator.js +40 -47
- package/es/v1/Upload/Upload.js +59 -66
- package/es/v1/alert/AlertHeader/AlertHeader.js +5 -4
- package/es/v1/alert/AlertHeader/props/defaultProps.js +12 -0
- package/es/v1/alert/AlertHeader/props/propTypes.js +20 -0
- package/es/v1/alert/AlertLookup/AlertLookup.js +6 -4
- package/es/v1/alert/AlertLookup/props/defaultProps.js +13 -0
- package/es/v1/alert/AlertLookup/props/propTypes.js +36 -0
- package/es/v1/avatar/AvatarClose/AvatarClose.js +32 -43
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +41 -52
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +38 -43
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +52 -63
- package/es/v1/avatar/AvatarThread/AvatarThread.js +62 -69
- package/es/v1/avatar/AvatarUser/AvatarUser.js +93 -100
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +81 -88
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
- package/es/v1/form/fields/DateField/DateField.js +6 -6
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
- package/es/v1/form/fields/PhoneField/PhoneField.js +6 -6
- package/es/v1/form/fields/RadioField/RadioField.js +89 -97
- package/es/v1/form/fields/SelectField/SelectField.js +139 -154
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +154 -197
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +108 -124
- package/es/v1/list/SecondaryText/AccountName.js +61 -69
- package/es/v1/list/SecondaryText/ContactName.js +66 -74
- package/es/v1/list/SecondaryText/DepartmentText.js +15 -27
- package/es/v1/list/SecondaryText/Email.js +32 -40
- package/es/v1/list/SecondaryText/HappinessRating.js +17 -25
- package/es/v1/list/SecondaryText/PhoneNumber.js +36 -44
- package/es/v1/list/SecondaryText/PriorityText.js +16 -28
- package/es/v1/list/SecondaryText/SecondaryText.js +21 -33
- package/es/v1/list/SecondaryText/StatusText.js +17 -29
- package/es/v1/list/SecondaryText/TicketId.js +33 -45
- package/es/v1/list/SecondaryText/Website.js +22 -30
- package/es/v1/list/SecondryPanel/SecondryPanel.js +66 -83
- package/es/v1/list/SentimentStatus/SentimentStatus.js +18 -29
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
- package/es/v1/list/status/StatusListItem/StatusListItem.js +75 -100
- package/es/v1/lookup/EmptyPage/EmptyPage.js +15 -26
- package/es/v1/lookup/Section/Section.js +14 -20
- package/es/v1/svg/PlusIcon.js +20 -27
- package/es/v1/svg/SnippetIcon.js +22 -29
- package/es/v1/svg/TemplateIcon.js +23 -30
- package/lib/IconButton/__tests__/IconButton.spec.js +156 -0
- package/lib/IconButton/__tests__/__snapshots__/IconButton.spec.js.snap +316 -0
- package/lib/form/fields/FieldContainer/props/propTypes.js +1 -1
- package/lib/v1/ActionButton/ActionButton.js +2 -2
- package/lib/v1/AlphabeticList/AlphabeticList.js +7 -3
- package/lib/v1/Attachment/Attachment.js +77 -112
- package/lib/v1/AttachmentViewer/AttachmentImage.js +61 -96
- package/lib/v1/Image/Image.js +26 -71
- package/lib/v1/Loader/Loader.js +12 -55
- package/lib/v1/Message/Message.js +23 -80
- package/lib/v1/PlusIcon/PlusIcon.js +25 -71
- package/lib/v1/Separator/Separator.js +44 -85
- package/lib/v1/Upload/Upload.js +58 -103
- package/lib/v1/alert/AlertHeader/AlertHeader.js +5 -4
- package/lib/v1/alert/AlertHeader/props/defaultProps.js +19 -0
- package/lib/v1/alert/AlertHeader/props/propTypes.js +31 -0
- package/lib/v1/alert/AlertLookup/AlertLookup.js +6 -4
- package/lib/v1/alert/AlertLookup/props/defaultProps.js +20 -0
- package/lib/v1/alert/AlertLookup/props/propTypes.js +47 -0
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +32 -77
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +41 -86
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +37 -80
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +52 -97
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +61 -106
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +95 -140
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +85 -130
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +6 -6
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +6 -6
- package/lib/v1/form/fields/DateField/DateField.js +6 -6
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +6 -6
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +6 -6
- package/lib/v1/form/fields/PhoneField/PhoneField.js +6 -6
- package/lib/v1/form/fields/RadioField/RadioField.js +91 -137
- package/lib/v1/form/fields/SelectField/SelectField.js +149 -200
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +160 -253
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +107 -206
- package/lib/v1/list/SecondaryText/AccountName.js +63 -113
- package/lib/v1/list/SecondaryText/ContactName.js +67 -117
- package/lib/v1/list/SecondaryText/DepartmentText.js +16 -66
- package/lib/v1/list/SecondaryText/Email.js +32 -82
- package/lib/v1/list/SecondaryText/HappinessRating.js +21 -68
- package/lib/v1/list/SecondaryText/PhoneNumber.js +36 -86
- package/lib/v1/list/SecondaryText/PriorityText.js +16 -66
- package/lib/v1/list/SecondaryText/SecondaryText.js +19 -69
- package/lib/v1/list/SecondaryText/StatusText.js +17 -67
- package/lib/v1/list/SecondaryText/TicketId.js +33 -83
- package/lib/v1/list/SecondaryText/Website.js +29 -72
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +69 -168
- package/lib/v1/list/SentimentStatus/SentimentStatus.js +19 -64
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -2
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +81 -137
- package/lib/v1/lookup/EmptyPage/EmptyPage.js +43 -93
- package/lib/v1/lookup/Section/Section.js +14 -58
- package/lib/v1/svg/PlusIcon.js +20 -65
- package/lib/v1/svg/SnippetIcon.js +22 -67
- package/lib/v1/svg/TemplateIcon.js +23 -68
- package/package.json +12 -12
- package/result.json +1 -1
- package/unittest/index.html +1 -1
package/es/v1/Image/Image.js
CHANGED
|
@@ -2,38 +2,31 @@ import React from 'react';
|
|
|
2
2
|
import { defaultProps } from '../../Image/props/defaultProps';
|
|
3
3
|
import { propTypes } from '../../Image/props/propTypes';
|
|
4
4
|
import style from '../../Image/Image.module.css';
|
|
5
|
-
export default
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
|
|
5
|
+
export default function Image(props) {
|
|
6
|
+
let {
|
|
7
|
+
alt,
|
|
8
|
+
src,
|
|
9
|
+
className,
|
|
10
|
+
isCover,
|
|
11
|
+
title,
|
|
12
|
+
onClick,
|
|
13
|
+
dataId,
|
|
14
|
+
htmlId,
|
|
15
|
+
eleRef,
|
|
16
|
+
original
|
|
17
|
+
} = props;
|
|
18
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
19
|
+
src: src,
|
|
20
|
+
alt: alt,
|
|
21
|
+
"data-title": title,
|
|
22
|
+
"data-id": dataId,
|
|
23
|
+
"data-test-id": dataId,
|
|
24
|
+
className: ` ${className} ${isCover ? style.imgFullSize : style.imgMaxFullSize} `,
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
id: htmlId,
|
|
27
|
+
ref: eleRef,
|
|
28
|
+
"data-original": original
|
|
29
|
+
});
|
|
33
30
|
}
|
|
34
31
|
Image.propTypes = propTypes;
|
|
35
|
-
Image.defaultProps = defaultProps;
|
|
36
|
-
// Image.docs = {
|
|
37
|
-
// componentGroup: 'Atom'
|
|
38
|
-
// };
|
|
39
|
-
// }
|
|
32
|
+
Image.defaultProps = defaultProps;
|
package/es/v1/Loader/Loader.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useZIndex } from '@zohodesk/components/es/v1/Provider/ZindexProvider';
|
|
3
3
|
import style from '../../Loader/Loader.module.css';
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: style.loader
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
|
|
4
|
+
export default function Loader() {
|
|
5
|
+
let getNextId = useZIndex();
|
|
6
|
+
let Zindex = getNextId();
|
|
7
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
8
|
+
className: style.ajaxLoader,
|
|
9
|
+
style: {
|
|
10
|
+
zIndex: `${Zindex}`
|
|
11
|
+
}
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
13
|
+
className: style.loader
|
|
14
|
+
}));
|
|
21
15
|
}
|
package/es/v1/Message/Message.js
CHANGED
|
@@ -1,59 +1,33 @@
|
|
|
1
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); }
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
4
|
import { defaultProps } from '../../Message/props/defaultProps';
|
|
5
5
|
import { propTypes, MessageUI_propTypes, MessageNew_propTypes } from '../../Message/props/propTypes';
|
|
6
6
|
import { Icon } from '@zohodesk/icons';
|
|
7
7
|
import AutoClose from '../actions/AutoClose';
|
|
8
8
|
import style from '../../Message/Message.module.css';
|
|
9
|
-
export default
|
|
10
|
-
constructor(props) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = this.props;
|
|
22
|
-
|
|
23
|
-
if (showMessage !== nextProps.showMessage) {
|
|
24
|
-
if (nextProps.type != 'alert') {
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
hideMessage();
|
|
27
|
-
}, 3000);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
componentDidMount() {
|
|
33
|
-
let {
|
|
34
|
-
type,
|
|
35
|
-
hideMessage
|
|
36
|
-
} = this.props;
|
|
37
|
-
|
|
9
|
+
export default function Message(props) {
|
|
10
|
+
// constructor(props) {
|
|
11
|
+
// super(props);
|
|
12
|
+
// this.state = { hideMessage: false };
|
|
13
|
+
// }
|
|
14
|
+
// const [hideMessage,setHideMessage] = useState(false)
|
|
15
|
+
let {
|
|
16
|
+
showMessage,
|
|
17
|
+
hideMessage,
|
|
18
|
+
type
|
|
19
|
+
} = props;
|
|
20
|
+
useEffect(() => {
|
|
38
21
|
if (type != 'alert') {
|
|
39
22
|
setTimeout(() => {
|
|
40
23
|
hideMessage();
|
|
41
24
|
}, 3000);
|
|
42
25
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
render() {
|
|
46
|
-
return /*#__PURE__*/React.createElement(MessageUI, this.props);
|
|
47
|
-
}
|
|
48
|
-
|
|
26
|
+
}, [showMessage]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(MessageUI, props);
|
|
49
28
|
}
|
|
50
29
|
Message.propTypes = propTypes;
|
|
51
|
-
Message.defaultProps = defaultProps;
|
|
52
|
-
// Message.docs = {
|
|
53
|
-
// componentGroup: 'Atom'
|
|
54
|
-
// };
|
|
55
|
-
// }
|
|
56
|
-
|
|
30
|
+
Message.defaultProps = defaultProps;
|
|
57
31
|
export function MessageUI(props) {
|
|
58
32
|
function onClose(e) {
|
|
59
33
|
let {
|
|
@@ -3,42 +3,30 @@ import { defaultProps } from '../../PlusIcon/props/defaultProps';
|
|
|
3
3
|
import { propTypes } from '../../PlusIcon/props/propTypes';
|
|
4
4
|
import style from '../../PlusIcon/PlusIcon.module.css';
|
|
5
5
|
import AvatarIcon from '../avatar/AvatarIcon/AvatarIcon';
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
iconClass: `${iconClass} ${style.icon}`,
|
|
31
|
-
iconSize: iconSize,
|
|
32
|
-
size: size,
|
|
33
|
-
className: `${customClass} ${style.plusIcon}`
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
|
|
6
|
+
export default function PlusIcon(props) {
|
|
7
|
+
let {
|
|
8
|
+
dataId,
|
|
9
|
+
iconName,
|
|
10
|
+
iconClass,
|
|
11
|
+
iconSize,
|
|
12
|
+
size,
|
|
13
|
+
onClick,
|
|
14
|
+
title,
|
|
15
|
+
customClass
|
|
16
|
+
} = props;
|
|
17
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
18
|
+
className: style.container,
|
|
19
|
+
onClick: onClick,
|
|
20
|
+
"data-id": dataId,
|
|
21
|
+
"data-test-id": dataId,
|
|
22
|
+
"data-title": title
|
|
23
|
+
}, /*#__PURE__*/React.createElement(AvatarIcon, {
|
|
24
|
+
name: iconName,
|
|
25
|
+
iconClass: `${iconClass} ${style.icon}`,
|
|
26
|
+
iconSize: iconSize,
|
|
27
|
+
size: size,
|
|
28
|
+
className: `${customClass} ${style.plusIcon}`
|
|
29
|
+
}));
|
|
37
30
|
}
|
|
38
31
|
PlusIcon.defaultProps = defaultProps;
|
|
39
|
-
PlusIcon.propTypes = propTypes;
|
|
40
|
-
// PlusIcon.docs = {
|
|
41
|
-
// componentGroup: 'Common',
|
|
42
|
-
// folderName: 'Ticket DetailView'
|
|
43
|
-
// };
|
|
44
|
-
// }
|
|
32
|
+
PlusIcon.propTypes = propTypes;
|
|
@@ -3,58 +3,51 @@ import { Container, Box } from '@zohodesk/components/es/v1/Layout';
|
|
|
3
3
|
import { defaultProps } from '../../Separator/props/defaultProps';
|
|
4
4
|
import { propTypes } from '../../Separator/props/propTypes';
|
|
5
5
|
import style from '../../Separator/Separator.module.css';
|
|
6
|
-
export default
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
className: `${style.varClass} ${customWrapper}`
|
|
34
|
-
}, data.map((child, i) => {
|
|
35
|
-
if (child) {
|
|
36
|
-
if (data.length - 1 == i || aligndirection == 'column') {
|
|
37
|
-
return child && /*#__PURE__*/React.createElement(Box, {
|
|
38
|
-
shrink: shrink,
|
|
39
|
-
key: i,
|
|
40
|
-
className: customChildren
|
|
41
|
-
}, child);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return child && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
45
|
-
key: i
|
|
46
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
6
|
+
export default function Separator(props) {
|
|
7
|
+
const {
|
|
8
|
+
children,
|
|
9
|
+
type,
|
|
10
|
+
customSeparatorType,
|
|
11
|
+
palette,
|
|
12
|
+
wrap,
|
|
13
|
+
shrink,
|
|
14
|
+
aligndirection,
|
|
15
|
+
customClass
|
|
16
|
+
} = props;
|
|
17
|
+
const {
|
|
18
|
+
customWrapper,
|
|
19
|
+
customSeparator,
|
|
20
|
+
customChildren
|
|
21
|
+
} = customClass;
|
|
22
|
+
const data = children.filter(el => el !== null && el !== undefined && el !== false);
|
|
23
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
24
|
+
alignBox: aligndirection,
|
|
25
|
+
align: aligndirection === 'row' ? 'vertical' : '',
|
|
26
|
+
wrap: wrap,
|
|
27
|
+
isCover: false,
|
|
28
|
+
className: `${style.varClass} ${customWrapper}`
|
|
29
|
+
}, data.map((child, i) => {
|
|
30
|
+
if (child) {
|
|
31
|
+
if (data.length - 1 == i || aligndirection == 'column') {
|
|
32
|
+
return child && /*#__PURE__*/React.createElement(Box, {
|
|
47
33
|
shrink: shrink,
|
|
48
34
|
key: i,
|
|
49
35
|
className: customChildren
|
|
50
|
-
}, child)
|
|
51
|
-
className: `${style.separator} ${style[palette]} ${customSeparatorType ? '' : style[type]} ${customSeparator} `,
|
|
52
|
-
key: i
|
|
53
|
-
}, customSeparatorType ? customSeparatorType : type == 'slash' ? '/' : type == 'arrow' ? '>' : type == 'comma' ? ',' : '\u2022'));
|
|
36
|
+
}, child);
|
|
54
37
|
}
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
38
|
|
|
39
|
+
return child && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
40
|
+
key: i
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
42
|
+
shrink: shrink,
|
|
43
|
+
key: i,
|
|
44
|
+
className: customChildren
|
|
45
|
+
}, child), /*#__PURE__*/React.createElement(Box, {
|
|
46
|
+
className: `${style.separator} ${style[palette]} ${customSeparatorType ? '' : style[type]} ${customSeparator} `,
|
|
47
|
+
key: i
|
|
48
|
+
}, customSeparatorType ? customSeparatorType : type == 'slash' ? '/' : type == 'arrow' ? '>' : type == 'comma' ? ',' : '\u2022'));
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
58
51
|
}
|
|
59
52
|
Separator.defaultProps = defaultProps;
|
|
60
53
|
Separator.propTypes = propTypes;
|
package/es/v1/Upload/Upload.js
CHANGED
|
@@ -5,72 +5,65 @@ import { Icon } from '@zohodesk/icons';
|
|
|
5
5
|
import { Container, Box } from '@zohodesk/components/es/v1/Layout';
|
|
6
6
|
import Image from '../Image/Image';
|
|
7
7
|
import style from '../../Upload/Upload.module.css';
|
|
8
|
-
export default
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className: `${style.container} ${style[palette]} ${style[size]} ${isPreview ? style.preview : ''}
|
|
8
|
+
export default function Upload(props) {
|
|
9
|
+
let {
|
|
10
|
+
isPreview,
|
|
11
|
+
tooltip,
|
|
12
|
+
dataId,
|
|
13
|
+
dataSelectorId,
|
|
14
|
+
progressValue,
|
|
15
|
+
onClick,
|
|
16
|
+
iconName,
|
|
17
|
+
fileSize,
|
|
18
|
+
imgSrc,
|
|
19
|
+
isPreviewType,
|
|
20
|
+
onRemove,
|
|
21
|
+
size,
|
|
22
|
+
getRef,
|
|
23
|
+
palette
|
|
24
|
+
} = props;
|
|
25
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
26
|
+
isInline: true,
|
|
27
|
+
className: `${style.container} ${style[palette]} ${style[size]} ${isPreview ? style.preview : ''}
|
|
29
28
|
`,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
|
|
29
|
+
dataId: dataId,
|
|
30
|
+
"data-title": tooltip,
|
|
31
|
+
isCover: false,
|
|
32
|
+
eleRef: getRef,
|
|
33
|
+
dataSelectorId: dataSelectorId
|
|
34
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, isPreview ? /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
"data-id": `${dataId}_attachLoading`,
|
|
36
|
+
"data-test-id": `${dataId}_attachLoading`,
|
|
37
|
+
className: style.loader,
|
|
38
|
+
style: {
|
|
39
|
+
width: `${progressValue}%`
|
|
40
|
+
}
|
|
41
|
+
}) : null, isPreviewType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Image, {
|
|
42
|
+
src: imgSrc,
|
|
43
|
+
className: `${style.uploadimage} `,
|
|
44
|
+
alt: "Uploaded Image",
|
|
45
|
+
dataId: `${dataId}_fileName`
|
|
46
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: style.overlay,
|
|
48
|
+
onClick: onClick
|
|
49
|
+
})) : /*#__PURE__*/React.createElement(Box, {
|
|
50
|
+
className: style.attachInfo,
|
|
51
|
+
onClick: onClick,
|
|
52
|
+
dataId: `${dataId}_openNewTab`
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
54
|
+
name: iconName,
|
|
55
|
+
iconClass: style.fileIcon
|
|
56
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
className: style.attachsize
|
|
58
|
+
}, fileSize))), typeof onRemove !== 'undefined' && onRemove != null ? /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
className: style.uploadclose,
|
|
60
|
+
onClick: onRemove,
|
|
61
|
+
"data-id": `${dataId}_deleteUpload`,
|
|
62
|
+
"data-test-id": `${dataId}_deleteUpload`
|
|
63
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
64
|
+
name: "ZD-close",
|
|
65
|
+
isBold: true
|
|
66
|
+
})) : null);
|
|
70
67
|
}
|
|
71
68
|
Upload.propTypes = propTypes;
|
|
72
|
-
Upload.defaultProps = defaultProps;
|
|
73
|
-
// Upload.docs = {
|
|
74
|
-
// componentGroup: 'Upload'
|
|
75
|
-
// };
|
|
76
|
-
// }
|
|
69
|
+
Upload.defaultProps = defaultProps;
|
|
@@ -10,8 +10,8 @@ import { mergeStyle } from '@zohodesk/utils'; //customHooks
|
|
|
10
10
|
|
|
11
11
|
import useDragger from '../../../Hooks/Dragger/useDragger'; //Props
|
|
12
12
|
|
|
13
|
-
import defaultProps from '
|
|
14
|
-
import propTypes from '
|
|
13
|
+
import defaultProps from './props/defaultProps';
|
|
14
|
+
import propTypes from './props/propTypes';
|
|
15
15
|
export default function AlertHeader(props) {
|
|
16
16
|
const {
|
|
17
17
|
title,
|
|
@@ -24,7 +24,8 @@ export default function AlertHeader(props) {
|
|
|
24
24
|
type,
|
|
25
25
|
htmlId,
|
|
26
26
|
customStyle,
|
|
27
|
-
dragBoundaryLimit
|
|
27
|
+
dragBoundaryLimit,
|
|
28
|
+
renderAlertIcon
|
|
28
29
|
} = props;
|
|
29
30
|
const finalStyle = mergeStyle(style, customStyle);
|
|
30
31
|
const {
|
|
@@ -51,7 +52,7 @@ export default function AlertHeader(props) {
|
|
|
51
52
|
eleRef: dragRef
|
|
52
53
|
}, needIcon && /*#__PURE__*/React.createElement("div", {
|
|
53
54
|
className: finalStyle.iconContainer
|
|
54
|
-
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
55
|
+
}, renderAlertIcon ? renderAlertIcon() : /*#__PURE__*/React.createElement(AlertIcons, {
|
|
55
56
|
type: type
|
|
56
57
|
})), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
57
58
|
flexible: true
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export default {
|
|
3
|
+
breakChildren: PropTypes.bool,
|
|
4
|
+
children: PropTypes.node,
|
|
5
|
+
closeTitle: PropTypes.string,
|
|
6
|
+
dataId: PropTypes.string,
|
|
7
|
+
needIcon: PropTypes.bool,
|
|
8
|
+
onClose: PropTypes.func,
|
|
9
|
+
title: PropTypes.string,
|
|
10
|
+
type: PropTypes.oneOf(['success', 'error', 'danger', 'warning', 'info', 'notification']),
|
|
11
|
+
htmlId: PropTypes.string,
|
|
12
|
+
customStyle: PropTypes.object,
|
|
13
|
+
dragBoundaryLimit: PropTypes.shape({
|
|
14
|
+
top: PropTypes.number,
|
|
15
|
+
left: PropTypes.number,
|
|
16
|
+
right: PropTypes.number,
|
|
17
|
+
bottom: PropTypes.number
|
|
18
|
+
}),
|
|
19
|
+
renderAlertIcon: PropTypes.func
|
|
20
|
+
};
|
|
@@ -2,8 +2,8 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
/**** Libraries ****/
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { defaultProps } from '
|
|
6
|
-
import { propTypes } from '
|
|
5
|
+
import { defaultProps } from './props/defaultProps';
|
|
6
|
+
import { propTypes } from './props/propTypes';
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
9
|
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
@@ -65,7 +65,8 @@ export default function AlertLookup(props) {
|
|
|
65
65
|
isHtmlContent,
|
|
66
66
|
scroll,
|
|
67
67
|
isDefaultFocus,
|
|
68
|
-
onEsc
|
|
68
|
+
onEsc,
|
|
69
|
+
renderAlertIcon
|
|
69
70
|
} = props;
|
|
70
71
|
const {
|
|
71
72
|
LookupProps = {},
|
|
@@ -115,7 +116,8 @@ export default function AlertLookup(props) {
|
|
|
115
116
|
type: type,
|
|
116
117
|
needIcon: needIcon,
|
|
117
118
|
onClose: onClose,
|
|
118
|
-
breakChildren: wrapHeader
|
|
119
|
+
breakChildren: wrapHeader,
|
|
120
|
+
renderAlertIcon: renderAlertIcon
|
|
119
121
|
}, AlertHeaderProps), headerChildren ? headerChildren() : null)), /*#__PURE__*/React.createElement(Box, {
|
|
120
122
|
flexible: true
|
|
121
123
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const defaultProps = {
|
|
2
|
+
isActive: false,
|
|
3
|
+
size: 'small',
|
|
4
|
+
wrapHeader: false,
|
|
5
|
+
dataId: 'alertPopup',
|
|
6
|
+
isDefaultFocus: true,
|
|
7
|
+
customProps: {},
|
|
8
|
+
align: 'top',
|
|
9
|
+
childAnimationName: 'flyDown',
|
|
10
|
+
isHtmlContent: false,
|
|
11
|
+
scroll: '',
|
|
12
|
+
onEsc: 'cancel'
|
|
13
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export const propTypes = {
|
|
3
|
+
cancelText: PropTypes.string,
|
|
4
|
+
children: PropTypes.node,
|
|
5
|
+
confirmationMessage: PropTypes.string,
|
|
6
|
+
customClass: PropTypes.object,
|
|
7
|
+
dataId: PropTypes.string,
|
|
8
|
+
forwardRef: PropTypes.object,
|
|
9
|
+
headerChildren: PropTypes.func,
|
|
10
|
+
isActive: PropTypes.bool,
|
|
11
|
+
isDefaultFocus: PropTypes.bool,
|
|
12
|
+
message: PropTypes.node,
|
|
13
|
+
needIcon: PropTypes.bool,
|
|
14
|
+
onCancelClick: PropTypes.func,
|
|
15
|
+
onClose: PropTypes.func,
|
|
16
|
+
onLookupClick: PropTypes.func,
|
|
17
|
+
onSubmitClick: PropTypes.func,
|
|
18
|
+
size: PropTypes.oneOf(['small', 'xmedium', 'medium']),
|
|
19
|
+
submitText: PropTypes.string,
|
|
20
|
+
title: PropTypes.string,
|
|
21
|
+
type: PropTypes.oneOf(['success', 'error', 'danger', 'warning', 'info', 'notification']),
|
|
22
|
+
wrapHeader: PropTypes.bool,
|
|
23
|
+
a11y: PropTypes.object,
|
|
24
|
+
customProps: PropTypes.shape({
|
|
25
|
+
LookupProps: PropTypes.object,
|
|
26
|
+
AlertHeaderProps: PropTypes.object,
|
|
27
|
+
PrimaryButtonProps: PropTypes.object,
|
|
28
|
+
SecondaryButtonProps: PropTypes.object
|
|
29
|
+
}),
|
|
30
|
+
align: PropTypes.oneOf(['top', 'vertical']),
|
|
31
|
+
childAnimationName: PropTypes.oneOf(['expand', 'flyDown']),
|
|
32
|
+
isHtmlContent: PropTypes.bool,
|
|
33
|
+
scroll: PropTypes.oneOf(['horizontal', 'vertical', 'both']),
|
|
34
|
+
onEsc: PropTypes.oneOf(['close', 'cancel']),
|
|
35
|
+
renderAlertIcon: PropTypes.func
|
|
36
|
+
};
|