@zohodesk/dot 1.0.0-temp-175.6 → 1.0.0-temp-181
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/propValidation_report.html +1 -1
- package/README.md +30 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +0 -1
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +0 -1
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +0 -1
- 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 +7 -7
- package/coverage/IconButton/IconButton.module.css.html +1 -1
- package/coverage/IconButton/index.html +11 -11
- package/coverage/IconButton/props/defaultProps.js.html +1 -1
- package/coverage/IconButton/props/index.html +1 -1
- package/coverage/IconButton/props/propTypes.js.html +1 -1
- 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 +16 -16
- package/coverage/coverage-summary.json +17 -17
- package/coverage/index.html +11 -11
- package/es/Drawer/Drawer.js +6 -3
- package/es/Drawer/props/defaultProps.js +2 -1
- package/es/Drawer/props/propTypes.js +2 -1
- package/es/Hooks/Dragger/useDragger.js +4 -3
- package/es/IconButton/IconButton.js +2 -2
- package/es/NewStar/NewStar.module.css +128 -67
- package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +4 -0
- package/es/form/fields/TextEditor/TextEditor.module.css +63 -47
- package/es/list/status/StatusDropdown/StatusDropdown.js +2 -1
- package/es/list/status/StatusListItem/StatusListItem.js +12 -5
- package/es/list/status/StatusListItem/props/defaultProps.js +2 -1
- package/es/list/status/StatusListItem/props/propTypes.js +3 -1
- package/es/lookup/Lookup/Lookup.js +6 -3
- package/es/v1/DotWrapper/DotWrapper.js +28 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/component/DarkMode_Component.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/component/LightMode_Component.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/component/PureDarkMode_Component.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/dot/DarkMode_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/dot/LightMode_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/dot/PureDarkMode_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/svg/DarkMode_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/svg/LightMode_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/appearance/svg/PureDarkMode_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/dynamicImports.js +19 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Dark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Light_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_Dark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_Light_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_PureDark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Dark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Light_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_Dark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_Light_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_PureDark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +3 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Dark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Light_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Dark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Light_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Dark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Light_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Dark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Light_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +1 -0
- package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +1 -0
- package/es/v1/DotWrapper/props/defaultProps.js +7 -0
- package/es/v1/DotWrapper/props/propTypes.js +8 -0
- package/es/v1/DotWrapper/utils/appearanceProperties.js +46 -0
- package/es/v1/DotWrapper/utils/errorMessage.js +7 -0
- package/es/v1/DotWrapper/utils/importFiles.js +18 -0
- package/es/v1/DotWrapper/utils/themeProperties.js +220 -0
- package/es/v1/Drawer/Drawer.js +6 -3
- package/es/v1/Drawer/props/defaultProps.js +2 -1
- package/es/v1/Drawer/props/propTypes.js +2 -1
- package/es/v1/GlobalNotification/GlobalNotification.js +51 -19
- package/es/v1/GlobalNotification/props/defaultProps.js +3 -1
- package/es/v1/GlobalNotification/props/propTypes.js +12 -2
- package/es/v1/IconButton/IconButton.js +2 -2
- package/es/v1/form/fields/SelectField/SelectField.js +1 -9
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +122 -142
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +133 -153
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +137 -178
- package/es/v1/form/fields/TextareaField/TextareaField.js +113 -137
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +43 -43
- package/es/v1/form/layout/Field/Field.js +24 -28
- package/es/v1/form/layout/Section/Section.js +25 -33
- package/es/v1/form/layout/Section/props/propTypes.js +0 -1
- package/es/v1/list/Subject/Subject.js +39 -48
- package/es/v1/list/TagNew/TagNew.js +18 -27
- package/es/v1/list/Thread/Thread.js +26 -35
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -1
- package/es/v1/list/status/StatusListItem/StatusListItem.js +12 -5
- package/es/v1/list/status/StatusListItem/props/defaultProps.js +2 -1
- package/es/v1/list/status/StatusListItem/props/propTypes.js +3 -1
- package/es/v1/lookup/Lookup/Lookup.js +6 -3
- package/es/version2/GlobalNotification/GlobalNotification.module.css +1 -2
- package/lib/Drawer/Drawer.js +6 -3
- package/lib/Drawer/props/defaultProps.js +2 -1
- package/lib/Drawer/props/propTypes.js +2 -1
- package/lib/Hooks/Dragger/useDragger.js +4 -3
- package/lib/IconButton/IconButton.js +2 -2
- package/lib/NewStar/NewStar.module.css +128 -67
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +4 -0
- package/lib/form/fields/TextEditor/TextEditor.module.css +63 -47
- package/lib/list/status/StatusDropdown/StatusDropdown.js +2 -1
- package/lib/list/status/StatusListItem/StatusListItem.js +12 -5
- package/lib/list/status/StatusListItem/props/defaultProps.js +2 -1
- package/lib/list/status/StatusListItem/props/propTypes.js +3 -1
- package/lib/lookup/Lookup/Lookup.js +14 -3
- package/lib/v1/DotWrapper/DotWrapper.js +41 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/component/DarkMode_Component.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/component/LightMode_Component.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/component/PureDarkMode_Component.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/dot/DarkMode_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/dot/LightMode_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/dot/PureDarkMode_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/svg/DarkMode_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/svg/LightMode_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/appearance/svg/PureDarkMode_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/dynamicImports.js +33 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Dark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Light_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_Dark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_Light_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_PureDark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Dark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Light_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_Dark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_Light_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_PureDark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +7 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Dark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Light_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Dark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Light_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Dark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Light_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Dark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Light_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +3 -0
- package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +3 -0
- package/lib/v1/DotWrapper/props/defaultProps.js +14 -0
- package/lib/v1/DotWrapper/props/propTypes.js +19 -0
- package/lib/v1/DotWrapper/utils/appearanceProperties.js +79 -0
- package/lib/v1/DotWrapper/utils/errorMessage.js +14 -0
- package/lib/v1/DotWrapper/utils/importFiles.js +25 -0
- package/lib/v1/DotWrapper/utils/themeProperties.js +325 -0
- package/lib/v1/Drawer/Drawer.js +6 -3
- package/lib/v1/Drawer/props/defaultProps.js +2 -1
- package/lib/v1/Drawer/props/propTypes.js +2 -1
- package/lib/v1/GlobalNotification/GlobalNotification.js +66 -17
- package/lib/v1/GlobalNotification/props/defaultProps.js +3 -1
- package/lib/v1/GlobalNotification/props/propTypes.js +17 -4
- package/lib/v1/IconButton/IconButton.js +2 -2
- package/lib/v1/form/fields/SelectField/SelectField.js +1 -7
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +125 -181
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +138 -193
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +160 -212
- package/lib/v1/form/fields/TextareaField/TextareaField.js +117 -177
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +41 -80
- package/lib/v1/form/layout/Field/Field.js +22 -69
- package/lib/v1/form/layout/Section/Section.js +27 -72
- package/lib/v1/form/layout/Section/props/propTypes.js +0 -1
- package/lib/v1/list/Subject/Subject.js +39 -87
- package/lib/v1/list/TagNew/TagNew.js +18 -66
- package/lib/v1/list/Thread/Thread.js +25 -73
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -1
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +12 -5
- package/lib/v1/list/status/StatusListItem/props/defaultProps.js +2 -1
- package/lib/v1/list/status/StatusListItem/props/propTypes.js +3 -1
- package/lib/v1/lookup/Lookup/Lookup.js +11 -6
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +1 -2
- package/package.json +13 -13
- package/prePublish.js +0 -69
- package/react-cli.config.js +6 -1
- package/result.json +1 -1
- package/unittest/index.html +1 -1
|
@@ -7,28 +7,50 @@ import AutoClose from '../../actions/AutoClose';
|
|
|
7
7
|
import AlertIcons from '../alert/alertIcons/AlertIcons';
|
|
8
8
|
import AlertClose from '../alert/AlertClose/AlertClose';
|
|
9
9
|
import { Container, Box } from '@zohodesk/components/es/v1/Layout';
|
|
10
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
10
11
|
import style from '../../version2/GlobalNotification/GlobalNotification.module.css';
|
|
11
12
|
export default function GlobalNotification(props) {
|
|
12
13
|
let {
|
|
13
14
|
type,
|
|
14
15
|
message,
|
|
15
16
|
hideMessage,
|
|
17
|
+
hideTime,
|
|
16
18
|
onClick,
|
|
19
|
+
onClose,
|
|
20
|
+
needAutoClose,
|
|
17
21
|
i18nKeys = {},
|
|
18
22
|
customProps,
|
|
19
23
|
dataSelectorId,
|
|
20
|
-
|
|
24
|
+
id,
|
|
25
|
+
needShadow,
|
|
26
|
+
shadowCount,
|
|
27
|
+
eleRef
|
|
21
28
|
} = props;
|
|
29
|
+
const hideMessageTimer = useRef(null);
|
|
30
|
+
const [shadowClose, setShadowClose] = useState(true);
|
|
22
31
|
useEffect(() => {
|
|
23
|
-
if (
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
hideMessage();
|
|
26
|
-
},
|
|
32
|
+
if (needAutoClose) {
|
|
33
|
+
hideMessageTimer.current = setTimeout(() => {
|
|
34
|
+
hideMessage(id);
|
|
35
|
+
}, hideTime);
|
|
27
36
|
}
|
|
28
|
-
|
|
37
|
+
|
|
38
|
+
return () => {
|
|
39
|
+
if (hideMessageTimer.current) {
|
|
40
|
+
clearTimeout(hideMessageTimer.current);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
29
44
|
let {
|
|
30
45
|
closeTitle = 'Close'
|
|
31
46
|
} = i18nKeys;
|
|
47
|
+
|
|
48
|
+
function onCloseLocal(e) {
|
|
49
|
+
setShadowClose(false);
|
|
50
|
+
hideMessage && hideMessage(id);
|
|
51
|
+
onClose && onClose(e);
|
|
52
|
+
}
|
|
53
|
+
|
|
32
54
|
return /*#__PURE__*/React.createElement(GlobalNotificationUI, {
|
|
33
55
|
type: type,
|
|
34
56
|
message: message,
|
|
@@ -36,7 +58,12 @@ export default function GlobalNotification(props) {
|
|
|
36
58
|
onClick: onClick,
|
|
37
59
|
closeTitle: closeTitle,
|
|
38
60
|
customProps: customProps,
|
|
39
|
-
dataSelectorId: dataSelectorId
|
|
61
|
+
dataSelectorId: dataSelectorId,
|
|
62
|
+
id: id,
|
|
63
|
+
shadowCount: shadowCount,
|
|
64
|
+
onClose: onCloseLocal,
|
|
65
|
+
needShadow: shadowClose && needShadow,
|
|
66
|
+
eleRef: eleRef
|
|
40
67
|
});
|
|
41
68
|
}
|
|
42
69
|
GlobalNotification.propTypes = propTypes;
|
|
@@ -48,28 +75,33 @@ GlobalNotification.defaultProps = defaultProps; // if (__DOCS__) {
|
|
|
48
75
|
// }
|
|
49
76
|
|
|
50
77
|
export function GlobalNotificationUI(props) {
|
|
51
|
-
function onClose(e) {
|
|
52
|
-
let {
|
|
53
|
-
hideMessage,
|
|
54
|
-
onClose
|
|
55
|
-
} = props;
|
|
56
|
-
hideMessage && hideMessage(e);
|
|
57
|
-
onClose && onClose(e);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
78
|
let {
|
|
61
79
|
type = '',
|
|
62
80
|
message,
|
|
63
81
|
onClick,
|
|
64
82
|
closeTitle = '',
|
|
65
83
|
customProps = {},
|
|
66
|
-
dataSelectorId
|
|
84
|
+
dataSelectorId,
|
|
85
|
+
shadowCount,
|
|
86
|
+
needShadow,
|
|
87
|
+
eleRef,
|
|
88
|
+
onClose
|
|
67
89
|
} = props;
|
|
68
90
|
let {
|
|
69
91
|
ExtraProps = {}
|
|
70
92
|
} = customProps;
|
|
93
|
+
|
|
94
|
+
function onCloseLocal(e) {
|
|
95
|
+
cancelBubblingEffect(e);
|
|
96
|
+
onClose && onClose(e);
|
|
97
|
+
}
|
|
98
|
+
|
|
71
99
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
72
|
-
|
|
100
|
+
ref: eleRef,
|
|
101
|
+
className: ` ${style.message}
|
|
102
|
+
${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
|
|
103
|
+
${type ? style[type] : ''}
|
|
104
|
+
`,
|
|
73
105
|
"data-id": `show_${type}_message`,
|
|
74
106
|
"data-test-id": `show_${type}_message`,
|
|
75
107
|
tabIndex: 0,
|
|
@@ -100,7 +132,7 @@ export function GlobalNotificationUI(props) {
|
|
|
100
132
|
}, /*#__PURE__*/React.createElement(AlertClose, {
|
|
101
133
|
dataId: `close_${type}_message`,
|
|
102
134
|
dataTitle: closeTitle,
|
|
103
|
-
onClose:
|
|
135
|
+
onClose: onCloseLocal,
|
|
104
136
|
type: type
|
|
105
137
|
}))));
|
|
106
138
|
}
|
|
@@ -9,7 +9,13 @@ export const propTypes = {
|
|
|
9
9
|
i18nKeys: PropTypes.object,
|
|
10
10
|
customProps: PropTypes.shape({
|
|
11
11
|
ExtraProps: PropTypes.object
|
|
12
|
-
})
|
|
12
|
+
}),
|
|
13
|
+
id: PropTypes.number,
|
|
14
|
+
hideTime: PropTypes.number,
|
|
15
|
+
needAutoClose: PropTypes.bool,
|
|
16
|
+
isCollapseView: PropTypes.bool,
|
|
17
|
+
shadowCount: PropTypes.number,
|
|
18
|
+
needShadow: PropTypes.bool
|
|
13
19
|
};
|
|
14
20
|
export const UI_propTypes = {
|
|
15
21
|
dataSelectorId: PropTypes.string,
|
|
@@ -21,7 +27,11 @@ export const UI_propTypes = {
|
|
|
21
27
|
type: PropTypes.oneOf(['success', 'danger', 'info', 'warning', 'error']),
|
|
22
28
|
customProps: PropTypes.shape({
|
|
23
29
|
ExtraProps: PropTypes.object
|
|
24
|
-
})
|
|
30
|
+
}),
|
|
31
|
+
needShadow: PropTypes.bool,
|
|
32
|
+
shadowCount: PropTypes.number,
|
|
33
|
+
id: PropTypes.number,
|
|
34
|
+
onClose: PropTypes.func
|
|
25
35
|
};
|
|
26
36
|
export const new_propTypes = {
|
|
27
37
|
Element: PropTypes.element,
|
|
@@ -38,8 +38,8 @@ export default function IconButton(props) {
|
|
|
38
38
|
|
|
39
39
|
function handleToggle(e) {
|
|
40
40
|
if (e.key === ' ' || e.key === 'Enter' || e.key === 'Spacebar') {
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
|
|
41
|
+
e.preventDefault(); // triggerClick(e);
|
|
42
|
+
|
|
43
43
|
triggerMouseDown(e);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -11,8 +11,6 @@ import Select from '@zohodesk/components/es/v1/Select/Select';
|
|
|
11
11
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
12
|
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
13
13
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
|
-
/**** props ****/
|
|
15
|
-
|
|
16
14
|
/** CSS */
|
|
17
15
|
|
|
18
16
|
import style from '../../../../form/fields/Fields.module.css';
|
|
@@ -84,13 +82,7 @@ const SelectField = props => {
|
|
|
84
82
|
|
|
85
83
|
const handleGetRef = el => {
|
|
86
84
|
getRef && getRef(el, id);
|
|
87
|
-
};
|
|
88
|
-
// let { isFocusOnLabelClick } = this.props;
|
|
89
|
-
// if (isFocusOnLabelClick && this.selectBox && this.selectBox.focus) {
|
|
90
|
-
// this.selectBox.focus();
|
|
91
|
-
// }
|
|
92
|
-
// }
|
|
93
|
-
|
|
85
|
+
};
|
|
94
86
|
|
|
95
87
|
return /*#__PURE__*/React.createElement("div", {
|
|
96
88
|
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
/**** Libraries ****/
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { memo } from 'react';
|
|
5
5
|
import { defaultProps } from './props/defaultProps';
|
|
6
6
|
import { propTypes } from './props/propTypes';
|
|
7
7
|
/**** Components ****/
|
|
@@ -9,156 +9,136 @@ import { propTypes } from './props/propTypes';
|
|
|
9
9
|
import Label from '@zohodesk/components/es/v1/Label/Label';
|
|
10
10
|
import TextBoxIcon from '@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon';
|
|
11
11
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
|
-
import {
|
|
12
|
+
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
13
13
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
14
|
/**** CSS ****/
|
|
15
15
|
|
|
16
16
|
import style from '../../../../form/fields/Fields.module.css';
|
|
17
|
-
export default class TextBoxField extends PureComponent {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.handleChange = this.handleChange.bind(this);
|
|
21
|
-
this.handleGetRef = this.handleGetRef.bind(this); // this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
const TextBoxField = props => {
|
|
19
|
+
const {
|
|
20
|
+
labelName,
|
|
21
|
+
id,
|
|
22
|
+
textBoxSize,
|
|
23
|
+
textBoxVariant,
|
|
24
|
+
textBoxType,
|
|
25
|
+
isMandatory,
|
|
26
|
+
validationMessage,
|
|
27
|
+
validationPalette,
|
|
28
|
+
maxLength,
|
|
29
|
+
isReadOnly,
|
|
30
|
+
value,
|
|
31
|
+
errorType,
|
|
32
|
+
isDisabled,
|
|
33
|
+
title,
|
|
34
|
+
onBlur,
|
|
35
|
+
dataId,
|
|
36
|
+
dataSelectorId,
|
|
37
|
+
validationRuleMessage,
|
|
38
|
+
validationRulePalette,
|
|
39
|
+
onKeyDown,
|
|
40
|
+
placeHolder,
|
|
41
|
+
infoText,
|
|
42
|
+
borderColor,
|
|
43
|
+
fieldSize,
|
|
44
|
+
labelPalette,
|
|
45
|
+
labelCustomClass,
|
|
46
|
+
htmlId,
|
|
47
|
+
lockedInfoText,
|
|
48
|
+
isLocked,
|
|
49
|
+
needReadOnlyStyle,
|
|
50
|
+
isClickable,
|
|
51
|
+
onFocus,
|
|
52
|
+
ePhiData,
|
|
53
|
+
children,
|
|
54
|
+
customProps,
|
|
55
|
+
renderLabelProps,
|
|
56
|
+
onChange,
|
|
57
|
+
getRef
|
|
58
|
+
} = props;
|
|
59
|
+
const {
|
|
60
|
+
LabelProps = {},
|
|
61
|
+
TextBoxIconProps = {},
|
|
62
|
+
ValidationMessageProps1 = {},
|
|
63
|
+
ValidationMessageProps2 = {}
|
|
64
|
+
} = customProps;
|
|
65
|
+
const getNextId = useUniqueId();
|
|
66
|
+
let uniqueId = htmlId ? htmlId : getNextId();
|
|
25
67
|
|
|
26
|
-
handleChange
|
|
27
|
-
let {
|
|
28
|
-
id,
|
|
29
|
-
onChange
|
|
30
|
-
} = this.props;
|
|
68
|
+
const handleChange = value => {
|
|
31
69
|
onChange && onChange(id, value);
|
|
32
|
-
}
|
|
70
|
+
};
|
|
33
71
|
|
|
34
|
-
handleGetRef
|
|
35
|
-
let {
|
|
36
|
-
getRef,
|
|
37
|
-
id
|
|
38
|
-
} = this.props;
|
|
39
|
-
this.textBox = el;
|
|
72
|
+
const handleGetRef = el => {
|
|
40
73
|
getRef && getRef(el, id);
|
|
41
|
-
}
|
|
42
|
-
// // let { isFocusOnLabelClick } = this.props;
|
|
43
|
-
// // if (isFocusOnLabelClick && this.textBox && this.textBox.focus) {
|
|
44
|
-
// // this.textBox.focus();
|
|
45
|
-
// // }
|
|
46
|
-
// }
|
|
74
|
+
};
|
|
47
75
|
|
|
76
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
77
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
78
|
+
"data-title": isDisabled ? title : null,
|
|
79
|
+
"data-selector-id": dataSelectorId
|
|
80
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
81
|
+
infoText: infoText,
|
|
82
|
+
isLocked: isLocked,
|
|
83
|
+
lockedInfoText: lockedInfoText,
|
|
84
|
+
ePhiData: ePhiData,
|
|
85
|
+
dataId: dataId,
|
|
86
|
+
renderProps: renderLabelProps
|
|
87
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
88
|
+
text: labelName,
|
|
89
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
90
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
91
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
92
|
+
htmlFor: uniqueId,
|
|
93
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
94
|
+
}, LabelProps, {
|
|
95
|
+
id: labelName
|
|
96
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
97
|
+
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
98
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
|
|
99
|
+
htmlId: uniqueId,
|
|
100
|
+
id: id,
|
|
101
|
+
type: textBoxType,
|
|
102
|
+
variant: textBoxVariant,
|
|
103
|
+
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
104
|
+
maxLength: maxLength,
|
|
105
|
+
isReadOnly: isReadOnly,
|
|
106
|
+
inputRef: handleGetRef,
|
|
107
|
+
value: value,
|
|
108
|
+
onChange: handleChange,
|
|
109
|
+
dataId: dataId,
|
|
110
|
+
onBlur: onBlur,
|
|
111
|
+
onKeyDown: onKeyDown,
|
|
112
|
+
placeHolder: placeHolder,
|
|
113
|
+
borderColor: borderColor,
|
|
114
|
+
onFocus: onFocus,
|
|
115
|
+
isDisabled: isDisabled,
|
|
116
|
+
needEffect: isReadOnly || isDisabled ? false : true,
|
|
117
|
+
isClickable: isClickable,
|
|
118
|
+
needReadOnlyStyle: needReadOnlyStyle
|
|
119
|
+
}, TextBoxIconProps, {
|
|
120
|
+
a11y: {
|
|
121
|
+
ariaLabelledby: labelName
|
|
122
|
+
}
|
|
123
|
+
}), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
124
|
+
text: validationMessage,
|
|
125
|
+
palette: validationPalette,
|
|
126
|
+
type: errorType,
|
|
127
|
+
dataId: `${dataId}_ValidationMessage`,
|
|
128
|
+
htmlFor: uniqueId
|
|
129
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
130
|
+
text: validationRuleMessage,
|
|
131
|
+
palette: validationRulePalette,
|
|
132
|
+
type: errorType,
|
|
133
|
+
htmlFor: uniqueId,
|
|
134
|
+
dataId: `${dataId}_ValidationRuleMessage`
|
|
135
|
+
}, ValidationMessageProps2))));
|
|
136
|
+
};
|
|
48
137
|
|
|
49
|
-
render() {
|
|
50
|
-
let {
|
|
51
|
-
labelName,
|
|
52
|
-
id,
|
|
53
|
-
textBoxSize,
|
|
54
|
-
textBoxVariant,
|
|
55
|
-
textBoxType,
|
|
56
|
-
isMandatory,
|
|
57
|
-
validationMessage,
|
|
58
|
-
validationPalette,
|
|
59
|
-
maxLength,
|
|
60
|
-
isReadOnly,
|
|
61
|
-
value,
|
|
62
|
-
errorType,
|
|
63
|
-
isDisabled,
|
|
64
|
-
title,
|
|
65
|
-
onBlur,
|
|
66
|
-
dataId,
|
|
67
|
-
dataSelectorId,
|
|
68
|
-
validationRuleMessage,
|
|
69
|
-
validationRulePalette,
|
|
70
|
-
onKeyDown,
|
|
71
|
-
placeHolder,
|
|
72
|
-
infoText,
|
|
73
|
-
borderColor,
|
|
74
|
-
fieldSize,
|
|
75
|
-
labelPalette,
|
|
76
|
-
labelCustomClass,
|
|
77
|
-
htmlId,
|
|
78
|
-
lockedInfoText,
|
|
79
|
-
isLocked,
|
|
80
|
-
needReadOnlyStyle,
|
|
81
|
-
isClickable,
|
|
82
|
-
onFocus,
|
|
83
|
-
ePhiData,
|
|
84
|
-
children,
|
|
85
|
-
customProps,
|
|
86
|
-
renderLabelProps
|
|
87
|
-
} = this.props;
|
|
88
|
-
const {
|
|
89
|
-
LabelProps = {},
|
|
90
|
-
TextBoxIconProps = {},
|
|
91
|
-
ValidationMessageProps1 = {},
|
|
92
|
-
ValidationMessageProps2 = {}
|
|
93
|
-
} = customProps;
|
|
94
|
-
let uniqueId = htmlId ? htmlId : this.getNextId();
|
|
95
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
96
|
-
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
97
|
-
"data-title": isDisabled ? title : null,
|
|
98
|
-
"data-selector-id": dataSelectorId
|
|
99
|
-
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
100
|
-
infoText: infoText,
|
|
101
|
-
isLocked: isLocked,
|
|
102
|
-
lockedInfoText: lockedInfoText,
|
|
103
|
-
ePhiData: ePhiData,
|
|
104
|
-
dataId: dataId,
|
|
105
|
-
renderProps: renderLabelProps
|
|
106
|
-
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
107
|
-
text: labelName,
|
|
108
|
-
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
109
|
-
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
110
|
-
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
111
|
-
htmlFor: uniqueId,
|
|
112
|
-
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
113
|
-
}, LabelProps, {
|
|
114
|
-
id: labelName
|
|
115
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
116
|
-
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
117
|
-
}, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
|
|
118
|
-
htmlId: uniqueId,
|
|
119
|
-
id: id,
|
|
120
|
-
type: textBoxType,
|
|
121
|
-
variant: textBoxVariant,
|
|
122
|
-
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
123
|
-
maxLength: maxLength,
|
|
124
|
-
isReadOnly: isReadOnly,
|
|
125
|
-
inputRef: this.handleGetRef,
|
|
126
|
-
value: value,
|
|
127
|
-
onChange: this.handleChange,
|
|
128
|
-
dataId: dataId,
|
|
129
|
-
onBlur: onBlur,
|
|
130
|
-
onKeyDown: onKeyDown,
|
|
131
|
-
placeHolder: placeHolder,
|
|
132
|
-
borderColor: borderColor,
|
|
133
|
-
onFocus: onFocus,
|
|
134
|
-
isDisabled: isDisabled,
|
|
135
|
-
needEffect: isReadOnly || isDisabled ? false : true,
|
|
136
|
-
isClickable: isClickable,
|
|
137
|
-
needReadOnlyStyle: needReadOnlyStyle
|
|
138
|
-
}, TextBoxIconProps, {
|
|
139
|
-
a11y: {
|
|
140
|
-
ariaLabelledby: labelName
|
|
141
|
-
}
|
|
142
|
-
}), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
143
|
-
text: validationMessage,
|
|
144
|
-
palette: validationPalette,
|
|
145
|
-
type: errorType,
|
|
146
|
-
dataId: `${dataId}_ValidationMessage`,
|
|
147
|
-
htmlFor: uniqueId
|
|
148
|
-
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
149
|
-
text: validationRuleMessage,
|
|
150
|
-
palette: validationRulePalette,
|
|
151
|
-
type: errorType,
|
|
152
|
-
htmlFor: uniqueId,
|
|
153
|
-
dataId: `${dataId}_ValidationRuleMessage`
|
|
154
|
-
}, ValidationMessageProps2))));
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
}
|
|
158
138
|
TextBoxField.propTypes = propTypes;
|
|
159
|
-
TextBoxField.defaultProps = defaultProps;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
139
|
+
TextBoxField.defaultProps = defaultProps;
|
|
140
|
+
const MemoizedTextBoxField = /*#__PURE__*/memo(TextBoxField);
|
|
141
|
+
MemoizedTextBoxField.propTypes = propTypes;
|
|
142
|
+
MemoizedTextBoxField.defaultProps = defaultProps;
|
|
143
|
+
MemoizedTextBoxField.displayName = 'TextBoxField';
|
|
144
|
+
export default TextBoxField;
|