@zohodesk/dot 1.0.0-beta.251 → 1.0.0-beta.253
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 +11 -0
- package/css_error.log +1 -0
- package/es/Drawer/Drawer.js +3 -2
- package/es/FreezeLayer/useFreezeLayer.js +5 -3
- package/es/Link/Link.js +3 -2
- package/es/ToastMessage/ToastMessage.js +2 -5
- package/es/actions/AutoClose.js +2 -5
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +9 -3
- package/es/dropdown/ToggleDropDown/props/defaultProps.js +2 -1
- package/es/dropdown/ToggleDropDown/props/propTypes.js +5 -1
- package/es/list/status/StatusListItem/StatusListItem.js +1 -1
- package/es/list/status/StatusListItem/StatusListItem.module.css +7 -5
- package/es/lookup/header/Search/Search.js +5 -8
- package/lib/Drawer/Drawer.js +3 -2
- package/lib/FreezeLayer/useFreezeLayer.js +4 -2
- package/lib/Link/Link.js +3 -2
- package/lib/ToastMessage/ToastMessage.js +2 -5
- package/lib/actions/AutoClose.js +2 -5
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +9 -3
- package/lib/dropdown/ToggleDropDown/props/defaultProps.js +2 -1
- package/lib/dropdown/ToggleDropDown/props/propTypes.js +5 -1
- package/lib/list/status/StatusListItem/StatusListItem.js +1 -1
- package/lib/list/status/StatusListItem/StatusListItem.module.css +7 -5
- package/lib/lookup/header/Search/Search.js +5 -10
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
In this Library, we Provide Some Basic Components to Build Your Application
|
|
4
4
|
|
|
5
|
+
# 1.0.0-beta.253
|
|
6
|
+
|
|
7
|
+
- **FreezeLayer** - onClick event issue solved
|
|
8
|
+
- cancelBubblingEffect function replaced to all stopPropagation used placed
|
|
9
|
+
|
|
10
|
+
# 1.0.0-beta.252
|
|
11
|
+
|
|
12
|
+
- **ToggleDropdown** - customClass (customDropBox and customListBox) Support added.
|
|
13
|
+
|
|
14
|
+
- **StatusDropdown** - align item value changed (center => baseline) and Line-height changed(18px => 20px)
|
|
15
|
+
|
|
5
16
|
# 1.0.0-beta.251
|
|
6
17
|
|
|
7
18
|
- **ToggleDropdown, StatusDropdown, StatusListItem** - Added New Prop `needMultiLineText`
|
package/css_error.log
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
DOT Package error log:
|
package/es/Drawer/Drawer.js
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Header_defaultProps, Footer_defaultProps, Drawer_defaultProps } from './props/defaultProps';
|
|
3
3
|
import { Header_propTypes, Content_propTypes, Footer_propTypes, Drawer_propTypes } from './props/propTypes';
|
|
4
4
|
import FreezeLayer from '../FreezeLayer/FreezeLayer';
|
|
5
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
5
6
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
6
7
|
import { Card, CardHeader, CardContent } from '@zohodesk/components/lib/Card';
|
|
7
8
|
import FormAction from '../FormAction/FormAction';
|
|
@@ -166,7 +167,7 @@ export default class Drawer extends React.Component {
|
|
|
166
167
|
eleRef: this.createRef
|
|
167
168
|
}, /*#__PURE__*/React.createElement(Card, {
|
|
168
169
|
onClick: e => {
|
|
169
|
-
e
|
|
170
|
+
cancelBubblingEffect(e);
|
|
170
171
|
onBodyClick(e);
|
|
171
172
|
}
|
|
172
173
|
}, childrenWithProps));
|
|
@@ -178,7 +179,7 @@ export default class Drawer extends React.Component {
|
|
|
178
179
|
}, /*#__PURE__*/React.createElement(ResponsiveSender, null, /*#__PURE__*/React.createElement(Container, {
|
|
179
180
|
className: styleByResolutions,
|
|
180
181
|
onClick: e => {
|
|
181
|
-
e
|
|
182
|
+
cancelBubblingEffect(e);
|
|
182
183
|
}
|
|
183
184
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
184
185
|
flexible: true
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { isTextSelected } from '@zohodesk/components/es/utils/Common';
|
|
2
|
+
import { isTextSelected, cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
3
3
|
import { getDotLibraryConfig } from '../Provider/Config';
|
|
4
4
|
export default function useFreezeLayer(_ref) {
|
|
5
5
|
let {
|
|
@@ -9,9 +9,11 @@ export default function useFreezeLayer(_ref) {
|
|
|
9
9
|
const [isActive, setActive] = useState(propsActive);
|
|
10
10
|
const [isChildActive, setChildActive] = useState(false);
|
|
11
11
|
let isFreezeLayerEnabled = useRef(false);
|
|
12
|
-
function handleClick() {
|
|
12
|
+
function handleClick(e) {
|
|
13
13
|
if (onClick && !isTextSelected()) {
|
|
14
|
-
onClick();
|
|
14
|
+
onClick(e);
|
|
15
|
+
} else {
|
|
16
|
+
cancelBubblingEffect(e);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
19
|
function enableFreeze() {
|
package/es/Link/Link.js
CHANGED
|
@@ -2,6 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { defaultProps } from './props/defaultProps';
|
|
4
4
|
import { propTypes } from './props/propTypes';
|
|
5
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
5
6
|
import style from './Link.module.css';
|
|
6
7
|
import LinkContext from './LinkContext';
|
|
7
8
|
export default class Link extends React.Component {
|
|
@@ -19,14 +20,14 @@ export default class Link extends React.Component {
|
|
|
19
20
|
onCallBack
|
|
20
21
|
} = this.context.options;
|
|
21
22
|
if (e && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
|
|
22
|
-
e
|
|
23
|
+
cancelBubblingEffect(e);
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
onClick && onClick(e);
|
|
26
27
|
if (!hasReload && target != '_blank') {
|
|
27
28
|
e && e.preventDefault();
|
|
28
29
|
}
|
|
29
|
-
e
|
|
30
|
+
cancelBubblingEffect(e);
|
|
30
31
|
!onClick && onCallBack && onCallBack(urlOutput, href, e);
|
|
31
32
|
}
|
|
32
33
|
addHttp(url) {
|
|
@@ -3,6 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import { defaultProps } from './props/defaultProps';
|
|
4
4
|
import { propTypes } from './props/propTypes';
|
|
5
5
|
//components
|
|
6
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
6
7
|
import { Icon } from '@zohodesk/icons';
|
|
7
8
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
8
9
|
import { useZIndex } from '@zohodesk/components/lib/Provider/ZindexProvider';
|
|
@@ -11,10 +12,6 @@ import AutoClose from '../actions/AutoClose';
|
|
|
11
12
|
import a11yStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css';
|
|
12
13
|
//style
|
|
13
14
|
import style from './ToastMessage.module.css';
|
|
14
|
-
function removeClose(e) {
|
|
15
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
16
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
17
|
-
}
|
|
18
15
|
function ToastMessageUI(props) {
|
|
19
16
|
let [messageState, setMessageState] = useState(props.messageState);
|
|
20
17
|
let {
|
|
@@ -54,7 +51,7 @@ function ToastMessageUI(props) {
|
|
|
54
51
|
onClose && onClose();
|
|
55
52
|
}
|
|
56
53
|
function changeMessageState(e) {
|
|
57
|
-
|
|
54
|
+
cancelBubblingEffect(e);
|
|
58
55
|
setMessageState(!messageState);
|
|
59
56
|
}
|
|
60
57
|
let animateClass = isClose ? style.rightanimate : style.leftanimate;
|
package/es/actions/AutoClose.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
2
3
|
import { defaultProps } from './props/defaultProps';
|
|
3
4
|
import { propTypes } from './props/propTypes';
|
|
4
|
-
function removeClose(e) {
|
|
5
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
6
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
7
|
-
}
|
|
8
5
|
export default function AutoClose(props) {
|
|
9
6
|
let {
|
|
10
7
|
Element,
|
|
@@ -15,7 +12,7 @@ export default function AutoClose(props) {
|
|
|
15
12
|
} = props;
|
|
16
13
|
let [isClose, setClose] = useState(givenClose);
|
|
17
14
|
function onClose(e) {
|
|
18
|
-
|
|
15
|
+
cancelBubblingEffect(e);
|
|
19
16
|
onPortalClose && onPortalClose();
|
|
20
17
|
}
|
|
21
18
|
useEffect(() => {
|
|
@@ -520,7 +520,8 @@ export class ToggleDropDown extends Component {
|
|
|
520
520
|
palette,
|
|
521
521
|
getFooter,
|
|
522
522
|
customProps,
|
|
523
|
-
needMultiLineText
|
|
523
|
+
needMultiLineText,
|
|
524
|
+
customClass
|
|
524
525
|
} = this.props;
|
|
525
526
|
let {
|
|
526
527
|
ToggleDropDownProps = {},
|
|
@@ -529,6 +530,10 @@ export class ToggleDropDown extends Component {
|
|
|
529
530
|
ListItemWithIconProps = {},
|
|
530
531
|
ListItemProps = {}
|
|
531
532
|
} = customProps;
|
|
533
|
+
let {
|
|
534
|
+
customDropBox = '',
|
|
535
|
+
customListBox = ''
|
|
536
|
+
} = customClass;
|
|
532
537
|
const isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
|
|
533
538
|
const Component = isToggleStateNeeded ? children.type : null,
|
|
534
539
|
componentProps = isToggleStateNeeded ? children.props : null;
|
|
@@ -613,7 +618,8 @@ export class ToggleDropDown extends Component {
|
|
|
613
618
|
isAnimate: true,
|
|
614
619
|
getRef: getContainerRef,
|
|
615
620
|
customClass: {
|
|
616
|
-
customDropBoxWrap: style.dropBoxContainer
|
|
621
|
+
customDropBoxWrap: style.dropBoxContainer,
|
|
622
|
+
customDropBox: customDropBox
|
|
617
623
|
},
|
|
618
624
|
needResponsive: needResponsive,
|
|
619
625
|
isPadding: isPadding,
|
|
@@ -659,7 +665,7 @@ export class ToggleDropDown extends Component {
|
|
|
659
665
|
scroll: "vertical",
|
|
660
666
|
preventParentScroll: "vertical",
|
|
661
667
|
dataId: `${dataId}_list`,
|
|
662
|
-
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
668
|
+
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt} ${customListBox}`,
|
|
663
669
|
eleRef: this.scrollContentRef,
|
|
664
670
|
onScroll: this.handleScroll,
|
|
665
671
|
role: isSearch ? 'listbox' : undefined,
|
|
@@ -68,5 +68,9 @@ export const propTypes = {
|
|
|
68
68
|
ListItemProps: PropTypes.object
|
|
69
69
|
}),
|
|
70
70
|
preventPopupClose: PropTypes.bool,
|
|
71
|
-
needMultiLineText: PropTypes.bool
|
|
71
|
+
needMultiLineText: PropTypes.bool,
|
|
72
|
+
customClass: PropTypes.shape({
|
|
73
|
+
customDropBox: PropTypes.string,
|
|
74
|
+
customListBox: PropTypes.string
|
|
75
|
+
})
|
|
72
76
|
};
|
|
@@ -77,7 +77,7 @@ export default class StatusListItem extends React.Component {
|
|
|
77
77
|
role: role,
|
|
78
78
|
"aria-selected": ariaSelected,
|
|
79
79
|
isCover: false,
|
|
80
|
-
align: "
|
|
80
|
+
align: "baseline",
|
|
81
81
|
alignBox: "row",
|
|
82
82
|
className: `${style.list} ${style[size]} ${style[palette]} ${active ? style.active : highlight && !isDisabled ? style.hover : ''} ${autoHover && !isDisabled ? style.effect : ''} ${needTick ? style.withTick : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? style.withBorder : ''}`,
|
|
83
83
|
dataId: String(value).replace("'", '_'),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
font-size: var(--zd_font_size13);
|
|
4
4
|
position: relative;
|
|
5
5
|
list-style: none;
|
|
6
|
+
min-height: var(--zd_size35);
|
|
6
7
|
cursor: pointer;
|
|
7
8
|
}
|
|
8
9
|
[dir=ltr] .withBorder {
|
|
@@ -12,13 +13,13 @@
|
|
|
12
13
|
border-right: 1px solid var(--zdt_statuslistitem_default_border);
|
|
13
14
|
}
|
|
14
15
|
[dir=ltr] .small {
|
|
15
|
-
padding: var(--
|
|
16
|
+
padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
|
|
16
17
|
}
|
|
17
18
|
[dir=rtl] .small {
|
|
18
|
-
padding: var(--
|
|
19
|
+
padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3);
|
|
19
20
|
}
|
|
20
21
|
.medium {
|
|
21
|
-
padding: var(--
|
|
22
|
+
padding: var(--zd_size7) var(--zd_size20);
|
|
22
23
|
}
|
|
23
24
|
.large {
|
|
24
25
|
height: var(--zd_size48);
|
|
@@ -29,13 +30,14 @@
|
|
|
29
30
|
[dir=rtl] .large {
|
|
30
31
|
padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
.value,.multiLineValue {
|
|
34
|
+
line-height: var(--zd_size20);
|
|
35
|
+
}
|
|
33
36
|
.value {
|
|
34
37
|
composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
|
|
35
38
|
}
|
|
36
39
|
.multiLineValue{
|
|
37
40
|
word-break: break-word;
|
|
38
|
-
line-height: var(--zd_size18);
|
|
39
41
|
composes: clamp from '~@zohodesk/components/lib/common/common.module.css';
|
|
40
42
|
}
|
|
41
43
|
[dir=ltr] .withBorder.active {
|
|
@@ -14,6 +14,7 @@ import ToggleDropDown from '../../../dropdown/ToggleDropDown/ToggleDropDown';
|
|
|
14
14
|
|
|
15
15
|
/** * Methods ** */
|
|
16
16
|
import { debounce } from '@zohodesk/components/lib/utils/debounce';
|
|
17
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
17
18
|
|
|
18
19
|
/** * CSS ** */
|
|
19
20
|
import style from './LookupSearch.module.css';
|
|
@@ -104,10 +105,6 @@ class SearchUI extends Component {
|
|
|
104
105
|
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
105
106
|
this.handleSearch = debounce(this.handleSearch.bind(this), 500);
|
|
106
107
|
}
|
|
107
|
-
cancelBubblingEffect(e) {
|
|
108
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
109
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
110
|
-
}
|
|
111
108
|
handleSearch() {
|
|
112
109
|
const {
|
|
113
110
|
onSearch
|
|
@@ -140,7 +137,7 @@ class SearchUI extends Component {
|
|
|
140
137
|
const {
|
|
141
138
|
onChange
|
|
142
139
|
} = this.props;
|
|
143
|
-
|
|
140
|
+
cancelBubblingEffect(e);
|
|
144
141
|
onChange && onChange('');
|
|
145
142
|
this.handleSearch();
|
|
146
143
|
}
|
|
@@ -196,16 +193,16 @@ class SearchUI extends Component {
|
|
|
196
193
|
placeHolder: placeHolder,
|
|
197
194
|
value: searchStr,
|
|
198
195
|
onChange: this.handleChange,
|
|
199
|
-
onClick:
|
|
196
|
+
onClick: cancelBubblingEffect,
|
|
200
197
|
onFocus: onFocus,
|
|
201
198
|
onBlur: onBlur,
|
|
202
199
|
onKeyDown: this.handleKeyDown,
|
|
203
|
-
onMouseDown:
|
|
200
|
+
onMouseDown: cancelBubblingEffect,
|
|
204
201
|
dataId: dataId,
|
|
205
202
|
size: "small",
|
|
206
203
|
inputRef: getRef,
|
|
207
204
|
onClear: this.handleClear,
|
|
208
|
-
onClearMouseDown:
|
|
205
|
+
onClearMouseDown: cancelBubblingEffect
|
|
209
206
|
})));
|
|
210
207
|
}
|
|
211
208
|
}
|
package/lib/Drawer/Drawer.js
CHANGED
|
@@ -9,6 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _defaultProps = require("./props/defaultProps");
|
|
10
10
|
var _propTypes = require("./props/propTypes");
|
|
11
11
|
var _FreezeLayer = _interopRequireDefault(require("../FreezeLayer/FreezeLayer"));
|
|
12
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
12
13
|
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
13
14
|
var _Card = require("@zohodesk/components/lib/Card");
|
|
14
15
|
var _FormAction = _interopRequireDefault(require("../FormAction/FormAction"));
|
|
@@ -221,7 +222,7 @@ var Drawer = /*#__PURE__*/function (_React$Component4) {
|
|
|
221
222
|
eleRef: this.createRef
|
|
222
223
|
}, /*#__PURE__*/_react["default"].createElement(_Card.Card, {
|
|
223
224
|
onClick: function onClick(e) {
|
|
224
|
-
|
|
225
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
225
226
|
onBodyClick(e);
|
|
226
227
|
}
|
|
227
228
|
}, childrenWithProps));
|
|
@@ -233,7 +234,7 @@ var Drawer = /*#__PURE__*/function (_React$Component4) {
|
|
|
233
234
|
}, /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveSender, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
234
235
|
className: styleByResolutions,
|
|
235
236
|
onClick: function onClick(e) {
|
|
236
|
-
|
|
237
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
237
238
|
}
|
|
238
239
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
239
240
|
flexible: true
|
|
@@ -28,9 +28,11 @@ function useFreezeLayer(_ref) {
|
|
|
28
28
|
isChildActive = _useState4[0],
|
|
29
29
|
setChildActive = _useState4[1];
|
|
30
30
|
var isFreezeLayerEnabled = (0, _react.useRef)(false);
|
|
31
|
-
function handleClick() {
|
|
31
|
+
function handleClick(e) {
|
|
32
32
|
if (onClick && !(0, _Common.isTextSelected)()) {
|
|
33
|
-
onClick();
|
|
33
|
+
onClick(e);
|
|
34
|
+
} else {
|
|
35
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
function enableFreeze() {
|
package/lib/Link/Link.js
CHANGED
|
@@ -8,6 +8,7 @@ exports["default"] = void 0;
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _defaultProps = require("./props/defaultProps");
|
|
10
10
|
var _propTypes = require("./props/propTypes");
|
|
11
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
11
12
|
var _LinkModule = _interopRequireDefault(require("./Link.module.css"));
|
|
12
13
|
var _LinkContext = _interopRequireDefault(require("./LinkContext"));
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -43,14 +44,14 @@ var Link = /*#__PURE__*/function (_React$Component) {
|
|
|
43
44
|
target = _this$props.target;
|
|
44
45
|
var onCallBack = this.context.options.onCallBack;
|
|
45
46
|
if (e && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
|
|
46
|
-
|
|
47
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
onClick && onClick(e);
|
|
50
51
|
if (!hasReload && target != '_blank') {
|
|
51
52
|
e && e.preventDefault();
|
|
52
53
|
}
|
|
53
|
-
|
|
54
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
54
55
|
!onClick && onCallBack && onCallBack(urlOutput, href, e);
|
|
55
56
|
}
|
|
56
57
|
}, {
|
|
@@ -8,6 +8,7 @@ exports["default"] = ToastMessage;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _defaultProps = require("./props/defaultProps");
|
|
10
10
|
var _propTypes = require("./props/propTypes");
|
|
11
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
11
12
|
var _icons = require("@zohodesk/icons");
|
|
12
13
|
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
13
14
|
var _ZindexProvider = require("@zohodesk/components/lib/Provider/ZindexProvider");
|
|
@@ -25,10 +26,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
25
26
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
27
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
|
-
function removeClose(e) {
|
|
29
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
30
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
31
|
-
}
|
|
32
29
|
function ToastMessageUI(props) {
|
|
33
30
|
var _useState = (0, _react.useState)(props.messageState),
|
|
34
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -69,7 +66,7 @@ function ToastMessageUI(props) {
|
|
|
69
66
|
onClose && onClose();
|
|
70
67
|
}
|
|
71
68
|
function changeMessageState(e) {
|
|
72
|
-
|
|
69
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
73
70
|
setMessageState(!messageState);
|
|
74
71
|
}
|
|
75
72
|
var animateClass = isClose ? _ToastMessageModule["default"].rightanimate : _ToastMessageModule["default"].leftanimate;
|
package/lib/actions/AutoClose.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports["default"] = AutoClose;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
9
10
|
var _defaultProps = require("./props/defaultProps");
|
|
10
11
|
var _propTypes = require("./props/propTypes");
|
|
11
12
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -16,10 +17,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
16
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
18
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
18
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
function removeClose(e) {
|
|
20
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
21
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
22
|
-
}
|
|
23
20
|
function AutoClose(props) {
|
|
24
21
|
var Element = props.Element,
|
|
25
22
|
givenClose = props.isClose,
|
|
@@ -31,7 +28,7 @@ function AutoClose(props) {
|
|
|
31
28
|
isClose = _useState2[0],
|
|
32
29
|
setClose = _useState2[1];
|
|
33
30
|
function onClose(e) {
|
|
34
|
-
|
|
31
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
35
32
|
onPortalClose && onPortalClose();
|
|
36
33
|
}
|
|
37
34
|
(0, _react.useEffect)(function () {
|
|
@@ -569,7 +569,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
569
569
|
palette = _this$props12.palette,
|
|
570
570
|
getFooter = _this$props12.getFooter,
|
|
571
571
|
customProps = _this$props12.customProps,
|
|
572
|
-
needMultiLineText = _this$props12.needMultiLineText
|
|
572
|
+
needMultiLineText = _this$props12.needMultiLineText,
|
|
573
|
+
customClass = _this$props12.customClass;
|
|
573
574
|
var _customProps$ToggleDr = customProps.ToggleDropDownProps,
|
|
574
575
|
ToggleDropDownProps = _customProps$ToggleDr === void 0 ? {} : _customProps$ToggleDr,
|
|
575
576
|
_customProps$DropBoxP = customProps.DropBoxProps,
|
|
@@ -580,6 +581,10 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
580
581
|
ListItemWithIconProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
|
|
581
582
|
_customProps$ListItem2 = customProps.ListItemProps,
|
|
582
583
|
ListItemProps = _customProps$ListItem2 === void 0 ? {} : _customProps$ListItem2;
|
|
584
|
+
var _customClass$customDr = customClass.customDropBox,
|
|
585
|
+
customDropBox = _customClass$customDr === void 0 ? '' : _customClass$customDr,
|
|
586
|
+
_customClass$customLi = customClass.customListBox,
|
|
587
|
+
customListBox = _customClass$customLi === void 0 ? '' : _customClass$customLi;
|
|
583
588
|
var isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
|
|
584
589
|
var Component = isToggleStateNeeded ? children.type : null,
|
|
585
590
|
componentProps = isToggleStateNeeded ? children.props : null;
|
|
@@ -661,7 +666,8 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
661
666
|
isAnimate: true,
|
|
662
667
|
getRef: getContainerRef,
|
|
663
668
|
customClass: {
|
|
664
|
-
customDropBoxWrap: _ToggleDropDownModule["default"].dropBoxContainer
|
|
669
|
+
customDropBoxWrap: _ToggleDropDownModule["default"].dropBoxContainer,
|
|
670
|
+
customDropBox: customDropBox
|
|
665
671
|
},
|
|
666
672
|
needResponsive: needResponsive,
|
|
667
673
|
isPadding: isPadding,
|
|
@@ -707,7 +713,7 @@ var ToggleDropDown = /*#__PURE__*/function (_Component) {
|
|
|
707
713
|
scroll: "vertical",
|
|
708
714
|
preventParentScroll: "vertical",
|
|
709
715
|
dataId: "".concat(dataId, "_list"),
|
|
710
|
-
className: "".concat(tabletMode ? _ToggleDropDownModule["default"].responsivemaxHgt : _ToggleDropDownModule["default"].maxHgt),
|
|
716
|
+
className: "".concat(tabletMode ? _ToggleDropDownModule["default"].responsivemaxHgt : _ToggleDropDownModule["default"].maxHgt, " ").concat(customListBox),
|
|
711
717
|
eleRef: _this6.scrollContentRef,
|
|
712
718
|
onScroll: _this6.handleScroll,
|
|
713
719
|
role: isSearch ? 'listbox' : undefined,
|
|
@@ -75,6 +75,10 @@ var propTypes = {
|
|
|
75
75
|
ListItemProps: _propTypes["default"].object
|
|
76
76
|
}),
|
|
77
77
|
preventPopupClose: _propTypes["default"].bool,
|
|
78
|
-
needMultiLineText: _propTypes["default"].bool
|
|
78
|
+
needMultiLineText: _propTypes["default"].bool,
|
|
79
|
+
customClass: _propTypes["default"].shape({
|
|
80
|
+
customDropBox: _propTypes["default"].string,
|
|
81
|
+
customListBox: _propTypes["default"].string
|
|
82
|
+
})
|
|
79
83
|
};
|
|
80
84
|
exports.propTypes = propTypes;
|
|
@@ -102,7 +102,7 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
102
102
|
role: role,
|
|
103
103
|
"aria-selected": ariaSelected,
|
|
104
104
|
isCover: false,
|
|
105
|
-
align: "
|
|
105
|
+
align: "baseline",
|
|
106
106
|
alignBox: "row",
|
|
107
107
|
className: "".concat(_StatusListItemModule["default"].list, " ").concat(_StatusListItemModule["default"][size], " ").concat(_StatusListItemModule["default"][palette], " ").concat(active ? _StatusListItemModule["default"].active : highlight && !isDisabled ? _StatusListItemModule["default"].hover : '', " ").concat(autoHover && !isDisabled ? _StatusListItemModule["default"].effect : '', " ").concat(needTick ? _StatusListItemModule["default"].withTick : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? _StatusListItemModule["default"].withBorder : ''),
|
|
108
108
|
dataId: String(value).replace("'", '_'),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
font-size: var(--zd_font_size13);
|
|
4
4
|
position: relative;
|
|
5
5
|
list-style: none;
|
|
6
|
+
min-height: var(--zd_size35);
|
|
6
7
|
cursor: pointer;
|
|
7
8
|
}
|
|
8
9
|
[dir=ltr] .withBorder {
|
|
@@ -12,13 +13,13 @@
|
|
|
12
13
|
border-right: 1px solid var(--zdt_statuslistitem_default_border);
|
|
13
14
|
}
|
|
14
15
|
[dir=ltr] .small {
|
|
15
|
-
padding: var(--
|
|
16
|
+
padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
|
|
16
17
|
}
|
|
17
18
|
[dir=rtl] .small {
|
|
18
|
-
padding: var(--
|
|
19
|
+
padding: var(--zd_size7) var(--zd_size5) var(--zd_size7) var(--zd_size3);
|
|
19
20
|
}
|
|
20
21
|
.medium {
|
|
21
|
-
padding: var(--
|
|
22
|
+
padding: var(--zd_size7) var(--zd_size20);
|
|
22
23
|
}
|
|
23
24
|
.large {
|
|
24
25
|
height: var(--zd_size48);
|
|
@@ -29,13 +30,14 @@
|
|
|
29
30
|
[dir=rtl] .large {
|
|
30
31
|
padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
+
.value,.multiLineValue {
|
|
34
|
+
line-height: var(--zd_size20);
|
|
35
|
+
}
|
|
33
36
|
.value {
|
|
34
37
|
composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
|
|
35
38
|
}
|
|
36
39
|
.multiLineValue{
|
|
37
40
|
word-break: break-word;
|
|
38
|
-
line-height: var(--zd_size18);
|
|
39
41
|
composes: clamp from '~@zohodesk/components/lib/common/common.module.css';
|
|
40
42
|
}
|
|
41
43
|
[dir=ltr] .withBorder.active {
|
|
@@ -13,6 +13,7 @@ var _Layout = require("@zohodesk/components/lib/Layout");
|
|
|
13
13
|
var _icons = require("@zohodesk/icons");
|
|
14
14
|
var _ToggleDropDown = _interopRequireDefault(require("../../../dropdown/ToggleDropDown/ToggleDropDown"));
|
|
15
15
|
var _debounce = require("@zohodesk/components/lib/utils/debounce");
|
|
16
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
16
17
|
var _LookupSearchModule = _interopRequireDefault(require("./LookupSearch.module.css"));
|
|
17
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -135,12 +136,6 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
|
|
|
135
136
|
return _this2;
|
|
136
137
|
}
|
|
137
138
|
_createClass(SearchUI, [{
|
|
138
|
-
key: "cancelBubblingEffect",
|
|
139
|
-
value: function cancelBubblingEffect(e) {
|
|
140
|
-
e && e.stopPropagation && e.stopPropagation();
|
|
141
|
-
e && e.nativeEvent && e.nativeEvent.stopImmediatePropagation && e.nativeEvent.stopImmediatePropagation();
|
|
142
|
-
}
|
|
143
|
-
}, {
|
|
144
139
|
key: "handleSearch",
|
|
145
140
|
value: function handleSearch() {
|
|
146
141
|
var onSearch = this.props.onSearch;
|
|
@@ -172,7 +167,7 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
|
|
|
172
167
|
key: "handleClear",
|
|
173
168
|
value: function handleClear(e) {
|
|
174
169
|
var onChange = this.props.onChange;
|
|
175
|
-
|
|
170
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
176
171
|
onChange && onChange('');
|
|
177
172
|
this.handleSearch();
|
|
178
173
|
}
|
|
@@ -229,16 +224,16 @@ var SearchUI = /*#__PURE__*/function (_Component2) {
|
|
|
229
224
|
placeHolder: placeHolder,
|
|
230
225
|
value: searchStr,
|
|
231
226
|
onChange: this.handleChange,
|
|
232
|
-
onClick:
|
|
227
|
+
onClick: _Common.cancelBubblingEffect,
|
|
233
228
|
onFocus: onFocus,
|
|
234
229
|
onBlur: onBlur,
|
|
235
230
|
onKeyDown: this.handleKeyDown,
|
|
236
|
-
onMouseDown:
|
|
231
|
+
onMouseDown: _Common.cancelBubblingEffect,
|
|
237
232
|
dataId: dataId,
|
|
238
233
|
size: "small",
|
|
239
234
|
inputRef: getRef,
|
|
240
235
|
onClear: this.handleClear,
|
|
241
|
-
onClearMouseDown:
|
|
236
|
+
onClearMouseDown: _Common.cancelBubblingEffect
|
|
242
237
|
})));
|
|
243
238
|
}
|
|
244
239
|
}]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.253",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"LIBRARY"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"clean": "react-cli clean lib es coverage",
|
|
20
|
+
"clean": "react-cli clean lib es coverage assets && mkdir assets",
|
|
21
21
|
"dubCheck": "node dubFinder node_modules/@zohodesk/components/lib node_modules/@zohodesk/icons/lib node_modules/@zohodesk/variables/lib",
|
|
22
22
|
"build": "react-cli build:component:cmjs",
|
|
23
23
|
"buildlocal": " react-cli build:component:cmjs && npm run rtl",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"velocity-react": "1.4.3",
|
|
45
45
|
"@zohodesk/variables": "1.0.0-beta.30",
|
|
46
46
|
"@zohodesk/i18n": "1.0.0-beta.7",
|
|
47
|
-
"@zohodesk/components": "1.0.0-alpha-
|
|
47
|
+
"@zohodesk/components": "1.0.0-alpha-265",
|
|
48
48
|
"@zohodesk/icons": "1.0.0-beta.119",
|
|
49
49
|
"@zohodesk/svg": "1.0.0-beta.54",
|
|
50
50
|
"@zohodesk/virtualizer": "1.0.3",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"velocity-react": "1.4.3",
|
|
56
56
|
"@zohodesk/variables": "1.0.0-beta.30",
|
|
57
57
|
"@zohodesk/i18n": "1.0.0-beta.7",
|
|
58
|
-
"@zohodesk/components": "1.0.0-alpha-
|
|
58
|
+
"@zohodesk/components": "1.0.0-alpha-265",
|
|
59
59
|
"@zohodesk/icons": "1.0.0-beta.119",
|
|
60
60
|
"@zohodesk/svg": "1.0.0-beta.54",
|
|
61
61
|
"@zohodesk/virtualizer": "1.0.3",
|