@zohodesk/components 1.0.0-temp-47 → 1.0.0-temp-50
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 +24 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -0
- package/assets/Appearance/default/mode/defaultMode.module.css +2 -0
- package/es/Animation/Animation.js +7 -8
- package/es/Avatar/Avatar.js +13 -12
- package/es/Avatar/__tests__/Avatar.spec.js +0 -1
- package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -1
- package/es/Button/Button.js +15 -16
- package/es/Button/Button.module.css +6 -2
- package/es/Button/__tests__/Button.spec.js +0 -1
- package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -1
- package/es/Card/Card.js +4 -5
- package/es/DateTime/DateTime.js +6 -3
- package/es/DateTime/DateWidget.js +5 -2
- package/es/DateTime/YearView.js +6 -5
- package/es/DateTime/common.js +9 -2
- package/es/DateTime/dateFormatUtils/dateFormat.js +76 -57
- package/es/DateTime/dateFormatUtils/index.js +12 -7
- package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
- package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
- package/es/DateTime/validator.js +0 -1
- package/es/DropBox/DropBox.js +2 -2
- package/es/Label/__tests__/Label.spec.js +0 -2
- package/es/Layout/utils.js +2 -1
- package/es/ListItem/ListContainer.js +3 -8
- package/es/ListItem/ListItem.js +58 -39
- package/es/ListItem/ListItem.module.css +11 -0
- package/es/ListItem/ListItemWithAvatar.js +74 -53
- package/es/ListItem/ListItemWithCheckBox.js +54 -33
- package/es/ListItem/ListItemWithIcon.js +66 -47
- package/es/ListItem/ListItemWithRadio.js +55 -34
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
- package/es/MultiSelect/AdvancedMultiSelect.js +20 -7
- package/es/MultiSelect/MultiSelect.js +24 -8
- package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
- package/es/PopOver/PopOver.js +19 -20
- package/es/Popup/Popup.js +15 -9
- package/es/Popup/viewPort.js +14 -9
- package/es/Provider/IdProvider.js +5 -4
- package/es/Provider/LibraryContext.js +6 -5
- package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
- package/es/Provider/ZindexProvider.js +5 -4
- package/es/Responsive/CustomResponsive.js +11 -8
- package/es/Responsive/ResizeComponent.js +3 -1
- package/es/Responsive/Responsive.js +12 -9
- package/es/Responsive/sizeObservers.js +13 -2
- package/es/Ribbon/Ribbon.js +8 -8
- package/es/Ribbon/__tests__/Ribbon.spec.js +0 -1
- package/es/Select/GroupSelect.js +3 -2
- package/es/Select/Select.js +3 -2
- package/es/Select/SelectWithAvatar.js +1 -1
- package/es/Select/SelectWithIcon.js +1 -1
- package/es/Stencils/Stencils.js +5 -6
- package/es/Stencils/__tests__/Stencils.spec.js +0 -1
- package/es/Tab/Tab.js +27 -26
- package/es/Tab/TabContent.js +17 -14
- package/es/Tab/TabContentWrapper.js +17 -14
- package/es/Tab/TabWrapper.js +15 -14
- package/es/Tab/Tabs.js +2 -1
- package/es/TextBox/__tests__/TextBox.spec.js +0 -1
- package/es/TextBoxIcon/TextBoxIcon.js +1 -1
- package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -1
- package/es/Textarea/__tests__/Textarea.spec.js +0 -1
- package/es/Tooltip/Tooltip.js +0 -1
- package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
- package/es/a11y/FocusScope/FocusScope.js +10 -4
- package/es/beta/FocusRing/FocusRing.js +4 -1
- package/es/utils/Common.js +31 -11
- package/es/utils/datetime/common.js +6 -3
- package/es/utils/dropDownUtils.js +45 -6
- package/es/utils/getInitial.js +3 -1
- package/lib/Accordion/Accordion.js +3 -3
- package/lib/Accordion/AccordionItem.js +3 -3
- package/lib/Animation/Animation.js +10 -11
- package/lib/AppContainer/AppContainer.js +3 -3
- package/lib/Avatar/Avatar.js +14 -14
- package/lib/AvatarTeam/AvatarTeam.js +3 -3
- package/lib/Button/Button.js +18 -19
- package/lib/Button/Button.module.css +6 -2
- package/lib/Buttongroup/Buttongroup.js +3 -3
- package/lib/Card/Card.js +8 -9
- package/lib/Card/__tests__/Card.spec.js +1 -1
- package/lib/Card/index.js +7 -7
- package/lib/CheckBox/CheckBox.js +3 -3
- package/lib/DateTime/CalendarView.js +4 -4
- package/lib/DateTime/DateTime.js +3 -3
- package/lib/DateTime/DateTimePopupFooter.js +3 -3
- package/lib/DateTime/DateTimePopupHeader.js +3 -3
- package/lib/DateTime/DateWidget.js +3 -3
- package/lib/DateTime/DaysRow.js +3 -3
- package/lib/DateTime/Time.js +3 -3
- package/lib/DateTime/YearView.js +3 -3
- package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
- package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
- package/lib/DateTime/constants.js +1 -1
- package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
- package/lib/DateTime/dateFormatUtils/index.js +13 -13
- package/lib/DateTime/objectUtils.js +2 -2
- package/lib/DropBox/DropBox.js +9 -5
- package/lib/DropDown/DropDown.js +4 -4
- package/lib/DropDown/DropDownHeading.js +3 -3
- package/lib/DropDown/DropDownItem.js +3 -3
- package/lib/DropDown/DropDownSearch.js +3 -3
- package/lib/DropDown/DropDownSeparator.js +3 -3
- package/lib/Label/Label.js +3 -3
- package/lib/Layout/Box.js +1 -1
- package/lib/Layout/Container.js +1 -1
- package/lib/Layout/index.js +4 -4
- package/lib/Layout/utils.js +2 -2
- package/lib/ListItem/ListContainer.js +3 -8
- package/lib/ListItem/ListItem.js +61 -40
- package/lib/ListItem/ListItem.module.css +11 -0
- package/lib/ListItem/ListItemWithAvatar.js +77 -56
- package/lib/ListItem/ListItemWithCheckBox.js +57 -36
- package/lib/ListItem/ListItemWithIcon.js +69 -48
- package/lib/ListItem/ListItemWithRadio.js +58 -37
- package/lib/Modal/Modal.js +3 -3
- package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -4
- package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
- package/lib/MultiSelect/EmptyState.js +3 -3
- package/lib/MultiSelect/MultiSelect.js +16 -7
- package/lib/MultiSelect/MultiSelectHeader.js +3 -3
- package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -4
- package/lib/MultiSelect/SelectedOptions.js +3 -3
- package/lib/MultiSelect/Suggestions.js +5 -5
- package/lib/PopOver/PopOver.js +23 -24
- package/lib/Popup/Popup.js +35 -32
- package/lib/Popup/__tests__/Popup.spec.js +3 -3
- package/lib/Provider/IdProvider.js +3 -3
- package/lib/Provider/LibraryContext.js +3 -3
- package/lib/Provider/NumberGenerator/NumberGenerator.js +2 -2
- package/lib/Provider/ZindexProvider.js +1 -1
- package/lib/Provider.js +3 -3
- package/lib/Radio/Radio.js +3 -3
- package/lib/Responsive/CustomResponsive.js +4 -4
- package/lib/Responsive/RefWrapper.js +1 -1
- package/lib/Responsive/ResizeComponent.js +3 -3
- package/lib/Responsive/ResizeObserver.js +1 -1
- package/lib/Responsive/Responsive.js +6 -5
- package/lib/Responsive/sizeObservers.js +14 -6
- package/lib/Responsive/utils/index.js +3 -2
- package/lib/Responsive/utils/shallowCompare.js +1 -1
- package/lib/Ribbon/Ribbon.js +11 -11
- package/lib/Select/GroupSelect.js +4 -4
- package/lib/Select/Select.js +4 -4
- package/lib/Select/SelectWithAvatar.js +4 -4
- package/lib/Select/SelectWithIcon.js +4 -4
- package/lib/Stencils/Stencils.js +8 -9
- package/lib/Switch/Switch.js +3 -3
- package/lib/Tab/Tab.js +1 -1
- package/lib/Tab/TabWrapper.js +1 -1
- package/lib/Tab/Tabs.js +3 -3
- package/lib/Tab/index.js +10 -10
- package/lib/Tag/Tag.js +3 -3
- package/lib/TextBox/TextBox.js +3 -3
- package/lib/TextBoxIcon/TextBoxIcon.js +4 -4
- package/lib/Textarea/Textarea.js +3 -3
- package/lib/Tooltip/Tooltip.js +3 -3
- package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
- package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +8 -6
- package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +8 -6
- package/lib/a11y/FocusScope/FocusScope.js +2 -2
- package/lib/beta/FocusRing/FocusRing.js +3 -3
- package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
- package/lib/index.js +310 -310
- package/lib/semantic/Button/Button.js +3 -3
- package/lib/utils/Common.js +20 -16
- package/lib/utils/datetime/common.js +10 -10
- package/lib/utils/dropDownUtils.js +46 -3
- package/lib/utils/shallowEqual.js +1 -1
- package/package.json +4 -4
|
@@ -25,7 +25,14 @@ function rangeCheck(minValue, maxValue, screenValue) {
|
|
|
25
25
|
return minValue <= screenValue && maxValue >= screenValue;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function isTouchDeviceFunc() {
|
|
29
|
+
// return window.matchMedia("(pointer: coarse)").matches
|
|
30
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
31
|
+
} // export const isTouchDevice =
|
|
32
|
+
// 'ontouchstart' in window && navigator.userAgent.match(/mobi/i) ? true : false;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export const isTouchDevice = isTouchDeviceFunc();
|
|
29
36
|
export function isBreackPointMatched(object, screen) {
|
|
30
37
|
if (!isValideBreakPoint(object)) {
|
|
31
38
|
// eslint-disable-next-line no-console
|
|
@@ -68,7 +75,11 @@ export class Subscribale {
|
|
|
68
75
|
this.subscribers.length && this.disconnect();
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
dispatch(
|
|
78
|
+
dispatch() {
|
|
79
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
80
|
+
args[_key] = arguments[_key];
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
this.subscribers.forEach(subscriber => {
|
|
73
84
|
subscriber(...args);
|
|
74
85
|
});
|
package/es/Ribbon/Ribbon.js
CHANGED
|
@@ -38,14 +38,14 @@ Ribbon.propTypes = {
|
|
|
38
38
|
text: PropTypes.string,
|
|
39
39
|
type: PropTypes.oneOf(['default', 'flag', 'plain', 'ribbon', 'box', 'stamp', 'sticker', 'tag']),
|
|
40
40
|
customClass: PropTypes.string
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
}; // Ribbon.propTypesDescription = {
|
|
42
|
+
// text: ' ',
|
|
43
|
+
// type: ' ',
|
|
44
|
+
// children: ' ',
|
|
45
|
+
// palette: ' ',
|
|
46
|
+
// size: ' '
|
|
47
|
+
// };
|
|
48
|
+
|
|
49
49
|
Ribbon.defaultProps = {
|
|
50
50
|
palette: 'default',
|
|
51
51
|
size: 'large',
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -489,7 +489,8 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
handleFetchOptions(APICall
|
|
492
|
+
handleFetchOptions(APICall) {
|
|
493
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
493
494
|
// let funcArgs = args.slice(1, args.length);
|
|
494
495
|
let {
|
|
495
496
|
isFetchingOptions = false
|
|
@@ -598,7 +599,7 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
598
599
|
return /*#__PURE__*/React.createElement("div", {
|
|
599
600
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
600
601
|
"data-id": dataIdSlctComp,
|
|
601
|
-
"data-title": isDisabled ? title :
|
|
602
|
+
"data-title": isDisabled ? title : null
|
|
602
603
|
}, /*#__PURE__*/React.createElement("div", {
|
|
603
604
|
className: `${className ? className : ''}`,
|
|
604
605
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
package/es/Select/Select.js
CHANGED
|
@@ -455,7 +455,8 @@ export class SelectComponent extends Component {
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
-
handleFetchOptions(APICall
|
|
458
|
+
handleFetchOptions(APICall) {
|
|
459
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
459
460
|
// let funcArgs = args.slice(1, args.length);
|
|
460
461
|
let {
|
|
461
462
|
isFetchingOptions = false
|
|
@@ -742,7 +743,7 @@ export class SelectComponent extends Component {
|
|
|
742
743
|
} = customProps;
|
|
743
744
|
return /*#__PURE__*/React.createElement("div", {
|
|
744
745
|
className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
745
|
-
"data-title": isDisabled ? title :
|
|
746
|
+
"data-title": isDisabled ? title : null
|
|
746
747
|
}, /*#__PURE__*/React.createElement("div", {
|
|
747
748
|
className: `${className ? className : ''}`,
|
|
748
749
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
|
@@ -167,7 +167,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
167
167
|
return /*#__PURE__*/React.createElement("div", {
|
|
168
168
|
className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''} ${className ? className : ''}`,
|
|
169
169
|
"data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
|
|
170
|
-
"data-title": isDisabled ? title :
|
|
170
|
+
"data-title": isDisabled ? title : null
|
|
171
171
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
172
172
|
align: "vertical",
|
|
173
173
|
alignBox: "row",
|
|
@@ -289,7 +289,7 @@ class SelectWithIcon extends Component {
|
|
|
289
289
|
let ariaErrorId = this.getNextAriaId();
|
|
290
290
|
return /*#__PURE__*/React.createElement("div", {
|
|
291
291
|
className: `${style.container} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''}`,
|
|
292
|
-
"data-title": isDisabled ? title :
|
|
292
|
+
"data-title": isDisabled ? title : null
|
|
293
293
|
}, /*#__PURE__*/React.createElement("div", {
|
|
294
294
|
className: `${className ? className : ''}`,
|
|
295
295
|
onClick: isDisabled || isReadOnly ? null : this.togglePopup,
|
package/es/Stencils/Stencils.js
CHANGED
|
@@ -30,12 +30,11 @@ Stencils.defaultProps = {
|
|
|
30
30
|
shape: 'rect',
|
|
31
31
|
size: 'medium',
|
|
32
32
|
customClass: ''
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
33
|
+
}; // Stencils.propTypesDescription = {
|
|
34
|
+
// shape: ' ',
|
|
35
|
+
// size: ' ',
|
|
36
|
+
// palette: ' '
|
|
37
|
+
// };
|
|
39
38
|
|
|
40
39
|
if (false) {
|
|
41
40
|
Stencils.docs = {
|
package/es/Tab/Tab.js
CHANGED
|
@@ -22,32 +22,33 @@ const tabTypes = {
|
|
|
22
22
|
tab: 'tabDelta'
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
export default function Tab({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
25
|
+
export default function Tab(_ref) {
|
|
26
|
+
let {
|
|
27
|
+
id,
|
|
28
|
+
style,
|
|
29
|
+
text,
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
dataId,
|
|
33
|
+
title,
|
|
34
|
+
titlePosition,
|
|
35
|
+
activeClass,
|
|
36
|
+
href,
|
|
37
|
+
isLink,
|
|
38
|
+
isDisabled,
|
|
39
|
+
tourId,
|
|
40
|
+
onClick,
|
|
41
|
+
isActive,
|
|
42
|
+
getTabRef,
|
|
43
|
+
onSelect,
|
|
44
|
+
type,
|
|
45
|
+
isAnimate,
|
|
46
|
+
needBorder,
|
|
47
|
+
needAppearance,
|
|
48
|
+
align,
|
|
49
|
+
isVirtual,
|
|
50
|
+
customProps
|
|
51
|
+
} = _ref;
|
|
51
52
|
let clickListener = useCallback(event => {
|
|
52
53
|
if (isLink && event && (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)) {
|
|
53
54
|
event && event.stopPropagation();
|
package/es/Tab/TabContent.js
CHANGED
|
@@ -4,20 +4,23 @@ import { Container } from '../Layout';
|
|
|
4
4
|
import style from './TabContent.module.css';
|
|
5
5
|
/* eslint-disable react/forbid-component-props */
|
|
6
6
|
|
|
7
|
-
const TabContent =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const TabContent = _ref => {
|
|
8
|
+
let {
|
|
9
|
+
children,
|
|
10
|
+
scroll,
|
|
11
|
+
dataId,
|
|
12
|
+
id
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
15
|
+
className: style.container,
|
|
16
|
+
scroll: scroll,
|
|
17
|
+
dataId: `${dataId}_TabContent`,
|
|
18
|
+
isScrollAttribute: true,
|
|
19
|
+
"aria-labelledby": id,
|
|
20
|
+
tabindex: "0",
|
|
21
|
+
role: "tabpanel"
|
|
22
|
+
}, children);
|
|
23
|
+
};
|
|
21
24
|
|
|
22
25
|
TabContent.defaultProps = {
|
|
23
26
|
dataId: 'tabContent'
|
|
@@ -3,20 +3,23 @@ import { PropTypes } from 'prop-types';
|
|
|
3
3
|
import { Box } from '../Layout';
|
|
4
4
|
/* eslint-disable react/forbid-component-props */
|
|
5
5
|
|
|
6
|
-
const TabContentWrapper =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
const TabContentWrapper = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
style,
|
|
9
|
+
className,
|
|
10
|
+
children,
|
|
11
|
+
dataId,
|
|
12
|
+
selectedTab,
|
|
13
|
+
onScroll
|
|
14
|
+
} = _ref;
|
|
15
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
16
|
+
flexible: true,
|
|
17
|
+
style: style,
|
|
18
|
+
dataId: dataId,
|
|
19
|
+
className: className,
|
|
20
|
+
onScroll: onScroll
|
|
21
|
+
}, React.Children.map(children, child => /*#__PURE__*/React.isValidElement(child) && child.props.id === selectedTab ? child : null));
|
|
22
|
+
};
|
|
20
23
|
|
|
21
24
|
TabContentWrapper.defaultProps = {
|
|
22
25
|
children: []
|
package/es/Tab/TabWrapper.js
CHANGED
|
@@ -4,20 +4,21 @@ import React, { useState, useCallback } from 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { Container } from '../Layout';
|
|
6
6
|
|
|
7
|
-
function TabWrapper({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
function TabWrapper(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
defaultTab,
|
|
10
|
+
hookToDisableInternalState,
|
|
11
|
+
onSelect,
|
|
12
|
+
type,
|
|
13
|
+
isAnimate,
|
|
14
|
+
needTabBorder,
|
|
15
|
+
needBorder,
|
|
16
|
+
needPadding,
|
|
17
|
+
needAppearance,
|
|
18
|
+
align,
|
|
19
|
+
dataId,
|
|
20
|
+
children
|
|
21
|
+
} = _ref;
|
|
21
22
|
let [selectedTabInternal, setSelected] = useState(!hookToDisableInternalState ? defaultTab || 0 : null);
|
|
22
23
|
const setSelectedTab = useCallback(id => {
|
|
23
24
|
if (!hookToDisableInternalState) {
|
package/es/Tab/Tabs.js
CHANGED
|
@@ -95,7 +95,8 @@ class Tabs extends React.Component {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
setMaxDim(
|
|
98
|
+
setMaxDim() {
|
|
99
|
+
let totalDimension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
99
100
|
let {
|
|
100
101
|
selectedTab
|
|
101
102
|
} = this.props; // let actual = Object.keys(tabDimensions).reduce(
|
|
@@ -101,7 +101,7 @@ export default class TextBoxIcon extends React.Component {
|
|
|
101
101
|
alignBox: "row",
|
|
102
102
|
isCover: false,
|
|
103
103
|
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? needEffect ? style.effect : style.readonly : style.effect} ${isActive || isFocus ? style.effectFocused : ''} ${customTBoxWrap} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
|
|
104
|
-
"data-title": isDisabled ? title :
|
|
104
|
+
"data-title": isDisabled ? title : null
|
|
105
105
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
106
106
|
flexible: true
|
|
107
107
|
}, /*#__PURE__*/React.createElement(TextBox, _extends({}, this.props, {
|
package/es/Tooltip/Tooltip.js
CHANGED
|
@@ -41,7 +41,7 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
41
41
|
let {
|
|
42
42
|
direction,
|
|
43
43
|
isReducedMotion
|
|
44
|
-
} = this.context;
|
|
44
|
+
} = this.context || {};
|
|
45
45
|
let childProps = clearProps(this.props);
|
|
46
46
|
let enterAnimationObj = {
|
|
47
47
|
fade: 'transition.fadeIn',
|
|
@@ -225,7 +225,9 @@ function useFocusContainment(scopeRef, contain) {
|
|
|
225
225
|
}, [raf]);
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
function isElementInAnyScope(element
|
|
228
|
+
function isElementInAnyScope(element) {
|
|
229
|
+
let scopes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
230
|
+
|
|
229
231
|
for (let scope of scopes.values()) {
|
|
230
232
|
if (isElementInScope(element, scope.current)) {
|
|
231
233
|
return true;
|
|
@@ -235,11 +237,14 @@ function isElementInAnyScope(element, scopes = []) {
|
|
|
235
237
|
return false;
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
function isElementInScope(element
|
|
240
|
+
function isElementInScope(element) {
|
|
241
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
239
242
|
return scope.some(node => node.contains(element));
|
|
240
243
|
}
|
|
241
244
|
|
|
242
|
-
function focusElement(
|
|
245
|
+
function focusElement() {
|
|
246
|
+
let element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
247
|
+
|
|
243
248
|
if (element != null) {
|
|
244
249
|
element.focus();
|
|
245
250
|
}
|
|
@@ -259,7 +264,8 @@ function findElement(elements) {
|
|
|
259
264
|
return ele.length ? ele[0] : null;
|
|
260
265
|
}
|
|
261
266
|
|
|
262
|
-
function focusFirstInScope(
|
|
267
|
+
function focusFirstInScope() {
|
|
268
|
+
let scope = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
263
269
|
let elements = getFocusableElementsInScope(scope, {
|
|
264
270
|
tabbable: true
|
|
265
271
|
});
|
|
@@ -16,7 +16,10 @@ const FOCUS_VISIBLE_INPUT_KEYS = {
|
|
|
16
16
|
Escape: false
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
function triggerChangeHandlers(
|
|
19
|
+
function triggerChangeHandlers() {
|
|
20
|
+
let evType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : eventFrom;
|
|
21
|
+
let e = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : eventType;
|
|
22
|
+
|
|
20
23
|
for (let handler of changeHandlers) {
|
|
21
24
|
handler(evType, e);
|
|
22
25
|
}
|
package/es/utils/Common.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/es.string.replace";
|
|
2
1
|
//$Id$//
|
|
3
2
|
import viewPort from '../Popup/viewPort';
|
|
4
3
|
const {
|
|
@@ -39,11 +38,14 @@ export function encodeForHtml(str) {
|
|
|
39
38
|
|
|
40
39
|
return str;
|
|
41
40
|
}
|
|
42
|
-
export function getListOfDetails(
|
|
41
|
+
export function getListOfDetails() {
|
|
42
|
+
let Obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
43
|
+
let fn = arguments.length > 1 ? arguments[1] : undefined;
|
|
43
44
|
const ids = Object.keys(Obj) || [];
|
|
44
45
|
return ids.map(id => fn(Obj[id]));
|
|
45
46
|
}
|
|
46
|
-
export function capitalize(
|
|
47
|
+
export function capitalize() {
|
|
48
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
47
49
|
let newValue = '';
|
|
48
50
|
|
|
49
51
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -56,12 +58,18 @@ export function capitalize(value = '') {
|
|
|
56
58
|
|
|
57
59
|
return newValue;
|
|
58
60
|
}
|
|
59
|
-
export function bind(
|
|
61
|
+
export function bind() {
|
|
62
|
+
for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
63
|
+
handlers[_key] = arguments[_key];
|
|
64
|
+
}
|
|
65
|
+
|
|
60
66
|
handlers.forEach(handler => {
|
|
61
67
|
this[handler] = this[handler].bind(this);
|
|
62
68
|
});
|
|
63
69
|
}
|
|
64
|
-
export function getFullName(
|
|
70
|
+
export function getFullName() {
|
|
71
|
+
let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
72
|
+
let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
65
73
|
let fullName = '';
|
|
66
74
|
|
|
67
75
|
if (firstName !== null && firstName !== '') {
|
|
@@ -74,7 +82,8 @@ export function getFullName(firstName = '', lastName = '') {
|
|
|
74
82
|
|
|
75
83
|
return fullName;
|
|
76
84
|
}
|
|
77
|
-
export function getStringifiedOutputForJson(
|
|
85
|
+
export function getStringifiedOutputForJson() {
|
|
86
|
+
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
78
87
|
const keys = Object.keys(input);
|
|
79
88
|
const modifiedInput = keys.reduce((curr, next) => {
|
|
80
89
|
const values = input[next] || [];
|
|
@@ -110,14 +119,19 @@ export function filterValue(obj, val) {
|
|
|
110
119
|
});
|
|
111
120
|
return result;
|
|
112
121
|
}
|
|
113
|
-
export function merge(
|
|
122
|
+
export function merge() {
|
|
123
|
+
let oldObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
124
|
+
let newObj = arguments.length > 1 ? arguments[1] : undefined;
|
|
114
125
|
const copyOfOld = Object.assign({}, oldObj);
|
|
115
126
|
return Object.keys(newObj).reduce((res, key) => {
|
|
116
127
|
res[key] = Object.assign({}, res[key] || {}, newObj[key]);
|
|
117
128
|
return res;
|
|
118
129
|
}, copyOfOld);
|
|
119
130
|
}
|
|
120
|
-
export function formatValue(
|
|
131
|
+
export function formatValue() {
|
|
132
|
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
133
|
+
let valueField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
|
|
134
|
+
let textField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'name';
|
|
121
135
|
return values && values.map(value => {
|
|
122
136
|
let formattedValue = value;
|
|
123
137
|
|
|
@@ -141,7 +155,8 @@ export function bytesToSize(bytes) {
|
|
|
141
155
|
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
|
142
156
|
return `${Math.round(bytes / Math.pow(1024, i), 2)} ${sizes[i]}`;
|
|
143
157
|
}
|
|
144
|
-
export function getMemSize(bytes
|
|
158
|
+
export function getMemSize(bytes) {
|
|
159
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
145
160
|
const thresh = size ? 1000 : 1024;
|
|
146
161
|
|
|
147
162
|
if (Math.abs(bytes) < thresh) {
|
|
@@ -274,7 +289,11 @@ export const debounce = function (func, wait) {
|
|
|
274
289
|
};
|
|
275
290
|
};
|
|
276
291
|
let timerId;
|
|
277
|
-
export const throttle = (func, wait
|
|
292
|
+
export const throttle = function (func, wait) {
|
|
293
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
294
|
+
args[_key2 - 2] = arguments[_key2];
|
|
295
|
+
}
|
|
296
|
+
|
|
278
297
|
if (timerId) {
|
|
279
298
|
return;
|
|
280
299
|
}
|
|
@@ -344,6 +363,7 @@ export function getElementSpace(elementRef) {
|
|
|
344
363
|
availableInsideSpace: availableInsideSpace
|
|
345
364
|
};
|
|
346
365
|
}
|
|
347
|
-
export function getSearchString(
|
|
366
|
+
export function getSearchString() {
|
|
367
|
+
let charachers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
348
368
|
return (charachers || '').toString().toLowerCase(); //.replace(/\s+/g, '');
|
|
349
369
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "core-js/modules/es.string.replace";
|
|
2
1
|
let dateFormat = {
|
|
3
2
|
dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
|
4
3
|
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
|
5
4
|
timeNames: ['a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM']
|
|
6
5
|
};
|
|
7
|
-
export function pad(n
|
|
6
|
+
export function pad(n) {
|
|
7
|
+
let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
8
|
+
let z = arguments.length > 2 ? arguments[2] : undefined;
|
|
8
9
|
z = z || '0';
|
|
9
10
|
n = `${n}`;
|
|
10
11
|
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
|
@@ -76,7 +77,9 @@ export function replaceI18NValuesWithRegex(i18nStr, values) {
|
|
|
76
77
|
export function unescapeUnicode(str) {
|
|
77
78
|
return str.replace(/\\u([a-fA-F0-9]{4})/g, (g, m1) => String.fromCharCode(parseInt(m1, 16)));
|
|
78
79
|
}
|
|
79
|
-
export function getValues(
|
|
80
|
+
export function getValues() {
|
|
81
|
+
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
82
|
+
let diff = arguments.length > 1 ? arguments[1] : undefined;
|
|
80
83
|
return params.map(param => diff[param]);
|
|
81
84
|
}
|
|
82
85
|
export function getI18NValue(i18n) {
|
|
@@ -377,11 +377,12 @@ export const makeGetOptionIdChange = () => createSelector([getOptions, getValueF
|
|
|
377
377
|
return changedOptions;
|
|
378
378
|
}, newOptions);
|
|
379
379
|
});
|
|
380
|
-
export const filterSelectedOptions = ({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
380
|
+
export const filterSelectedOptions = function () {
|
|
381
|
+
let {
|
|
382
|
+
selectedOptions = dummyArray,
|
|
383
|
+
propSelectedOptions = dummyArray,
|
|
384
|
+
disabledOptions = dummyArray
|
|
385
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
385
386
|
// eslint-disable-next-line no-param-reassign
|
|
386
387
|
selectedOptions = selectedOptions || dummyArray; // eslint-disable-next-line no-param-reassign
|
|
387
388
|
|
|
@@ -405,4 +406,42 @@ export const filterSelectedOptions = ({
|
|
|
405
406
|
return {
|
|
406
407
|
newSelectedOptions: [...oldValidSelectedOptions, ...newlyAddedOptions]
|
|
407
408
|
};
|
|
408
|
-
};
|
|
409
|
+
};
|
|
410
|
+
export const makeGetIsShowClearIcon = () => createSelector([getSelectedOptionsSel, getDisabledOptions], (selectedOptions, disabledOptions) => {
|
|
411
|
+
let countForShowClear = 2;
|
|
412
|
+
let enabledOptionsLength = 0;
|
|
413
|
+
let isShowClearIcon = selectedOptions.length >= countForShowClear;
|
|
414
|
+
|
|
415
|
+
if (disabledOptions.length) {
|
|
416
|
+
let isHaveEnabledOptions = false;
|
|
417
|
+
let isAllDisabled = disabledOptions.length === selectedOptions.length;
|
|
418
|
+
|
|
419
|
+
if (!isAllDisabled) {
|
|
420
|
+
isHaveEnabledOptions = selectedOptions.some(option => {
|
|
421
|
+
let {
|
|
422
|
+
isDisabled = false
|
|
423
|
+
} = option || {};
|
|
424
|
+
|
|
425
|
+
if (!isDisabled) {
|
|
426
|
+
enabledOptionsLength += 1;
|
|
427
|
+
|
|
428
|
+
if (enabledOptionsLength === countForShowClear) {
|
|
429
|
+
return true;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return false;
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
return {
|
|
440
|
+
isShowClearIcon: isAllDisabled ? !isAllDisabled : isHaveEnabledOptions
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
return {
|
|
445
|
+
isShowClearIcon
|
|
446
|
+
};
|
|
447
|
+
});
|
package/es/utils/getInitial.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export function getInitial(
|
|
1
|
+
export function getInitial() {
|
|
2
|
+
let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
3
|
+
let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
2
4
|
let initial = '';
|
|
3
5
|
|
|
4
6
|
if (firstName) {
|