@zohodesk/components 1.0.0-temp-255 → 1.0.0-temp-252.4
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/es/AppContainer/AppContainer.js +2 -0
- package/es/Avatar/Avatar.js +2 -1
- package/es/Button/css/cssJSLogic.js +5 -4
- 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 -55
- 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/DropBox/DropBoxElement/css/cssJSLogic.js +6 -5
- package/es/Layout/utils.js +2 -1
- package/es/ListItem/ListContainer.js +5 -4
- package/es/Modal/Portal/Portal.js +5 -4
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +103 -91
- package/es/MultiSelect/AdvancedMultiSelect.js +80 -74
- package/es/MultiSelect/MultiSelect.js +13 -4
- package/es/MultiSelect/Suggestions.js +17 -14
- package/es/Popup/Popup.js +4 -1
- package/es/Provider/IdProvider.js +5 -4
- package/es/Provider/LibraryContext.js +12 -11
- 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 +5 -1
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +14 -10
- package/es/Select/GroupSelect.js +103 -98
- package/es/Select/Select.js +116 -108
- package/es/Select/SelectWithAvatar.js +95 -91
- package/es/Select/SelectWithIcon.js +109 -104
- package/es/Select/__tests__/Select.spec.js +9 -6
- package/es/Tab/Tab.js +30 -29
- package/es/Tab/TabContent.js +19 -16
- package/es/Tab/TabContentWrapper.js +22 -19
- package/es/Tab/TabWrapper.js +16 -15
- package/es/Tab/Tabs.js +87 -80
- package/es/Typography/css/cssJSLogic.js +5 -4
- package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -1
- package/es/utils/Common.js +31 -10
- package/es/utils/datetime/common.js +6 -2
- package/es/utils/dropDownUtils.js +11 -7
- package/es/utils/getInitial.js +3 -1
- package/es/v1/Button/css/cssJSLogic.js +8 -4
- package/es/v1/Label/css/cssJSLogic.js +5 -4
- package/es/v1/Switch/css/cssJSLogic.js +5 -4
- package/es/v1/helpers/colorHelpers/colorHelper.js +39 -28
- package/lib/AppContainer/AppContainer.js +4 -0
- package/lib/Select/Select.js +3 -1
- package/package.json +2 -2
package/es/Tab/Tabs.js
CHANGED
|
@@ -107,7 +107,8 @@ class Tabs extends React.Component {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
setMaxDim(
|
|
110
|
+
setMaxDim() {
|
|
111
|
+
let totalDimension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
111
112
|
let {
|
|
112
113
|
selectedTab
|
|
113
114
|
} = this.props; // let actual = Object.keys(tabDimensions).reduce(
|
|
@@ -408,9 +409,10 @@ class Tabs extends React.Component {
|
|
|
408
409
|
togglePopup(e, boxPosition);
|
|
409
410
|
}
|
|
410
411
|
|
|
411
|
-
responsiveFunc({
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
responsiveFunc(_ref) {
|
|
413
|
+
let {
|
|
414
|
+
mediaQueryOR
|
|
415
|
+
} = _ref;
|
|
414
416
|
return {
|
|
415
417
|
tabletMode: mediaQueryOR([{
|
|
416
418
|
maxWidth: 700
|
|
@@ -430,9 +432,10 @@ class Tabs extends React.Component {
|
|
|
430
432
|
});
|
|
431
433
|
}
|
|
432
434
|
|
|
433
|
-
getMoreList({
|
|
434
|
-
|
|
435
|
-
|
|
435
|
+
getMoreList(_ref2) {
|
|
436
|
+
let {
|
|
437
|
+
moreTabs
|
|
438
|
+
} = _ref2;
|
|
436
439
|
const validElements = [];
|
|
437
440
|
React.Children.map(moreTabs, child => {
|
|
438
441
|
const isValidElement = /*#__PURE__*/React.isValidElement(child);
|
|
@@ -444,9 +447,10 @@ class Tabs extends React.Component {
|
|
|
444
447
|
return validElements;
|
|
445
448
|
}
|
|
446
449
|
|
|
447
|
-
handleFilterSuggestions({
|
|
448
|
-
|
|
449
|
-
|
|
450
|
+
handleFilterSuggestions(_ref3) {
|
|
451
|
+
let {
|
|
452
|
+
moreTabs
|
|
453
|
+
} = _ref3;
|
|
450
454
|
const {
|
|
451
455
|
showTitleInMoreOptions
|
|
452
456
|
} = this.props;
|
|
@@ -578,79 +582,82 @@ class Tabs extends React.Component {
|
|
|
578
582
|
})), isPopupOpen && /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
579
583
|
query: this.responsiveFunc,
|
|
580
584
|
responsiveId: "Helmet"
|
|
581
|
-
},
|
|
582
|
-
tabletMode
|
|
583
|
-
}) => /*#__PURE__*/React.createElement(ResponsiveDropBox, _extends({
|
|
584
|
-
isActive: isPopupReady,
|
|
585
|
-
isAnimate: true,
|
|
586
|
-
size: "medium",
|
|
587
|
-
customClass: {
|
|
588
|
-
customDropBoxWrap: `${moreContainerClass} ${popupClass}`
|
|
589
|
-
},
|
|
590
|
-
boxPosition: position,
|
|
591
|
-
getRef: getContainerRef,
|
|
592
|
-
isBoxPaddingNeed: false,
|
|
593
|
-
isArrow: false,
|
|
594
|
-
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
595
|
-
isRestrictScroll: isRestrictScroll,
|
|
596
|
-
positionsOffset: positionsOffset,
|
|
597
|
-
targetOffset: targetOffset
|
|
598
|
-
}, DropBoxProps, {
|
|
599
|
-
isResponsivePadding: true,
|
|
600
|
-
needFocusScope: true,
|
|
601
|
-
dataId: `${dataId}_dropbox`,
|
|
602
|
-
onClick: removeClose,
|
|
603
|
-
onClose: this.togglePopup
|
|
604
|
-
}), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(this.props), hasSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
605
|
-
className: tabsStyle.search
|
|
606
|
-
}, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
|
|
607
|
-
placeHolder: placeHolderText,
|
|
608
|
-
onChange: this.handleChange,
|
|
609
|
-
value: searchValue,
|
|
610
|
-
onClear: this.handleSearchValueClear,
|
|
611
|
-
size: searchBoxSize,
|
|
612
|
-
customProps: {
|
|
613
|
-
TextBoxProps: {
|
|
614
|
-
'data-a11y-autofocus': true
|
|
615
|
-
}
|
|
616
|
-
},
|
|
617
|
-
dataId: `${dataId}_search`,
|
|
618
|
-
autoComplete: false,
|
|
619
|
-
name: "search"
|
|
620
|
-
}, TextBoxIconProps))) : null, /*#__PURE__*/React.createElement(Box, {
|
|
621
|
-
flexible: true,
|
|
622
|
-
shrink: true,
|
|
623
|
-
scroll: "vertical",
|
|
624
|
-
className: `${tabsStyle.listWrapper} ${tabletMode ? '' : tabsStyle.menuBox} ${moreBoxClass}`,
|
|
625
|
-
onScroll: this.onScroll,
|
|
626
|
-
dataId: `${dataId}_Tabs`
|
|
627
|
-
}, moreTabsListItems.length ? moreTabsListItems.map(data => {
|
|
585
|
+
}, _ref4 => {
|
|
628
586
|
let {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
dataId
|
|
636
|
-
} = data;
|
|
637
|
-
const value = text ? text : showTitleInMoreOptions ? title : null;
|
|
638
|
-
return /*#__PURE__*/React.createElement(ListItem, _extends({
|
|
639
|
-
key: id,
|
|
640
|
-
value: value,
|
|
641
|
-
onClick: this.moreTabSelect,
|
|
642
|
-
id: id,
|
|
643
|
-
title: title || text,
|
|
644
|
-
isLink: isLink,
|
|
645
|
-
href: href,
|
|
646
|
-
autoHover: true,
|
|
587
|
+
tabletMode
|
|
588
|
+
} = _ref4;
|
|
589
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, _extends({
|
|
590
|
+
isActive: isPopupReady,
|
|
591
|
+
isAnimate: true,
|
|
592
|
+
size: "medium",
|
|
647
593
|
customClass: {
|
|
648
|
-
|
|
594
|
+
customDropBoxWrap: `${moreContainerClass} ${popupClass}`
|
|
595
|
+
},
|
|
596
|
+
boxPosition: position,
|
|
597
|
+
getRef: getContainerRef,
|
|
598
|
+
isBoxPaddingNeed: false,
|
|
599
|
+
isArrow: false,
|
|
600
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
601
|
+
isRestrictScroll: isRestrictScroll,
|
|
602
|
+
positionsOffset: positionsOffset,
|
|
603
|
+
targetOffset: targetOffset
|
|
604
|
+
}, DropBoxProps, {
|
|
605
|
+
isResponsivePadding: true,
|
|
606
|
+
needFocusScope: true,
|
|
607
|
+
dataId: `${dataId}_dropbox`,
|
|
608
|
+
onClick: removeClose,
|
|
609
|
+
onClose: this.togglePopup
|
|
610
|
+
}), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(this.props), hasSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
611
|
+
className: tabsStyle.search
|
|
612
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
|
|
613
|
+
placeHolder: placeHolderText,
|
|
614
|
+
onChange: this.handleChange,
|
|
615
|
+
value: searchValue,
|
|
616
|
+
onClear: this.handleSearchValueClear,
|
|
617
|
+
size: searchBoxSize,
|
|
618
|
+
customProps: {
|
|
619
|
+
TextBoxProps: {
|
|
620
|
+
'data-a11y-autofocus': true
|
|
621
|
+
}
|
|
649
622
|
},
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
623
|
+
dataId: `${dataId}_search`,
|
|
624
|
+
autoComplete: false,
|
|
625
|
+
name: "search"
|
|
626
|
+
}, TextBoxIconProps))) : null, /*#__PURE__*/React.createElement(Box, {
|
|
627
|
+
flexible: true,
|
|
628
|
+
shrink: true,
|
|
629
|
+
scroll: "vertical",
|
|
630
|
+
className: `${tabsStyle.listWrapper} ${tabletMode ? '' : tabsStyle.menuBox} ${moreBoxClass}`,
|
|
631
|
+
onScroll: this.onScroll,
|
|
632
|
+
dataId: `${dataId}_Tabs`
|
|
633
|
+
}, moreTabsListItems.length ? moreTabsListItems.map(data => {
|
|
634
|
+
let {
|
|
635
|
+
text,
|
|
636
|
+
id,
|
|
637
|
+
title,
|
|
638
|
+
isLink,
|
|
639
|
+
href,
|
|
640
|
+
children,
|
|
641
|
+
dataId
|
|
642
|
+
} = data;
|
|
643
|
+
const value = text ? text : showTitleInMoreOptions ? title : null;
|
|
644
|
+
return /*#__PURE__*/React.createElement(ListItem, _extends({
|
|
645
|
+
key: id,
|
|
646
|
+
value: value,
|
|
647
|
+
onClick: this.moreTabSelect,
|
|
648
|
+
id: id,
|
|
649
|
+
title: title || text,
|
|
650
|
+
isLink: isLink,
|
|
651
|
+
href: href,
|
|
652
|
+
autoHover: true,
|
|
653
|
+
customClass: {
|
|
654
|
+
customListItem: menuItemClass
|
|
655
|
+
},
|
|
656
|
+
target: "self",
|
|
657
|
+
dataId: `${dataId}_Tab`
|
|
658
|
+
}, ListItemProps), !showTitleInMoreOptions ? children : null);
|
|
659
|
+
}) : this.renderEmptyState()));
|
|
660
|
+
})) : null);
|
|
654
661
|
}
|
|
655
662
|
|
|
656
663
|
render() {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { compileClassNames } from '@zohodesk/utils';
|
|
2
2
|
import { letterspacingMapping, lineheightMapping } from "../utils";
|
|
3
|
-
export default function cssJSLogic({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default function cssJSLogic(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
props,
|
|
6
|
+
style
|
|
7
|
+
} = _ref;
|
|
7
8
|
let {
|
|
8
9
|
$flag_reset,
|
|
9
10
|
shouldReset,
|
|
@@ -34,7 +34,8 @@ export default class VelocityAnimationGroup extends React.Component {
|
|
|
34
34
|
|
|
35
35
|
if (postEnterStyles && typeof postEnterStyles === 'object') {
|
|
36
36
|
elements.forEach(rootElement => {
|
|
37
|
-
Object.entries(postEnterStyles).forEach(
|
|
37
|
+
Object.entries(postEnterStyles).forEach(_ref => {
|
|
38
|
+
let [cssProperty, cssValue] = _ref;
|
|
38
39
|
rootElement.style[cssProperty] = cssValue;
|
|
39
40
|
});
|
|
40
41
|
});
|
package/es/utils/Common.js
CHANGED
|
@@ -49,11 +49,14 @@ export function encodeForHtml(str) {
|
|
|
49
49
|
|
|
50
50
|
return str;
|
|
51
51
|
}
|
|
52
|
-
export function getListOfDetails(
|
|
52
|
+
export function getListOfDetails() {
|
|
53
|
+
let Obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
54
|
+
let fn = arguments.length > 1 ? arguments[1] : undefined;
|
|
53
55
|
const ids = Object.keys(Obj) || [];
|
|
54
56
|
return ids.map(id => fn(Obj[id]));
|
|
55
57
|
}
|
|
56
|
-
export function capitalize(
|
|
58
|
+
export function capitalize() {
|
|
59
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
57
60
|
let newValue = '';
|
|
58
61
|
|
|
59
62
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -66,12 +69,18 @@ export function capitalize(value = '') {
|
|
|
66
69
|
|
|
67
70
|
return newValue;
|
|
68
71
|
}
|
|
69
|
-
export function bind(
|
|
72
|
+
export function bind() {
|
|
73
|
+
for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
74
|
+
handlers[_key] = arguments[_key];
|
|
75
|
+
}
|
|
76
|
+
|
|
70
77
|
handlers.forEach(handler => {
|
|
71
78
|
this[handler] = this[handler].bind(this);
|
|
72
79
|
});
|
|
73
80
|
}
|
|
74
|
-
export function getFullName(
|
|
81
|
+
export function getFullName() {
|
|
82
|
+
let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
83
|
+
let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
75
84
|
let fullName = '';
|
|
76
85
|
|
|
77
86
|
if (firstName !== null && firstName !== '') {
|
|
@@ -84,7 +93,8 @@ export function getFullName(firstName = '', lastName = '') {
|
|
|
84
93
|
|
|
85
94
|
return fullName;
|
|
86
95
|
}
|
|
87
|
-
export function getStringifiedOutputForJson(
|
|
96
|
+
export function getStringifiedOutputForJson() {
|
|
97
|
+
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
88
98
|
const keys = Object.keys(input);
|
|
89
99
|
const modifiedInput = keys.reduce((curr, next) => {
|
|
90
100
|
const values = input[next] || [];
|
|
@@ -120,14 +130,19 @@ export function filterValue(obj, val) {
|
|
|
120
130
|
});
|
|
121
131
|
return result;
|
|
122
132
|
}
|
|
123
|
-
export function merge(
|
|
133
|
+
export function merge() {
|
|
134
|
+
let oldObj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
135
|
+
let newObj = arguments.length > 1 ? arguments[1] : undefined;
|
|
124
136
|
const copyOfOld = Object.assign({}, oldObj);
|
|
125
137
|
return Object.keys(newObj).reduce((res, key) => {
|
|
126
138
|
res[key] = Object.assign({}, res[key] || {}, newObj[key]);
|
|
127
139
|
return res;
|
|
128
140
|
}, copyOfOld);
|
|
129
141
|
}
|
|
130
|
-
export function formatValue(
|
|
142
|
+
export function formatValue() {
|
|
143
|
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
144
|
+
let valueField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
|
|
145
|
+
let textField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'name';
|
|
131
146
|
return values && values.map(value => {
|
|
132
147
|
let formattedValue = value;
|
|
133
148
|
|
|
@@ -151,7 +166,8 @@ export function bytesToSize(bytes) {
|
|
|
151
166
|
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)), 10);
|
|
152
167
|
return `${Math.round(bytes / Math.pow(1024, i), 2)} ${sizes[i]}`;
|
|
153
168
|
}
|
|
154
|
-
export function getMemSize(bytes
|
|
169
|
+
export function getMemSize(bytes) {
|
|
170
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
155
171
|
const thresh = size ? 1000 : 1024;
|
|
156
172
|
|
|
157
173
|
if (Math.abs(bytes) < thresh) {
|
|
@@ -284,7 +300,11 @@ export const debounce = function (func, wait) {
|
|
|
284
300
|
};
|
|
285
301
|
};
|
|
286
302
|
let timerId;
|
|
287
|
-
export const throttle = (func, wait
|
|
303
|
+
export const throttle = function (func, wait) {
|
|
304
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
|
305
|
+
args[_key2 - 2] = arguments[_key2];
|
|
306
|
+
}
|
|
307
|
+
|
|
288
308
|
if (timerId) {
|
|
289
309
|
return;
|
|
290
310
|
}
|
|
@@ -354,7 +374,8 @@ export function getElementSpace(elementRef) {
|
|
|
354
374
|
availableInsideSpace: availableInsideSpace
|
|
355
375
|
};
|
|
356
376
|
}
|
|
357
|
-
export function getSearchString(
|
|
377
|
+
export function getSearchString() {
|
|
378
|
+
let charachers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
358
379
|
return (charachers || '').toString().toLowerCase().trim(); //.replace(/\s+/g, '');
|
|
359
380
|
}
|
|
360
381
|
export function findScrollEnd(element) {
|
|
@@ -4,7 +4,9 @@ let dateFormat = {
|
|
|
4
4
|
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
5
|
timeNames: ['a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM']
|
|
6
6
|
};
|
|
7
|
-
export function pad(n
|
|
7
|
+
export function pad(n) {
|
|
8
|
+
let width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
9
|
+
let z = arguments.length > 2 ? arguments[2] : undefined;
|
|
8
10
|
z = z || '0';
|
|
9
11
|
n = `${n}`;
|
|
10
12
|
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
|
@@ -88,7 +90,9 @@ export function replaceI18NValuesWithRegex(i18nStr, values) {
|
|
|
88
90
|
export function unescapeUnicode(str) {
|
|
89
91
|
return str.replace(/\\u([a-fA-F0-9]{4})/g, (g, m1) => String.fromCharCode(parseInt(m1, 16)));
|
|
90
92
|
}
|
|
91
|
-
export function getValues(
|
|
93
|
+
export function getValues() {
|
|
94
|
+
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
95
|
+
let diff = arguments.length > 1 ? arguments[1] : undefined;
|
|
92
96
|
return params.map(param => diff[param]);
|
|
93
97
|
}
|
|
94
98
|
export function getI18NValue(i18n) {
|
|
@@ -58,7 +58,10 @@ const getSearchFields = props => {
|
|
|
58
58
|
// }
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
export const isObjectContainsSearchString = (
|
|
61
|
+
export const isObjectContainsSearchString = function () {
|
|
62
|
+
let searchFields = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
63
|
+
let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
64
|
+
let obj = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
62
65
|
return searchFields.some(field => {
|
|
63
66
|
const val = obj[field];
|
|
64
67
|
if (val === null || val === undefined) return false;
|
|
@@ -441,12 +444,13 @@ export const makeGetOptionIdChange = () => createSelector([getOptions, getValueF
|
|
|
441
444
|
return changedOptions;
|
|
442
445
|
}, newOptions);
|
|
443
446
|
});
|
|
444
|
-
export const filterSelectedOptions = ({
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
447
|
+
export const filterSelectedOptions = function () {
|
|
448
|
+
let {
|
|
449
|
+
selectedOptions = dummyArray,
|
|
450
|
+
propSelectedOptions = dummyArray,
|
|
451
|
+
disabledOptions = dummyArray,
|
|
452
|
+
limit
|
|
453
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
450
454
|
// eslint-disable-next-line no-param-reassign
|
|
451
455
|
selectedOptions = selectedOptions || dummyArray; // eslint-disable-next-line no-param-reassign
|
|
452
456
|
|
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) {
|
|
@@ -5,11 +5,15 @@ import getPaletteClasses from "../../helpers/colorHelpers/colorHelper";
|
|
|
5
5
|
import { DUMMY_OBJECT } from '@zohodesk/dotkit/es/utils/constants';
|
|
6
6
|
import { DISABLED_APPEARANCE, LOADER_PLACEMENT, SHAPE, SIZE, STATUS } from "../constants";
|
|
7
7
|
|
|
8
|
-
const capitalize =
|
|
8
|
+
const capitalize = function () {
|
|
9
|
+
let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
10
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
11
|
+
};
|
|
9
12
|
|
|
10
|
-
export default function cssJSLogic({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
export default function cssJSLogic(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
props
|
|
16
|
+
} = _ref;
|
|
13
17
|
const {
|
|
14
18
|
palette,
|
|
15
19
|
bgAppearance,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import compileClassNames from '@zohodesk/utils/es/compileClassNames';
|
|
2
2
|
import commonStyle from "../../../common/common.module.css";
|
|
3
|
-
export default function cssJSLogic({
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export default function cssJSLogic(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
style,
|
|
6
|
+
props
|
|
7
|
+
} = _ref;
|
|
7
8
|
const {
|
|
8
9
|
shouldHighlightRequired,
|
|
9
10
|
isRequired,
|
|
@@ -48,27 +48,37 @@ const toBorderIntensity = (tone, hasState, isLighter) => {
|
|
|
48
48
|
return `${tone}-${isLighter ? intensity.borderLight : intensity.base}`;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export const getBgClass =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
state,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
51
|
+
export const getBgClass = _ref => {
|
|
52
|
+
let {
|
|
53
|
+
state,
|
|
54
|
+
tone,
|
|
55
|
+
isLighter
|
|
56
|
+
} = _ref;
|
|
57
|
+
return paletteBgStyle[withState(state, `bg-${toBgIntensity(tone, !!state, isLighter)}`)];
|
|
58
|
+
};
|
|
59
|
+
export const getTextClass = _ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
state,
|
|
62
|
+
textTone
|
|
63
|
+
} = _ref2;
|
|
64
|
+
return paletteTextStyle[withState(state, `text-${toTextIntensity(textTone, !!state)}`)];
|
|
65
|
+
};
|
|
66
|
+
export const getBorderClass = _ref3 => {
|
|
67
|
+
let {
|
|
68
|
+
state,
|
|
69
|
+
tone,
|
|
70
|
+
isLighter
|
|
71
|
+
} = _ref3;
|
|
72
|
+
return paletteBorderStyle[withState(state, `border-${toBorderIntensity(tone, !!state, isLighter)}`)];
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const buildPaletteClasses = (config, _ref4) => {
|
|
76
|
+
let {
|
|
77
|
+
bgAppearance,
|
|
78
|
+
borderAppearance,
|
|
79
|
+
paletteShade,
|
|
80
|
+
isSelected
|
|
81
|
+
} = _ref4;
|
|
72
82
|
const {
|
|
73
83
|
tone,
|
|
74
84
|
textTone,
|
|
@@ -149,13 +159,14 @@ const buildPaletteClasses = (config, {
|
|
|
149
159
|
};
|
|
150
160
|
};
|
|
151
161
|
|
|
152
|
-
const getPaletteClasses =
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
162
|
+
const getPaletteClasses = _ref5 => {
|
|
163
|
+
let {
|
|
164
|
+
palette,
|
|
165
|
+
bgAppearance,
|
|
166
|
+
borderAppearance,
|
|
167
|
+
paletteShade,
|
|
168
|
+
isSelected
|
|
169
|
+
} = _ref5;
|
|
159
170
|
const config = PALETTE_CONFIG[palette];
|
|
160
171
|
return config ? buildPaletteClasses(config, {
|
|
161
172
|
bgAppearance,
|
|
@@ -23,6 +23,10 @@ require("@zohodesk/variables/assets/colorVariables.module.css");
|
|
|
23
23
|
|
|
24
24
|
require("@zohodesk/variables/assets/dotVariables.module.css");
|
|
25
25
|
|
|
26
|
+
require("@zohodesk/variables/assets/sizeVariables.module.css");
|
|
27
|
+
|
|
28
|
+
require("@zohodesk/variables/assets/fontsizeVariables.module.css");
|
|
29
|
+
|
|
26
30
|
require("@zohodesk/variables/es/fontFamilyVariables.module.css");
|
|
27
31
|
|
|
28
32
|
require("@zohodesk/variables/es/fontWeightVariables.module.css");
|
package/lib/Select/Select.js
CHANGED
|
@@ -1136,7 +1136,9 @@ var SelectComponent = /*#__PURE__*/function (_Component) {
|
|
|
1136
1136
|
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
1137
1137
|
isCover: false,
|
|
1138
1138
|
align: "both"
|
|
1139
|
-
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter(
|
|
1139
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))), getFooter ? /*#__PURE__*/_react["default"].createElement(_Card.CardFooter, null, getFooter({
|
|
1140
|
+
closePopup: _this7.handlePopupClose
|
|
1141
|
+
})) : null)) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
1140
1142
|
flexible: true
|
|
1141
1143
|
}, getChildren())));
|
|
1142
1144
|
}) : null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/components",
|
|
3
|
-
"version": "1.0.0-temp-
|
|
3
|
+
"version": "1.0.0-temp-252.4",
|
|
4
4
|
"main": "es/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"build:watch": "npm run build:es:watch --module:mode=dev -- -w",
|
|
34
34
|
"coverage": "react-cli coverage",
|
|
35
35
|
"prepare": "npm run init && npm run css:build ",
|
|
36
|
-
"prepublishOnly": "node ../prePublish.js && npm run
|
|
36
|
+
"prepublishOnly": "node ../prePublish.js && npm run css:review && npm run review:props ",
|
|
37
37
|
"postpublish": "node ../postPublish.js",
|
|
38
38
|
"report": "react-cli publish:report",
|
|
39
39
|
"test": "react-cli test",
|