@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.
Files changed (52) hide show
  1. package/es/AppContainer/AppContainer.js +2 -0
  2. package/es/Avatar/Avatar.js +2 -1
  3. package/es/Button/css/cssJSLogic.js +5 -4
  4. package/es/DateTime/DateTime.js +6 -3
  5. package/es/DateTime/DateWidget.js +5 -2
  6. package/es/DateTime/YearView.js +6 -5
  7. package/es/DateTime/common.js +9 -2
  8. package/es/DateTime/dateFormatUtils/dateFormat.js +76 -55
  9. package/es/DateTime/dateFormatUtils/index.js +12 -7
  10. package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
  11. package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
  12. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +6 -5
  13. package/es/Layout/utils.js +2 -1
  14. package/es/ListItem/ListContainer.js +5 -4
  15. package/es/Modal/Portal/Portal.js +5 -4
  16. package/es/MultiSelect/AdvancedGroupMultiSelect.js +103 -91
  17. package/es/MultiSelect/AdvancedMultiSelect.js +80 -74
  18. package/es/MultiSelect/MultiSelect.js +13 -4
  19. package/es/MultiSelect/Suggestions.js +17 -14
  20. package/es/Popup/Popup.js +4 -1
  21. package/es/Provider/IdProvider.js +5 -4
  22. package/es/Provider/LibraryContext.js +12 -11
  23. package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
  24. package/es/Provider/ZindexProvider.js +5 -4
  25. package/es/Responsive/CustomResponsive.js +11 -8
  26. package/es/Responsive/ResizeComponent.js +3 -1
  27. package/es/Responsive/Responsive.js +12 -9
  28. package/es/Responsive/sizeObservers.js +5 -1
  29. package/es/ResponsiveDropBox/ResponsiveDropBox.js +14 -10
  30. package/es/Select/GroupSelect.js +103 -98
  31. package/es/Select/Select.js +116 -108
  32. package/es/Select/SelectWithAvatar.js +95 -91
  33. package/es/Select/SelectWithIcon.js +109 -104
  34. package/es/Select/__tests__/Select.spec.js +9 -6
  35. package/es/Tab/Tab.js +30 -29
  36. package/es/Tab/TabContent.js +19 -16
  37. package/es/Tab/TabContentWrapper.js +22 -19
  38. package/es/Tab/TabWrapper.js +16 -15
  39. package/es/Tab/Tabs.js +87 -80
  40. package/es/Typography/css/cssJSLogic.js +5 -4
  41. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -1
  42. package/es/utils/Common.js +31 -10
  43. package/es/utils/datetime/common.js +6 -2
  44. package/es/utils/dropDownUtils.js +11 -7
  45. package/es/utils/getInitial.js +3 -1
  46. package/es/v1/Button/css/cssJSLogic.js +8 -4
  47. package/es/v1/Label/css/cssJSLogic.js +5 -4
  48. package/es/v1/Switch/css/cssJSLogic.js +5 -4
  49. package/es/v1/helpers/colorHelpers/colorHelper.js +39 -28
  50. package/lib/AppContainer/AppContainer.js +4 -0
  51. package/lib/Select/Select.js +3 -1
  52. package/package.json +2 -2
@@ -8,6 +8,8 @@ import Tooltip from "../Tooltip/Tooltip";
8
8
  import "../common/basic.module.css";
9
9
  import '@zohodesk/variables/assets/colorVariables.module.css';
10
10
  import '@zohodesk/variables/assets/dotVariables.module.css';
11
+ import '@zohodesk/variables/assets/sizeVariables.module.css';
12
+ import '@zohodesk/variables/assets/fontsizeVariables.module.css';
11
13
  import '@zohodesk/variables/es/fontFamilyVariables.module.css';
12
14
  import '@zohodesk/variables/es/fontWeightVariables.module.css';
13
15
  import '@zohodesk/variables/assets/transitionVariables.module.css';
@@ -97,7 +97,8 @@ export default class Avatar extends React.Component {
97
97
  /* this will cause error if user name already have some space need to move firstName lastName user preference pattern*/
98
98
 
99
99
 
100
- getInitialByFullName(fullName = '') {
100
+ getInitialByFullName() {
101
+ let fullName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
101
102
  fullName = (fullName || '').trim();
102
103
  let nameList = fullName.split(' ');
103
104
 
@@ -1,8 +1,9 @@
1
1
  import { compileClassNames } from '@zohodesk/utils';
2
- export default function cssJSLogic({
3
- props,
4
- style
5
- }) {
2
+ export default function cssJSLogic(_ref) {
3
+ let {
4
+ props,
5
+ style
6
+ } = _ref;
6
7
  let {
7
8
  customClass,
8
9
  needAppearance,
@@ -21,7 +21,8 @@ import { Box } from "../Layout";
21
21
  import { getHourSuggestions, getMinuteSuggestions, addZeroIfNeeded } from "./dateFormatUtils";
22
22
  import { getDateText } from "./dateFormatUtils/dateFormat";
23
23
 
24
- function title(date, year, month, monthNames = []) {
24
+ function title(date, year, month) {
25
+ let monthNames = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
25
26
  const HeadingText = `${monthNames[month] || ''} ${year}`;
26
27
  return HeadingText;
27
28
  }
@@ -165,7 +166,8 @@ export default class DateTime extends React.PureComponent {
165
166
  return hours;
166
167
  }
167
168
 
168
- handleGetSelectedDate(selectedInfo = {}) {
169
+ handleGetSelectedDate() {
170
+ let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
169
171
  const {
170
172
  min,
171
173
  max,
@@ -281,7 +283,8 @@ export default class DateTime extends React.PureComponent {
281
283
  }
282
284
  }
283
285
 
284
- handleChange(selectedInfo = {}) {
286
+ handleChange() {
287
+ let selectedInfo = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
285
288
  const {
286
289
  onError,
287
290
  onChange,
@@ -724,7 +724,8 @@ class DateWidgetComponent extends React.Component {
724
724
  }
725
725
  }
726
726
 
727
- handleSelection(focusOrder = 0) {
727
+ handleSelection() {
728
+ let focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
728
729
  const isAllowedDateType = this.handleGetAllowedType();
729
730
 
730
731
  if (isAllowedDateType) {
@@ -920,7 +921,9 @@ class DateWidgetComponent extends React.Component {
920
921
  });
921
922
  }
922
923
 
923
- handleBlurSelectionRange(focusOrder = '', oldFocusOrder = '') {
924
+ handleBlurSelectionRange() {
925
+ let focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
926
+ let oldFocusOrder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
924
927
  const isAllowedDateType = this.handleGetAllowedType();
925
928
 
926
929
  if (isAllowedDateType) {
@@ -194,11 +194,12 @@ export default class YearView extends React.PureComponent {
194
194
  onSelectYear && onSelectYear(year);
195
195
  }
196
196
 
197
- renderListItem({
198
- index,
199
- style: virtualizerStyle,
200
- ref
201
- }) {
197
+ renderListItem(_ref) {
198
+ let {
199
+ index,
200
+ style: virtualizerStyle,
201
+ ref
202
+ } = _ref;
202
203
  const {
203
204
  years
204
205
  } = this;
@@ -1,9 +1,16 @@
1
- export function bind(...handlers) {
1
+ export function bind() {
2
+ for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
3
+ handlers[_key] = arguments[_key];
4
+ }
5
+
2
6
  handlers.forEach(handler => {
3
7
  this[handler] = this[handler].bind(this);
4
8
  });
5
9
  }
6
- export function formatValue(values = [], valueField = 'id', textField = 'name') {
10
+ export function formatValue() {
11
+ let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
12
+ let valueField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'id';
13
+ let textField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'name';
7
14
  return values && values.map(value => {
8
15
  let formattedValue = value;
9
16
 
@@ -12,7 +12,9 @@ import { formatDate } from "../../utils/datetime/common";
12
12
  import { defaultFormat, supportedPatterns, // patternChangeStr,
13
13
  patternSplitStr, INCONSTANT, flags } from "../constants";
14
14
 
15
- function getDateFormatString(dateFormatArr = [], datePatternArr = []) {
15
+ function getDateFormatString() {
16
+ let dateFormatArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
17
+ let datePatternArr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
16
18
  return dateFormatArr.reduce((res, dateStr, index) => {
17
19
  const patternStr = datePatternArr[index] || '';
18
20
  res += dateStr + patternStr;
@@ -20,8 +22,14 @@ function getDateFormatString(dateFormatArr = [], datePatternArr = []) {
20
22
  }, '');
21
23
  }
22
24
 
23
- function getIsValidPattern(dateFormatArr = [], datePatternArr = []) {
24
- const isValueInArray = (possibleFormat = []) => possibleFormat.some(str => dateFormatArr.indexOf(str) >= 0);
25
+ function getIsValidPattern() {
26
+ let dateFormatArr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
27
+ let datePatternArr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
28
+
29
+ const isValueInArray = function () {
30
+ let possibleFormat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
31
+ return possibleFormat.some(str => dateFormatArr.indexOf(str) >= 0);
32
+ };
25
33
 
26
34
  const haveDay = isValueInArray(flags.day);
27
35
  const haveMonth = isValueInArray(flags.month);
@@ -30,12 +38,14 @@ function getIsValidPattern(dateFormatArr = [], datePatternArr = []) {
30
38
  return haveDay && haveMonth && (haveYear || !haveYear) && isValidPattern;
31
39
  }
32
40
 
33
- export function getDateFormatDetails(dateFormat = '', {
34
- isHideCurrentYear,
35
- value,
36
- timeZone,
37
- isDateTime
38
- }) {
41
+ export function getDateFormatDetails() {
42
+ let dateFormat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
43
+ let {
44
+ isHideCurrentYear,
45
+ value,
46
+ timeZone,
47
+ isDateTime
48
+ } = arguments.length > 1 ? arguments[1] : undefined;
39
49
  let dayInfo = {};
40
50
  let monthInfo = {};
41
51
  let yearInfo = {};
@@ -116,10 +126,11 @@ export function getDateFormatDetails(dateFormat = '', {
116
126
  };
117
127
  }
118
128
 
119
- function getDisplayFormatValue(dateVal, formatVal, {
120
- i18nShortMonths = [],
121
- i18nMonths = []
122
- } = {}) {
129
+ function getDisplayFormatValue(dateVal, formatVal) {
130
+ let {
131
+ i18nShortMonths = [],
132
+ i18nMonths = []
133
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
123
134
  const {
124
135
  length,
125
136
  type
@@ -140,10 +151,11 @@ function getDisplayFormatValue(dateVal, formatVal, {
140
151
  return addZero(dateVal, length);
141
152
  }
142
153
 
143
- function concatDate(values, dateFormatArr, patternArr, fillPlaceHolder, {
144
- i18nShortMonths,
145
- i18nMonths
146
- } = {}) {
154
+ function concatDate(values, dateFormatArr, patternArr, fillPlaceHolder) {
155
+ let {
156
+ i18nShortMonths,
157
+ i18nMonths
158
+ } = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
147
159
  const dateString = dateFormatArr.reduce((res, formatVal, index) => {
148
160
  const {
149
161
  type: dateFormatVal = ''
@@ -160,11 +172,15 @@ function concatDate(values, dateFormatArr, patternArr, fillPlaceHolder, {
160
172
  return dateString;
161
173
  }
162
174
 
163
- export function getDateTimeString(values = {}, dateFormatDetails = {}, isDateTime, {
164
- i18nShortMonths,
165
- i18nMonths,
166
- is24Hour
167
- } = {}) {
175
+ export function getDateTimeString() {
176
+ let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
177
+ let dateFormatDetails = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
178
+ let isDateTime = arguments.length > 2 ? arguments[2] : undefined;
179
+ let {
180
+ i18nShortMonths,
181
+ i18nMonths,
182
+ is24Hour
183
+ } = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
168
184
  const {
169
185
  day,
170
186
  month,
@@ -204,9 +220,10 @@ export function getDateText(value, isDateTime, timeZone) {
204
220
 
205
221
  return value ? isDateTime ? timeZone ? datetime.toDate(datetime.tz.utcToTz(value, timeZone)) : new Date(value) : timeZone ? datetime.toDate(value) : new Date(value) : new Date();
206
222
  }
207
- export function getDateDetails(value, localValues, isDateTime, timeZone, {
208
- is24Hour
209
- }) {
223
+ export function getDateDetails(value, localValues, isDateTime, timeZone, _ref) {
224
+ let {
225
+ is24Hour
226
+ } = _ref;
210
227
  const {
211
228
  day,
212
229
  month,
@@ -256,9 +273,10 @@ export function getDateDetails(value, localValues, isDateTime, timeZone, {
256
273
 
257
274
  return localValues;
258
275
  }
259
- export function getIsValidDate(values, isDateTime, {
260
- is24Hour
261
- }) {
276
+ export function getIsValidDate(values, isDateTime, _ref2) {
277
+ let {
278
+ is24Hour
279
+ } = _ref2;
262
280
  const {
263
281
  day,
264
282
  month,
@@ -419,20 +437,22 @@ export function getSelectedDate(values, props) {
419
437
  };
420
438
  }
421
439
 
422
- function getDateFormatLength(type, length, formatVal = '', {
423
- i18nShortMonths,
424
- i18nMonths,
425
- selectedValue,
426
- day,
427
- month,
428
- year,
429
- hour,
430
- minute,
431
- noon,
432
- timeZone,
433
- isDateTime,
434
- is24Hour
435
- }) {
440
+ function getDateFormatLength(type, length) {
441
+ let formatVal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
442
+ let {
443
+ i18nShortMonths,
444
+ i18nMonths,
445
+ selectedValue,
446
+ day,
447
+ month,
448
+ year,
449
+ hour,
450
+ minute,
451
+ noon,
452
+ timeZone,
453
+ isDateTime,
454
+ is24Hour
455
+ } = arguments.length > 3 ? arguments[3] : undefined;
436
456
  const {
437
457
  month: selectedMonth
438
458
  } = getDateDetails(selectedValue, {
@@ -459,19 +479,20 @@ function getDateFormatLength(type, length, formatVal = '', {
459
479
  return length;
460
480
  }
461
481
 
462
- export function getDateFormatSelection(dateFormatDetails, isDateTime, {
463
- i18nShortMonths,
464
- i18nMonths,
465
- selectedValue,
466
- day,
467
- month,
468
- year,
469
- hour,
470
- minute,
471
- noon,
472
- timeZone,
473
- is24Hour
474
- } = {}) {
482
+ export function getDateFormatSelection(dateFormatDetails, isDateTime) {
483
+ let {
484
+ i18nShortMonths,
485
+ i18nMonths,
486
+ selectedValue,
487
+ day,
488
+ month,
489
+ year,
490
+ hour,
491
+ minute,
492
+ noon,
493
+ timeZone,
494
+ is24Hour
495
+ } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
475
496
  const {
476
497
  dateFormatArr = [],
477
498
  patternArr = []
@@ -9,7 +9,9 @@ import { getDateText } from "./dateFormat";
9
9
  export function convertYearToTwoDigit(year) {
10
10
  return parseInt(year.toString().slice(-2));
11
11
  }
12
- export function addZero(value = '', length) {
12
+ export function addZero() {
13
+ let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
14
+ let length = arguments.length > 1 ? arguments[1] : undefined;
13
15
  let newValue = value.toString();
14
16
 
15
17
  for (let i = 0; i < length; i++) {
@@ -96,7 +98,9 @@ export function getYearDetails(yearLength) {
96
98
  currentYear: year
97
99
  };
98
100
  }
99
- export function convertTwoDigitToYear(digitValue = '', selectedYear = '') {
101
+ export function convertTwoDigitToYear() {
102
+ let digitValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
103
+ let selectedYear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
100
104
  const dateObj = new Date();
101
105
  let year = dateObj.getFullYear();
102
106
  const digitValueStr = addZero(digitValue.toString(), 2);
@@ -220,11 +224,12 @@ export function getIsEmptyYear(value, yearLength) {
220
224
  } = getYearDetails(yearLength);
221
225
  return getIsEmptyValue(value, startPoint, endPoint);
222
226
  }
223
- export function getIsCurrentYear({
224
- isDateTime,
225
- value,
226
- timeZone
227
- }) {
227
+ export function getIsCurrentYear(_ref) {
228
+ let {
229
+ isDateTime,
230
+ value,
231
+ timeZone
232
+ } = _ref;
228
233
  let isCurrentYear = false;
229
234
 
230
235
  if (value && value !== INVALID_DATE) {
@@ -1,9 +1,10 @@
1
1
  /** * Methods ** */
2
2
  import { getIsNewValueType, getIsNumberTyped, getIsDeleteTyped, getHourDetails, getMinuteDetails, getNoonDetails, getIsNoonValueTyped, getIsEmptyHour } from "./index";
3
3
  import { getKeyValue, getIsEmptyValue } from "../../utils/Common";
4
- export function getChangedHour(values, event, focusOrders, keyActions, {
5
- is24Hour = false
6
- } = {}) {
4
+ export function getChangedHour(values, event, focusOrders, keyActions) {
5
+ let {
6
+ is24Hour = false
7
+ } = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
7
8
  const {
8
9
  keyCode,
9
10
  which
@@ -1,9 +1,10 @@
1
1
  /** * Methods ** */
2
2
  import { getIsNewValueType, getIsNumberTyped, getIsDeleteTyped, getDayEnd, convertYearToTwoDigit, getYearDetails, convertTwoDigitToYear, getIsEmptyYear } from "./index";
3
3
  import { getKeyValue } from "../../utils/Common";
4
- export function getChangedYear(values, event, focusOrders, keyActions, {
5
- yearInfo
6
- }) {
4
+ export function getChangedYear(values, event, focusOrders, keyActions, _ref) {
5
+ let {
6
+ yearInfo
7
+ } = _ref;
7
8
  const {
8
9
  keyCode,
9
10
  which
@@ -1,11 +1,12 @@
1
1
  import { useContext } from 'react';
2
2
  import LibraryContext from "../../../Provider/LibraryContextInit";
3
3
  import { compileClassNames } from '@zohodesk/utils';
4
- export default function cssJSLogic({
5
- props,
6
- style,
7
- customState
8
- }) {
4
+ export default function cssJSLogic(_ref) {
5
+ let {
6
+ props,
7
+ style,
8
+ customState
9
+ } = _ref;
9
10
  const DropBoxElementContext = useContext(LibraryContext);
10
11
  const {
11
12
  boxPosition,
@@ -15,7 +15,8 @@ export function createProps(propTypes, props, classNames) {
15
15
  export function isInteger(value) {
16
16
  return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;
17
17
  }
18
- export function setProps(childProps, props, values = {}) {
18
+ export function setProps(childProps, props) {
19
+ let values = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
19
20
  Object.keys(values).forEach(value => {
20
21
  if (props[value]) {
21
22
  if (value === 'dataId') {
@@ -36,10 +36,11 @@ const ListContainer = props => {
36
36
  eleRef,
37
37
  align
38
38
  } = props;
39
- const responsiveFunc = useCallback(({
40
- mediaQueryOR,
41
- isTouchDevice
42
- }) => {
39
+ const responsiveFunc = useCallback(_ref => {
40
+ let {
41
+ mediaQueryOR,
42
+ isTouchDevice
43
+ } = _ref;
43
44
  return {
44
45
  mobileToTab: mediaQueryOR([{
45
46
  maxWidth: 700
@@ -3,10 +3,11 @@ import BasePortal from '@zohodesk/dotkit/es/react/components/Portal/Portal';
3
3
  import { getLibraryConfig } from "../../Provider/Config";
4
4
  import { defaultProps } from "./props/defaultProps";
5
5
  import { propTypes } from "./props/propTypes";
6
- export default function Portal({
7
- children,
8
- portalId
9
- }) {
6
+ export default function Portal(_ref) {
7
+ let {
8
+ children,
9
+ portalId
10
+ } = _ref;
10
11
  const getPortalContainer = useCallback(() => {
11
12
  const getConfigPortalContainer = getLibraryConfig('getPortalContainer');
12
13