@elliemae/ds-utilities 2.2.0-alpha.4 → 3.0.0-next.2

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 (130) hide show
  1. package/cjs/capitalize.js +7 -35
  2. package/cjs/compose.js +32 -39
  3. package/cjs/getComponentFromProps.js +29 -47
  4. package/cjs/hooks/index.js +60 -68
  5. package/cjs/hooks/useCancellableDelayedCallback.js +18 -43
  6. package/cjs/hooks/useDerivedStateFromProps.js +36 -47
  7. package/cjs/hooks/useExecutionTimer.js +24 -43
  8. package/cjs/hooks/useExpandState.js +82 -69
  9. package/cjs/hooks/useHotkeys.js +24 -44
  10. package/cjs/hooks/useHoverHandlersDelay.js +18 -48
  11. package/cjs/hooks/useOnElementResize.js +27 -44
  12. package/cjs/hooks/useParentElement.js +13 -40
  13. package/cjs/hooks/usePrevious.js +10 -41
  14. package/cjs/hooks/useResizeObserver.js +25 -52
  15. package/cjs/hooks/useSetRef.js +11 -38
  16. package/cjs/hooks/useShouldRecalculate.js +14 -41
  17. package/cjs/hooks/useWindowScrollerList.js +33 -51
  18. package/cjs/hooks/useWindowSize.js +19 -49
  19. package/cjs/index.js +266 -145
  20. package/cjs/onClickHandlerForNonInteractiveElements.js +19 -46
  21. package/cjs/operators.js +51 -56
  22. package/cjs/platform.js +9 -37
  23. package/cjs/reactTypesUtility.js +22 -45
  24. package/cjs/scrollingTimer.js +15 -37
  25. package/cjs/system.js +30 -47
  26. package/cjs/timeUtils.js +24 -42
  27. package/cjs/utils.js +237 -101
  28. package/cjs/validations.js +35 -48
  29. package/esm/capitalize.js +3 -6
  30. package/esm/compose.js +29 -11
  31. package/esm/getComponentFromProps.js +22 -18
  32. package/esm/hooks/index.js +18 -40
  33. package/esm/hooks/useCancellableDelayedCallback.js +14 -12
  34. package/esm/hooks/useDerivedStateFromProps.js +31 -15
  35. package/esm/hooks/useExecutionTimer.js +20 -12
  36. package/esm/hooks/useExpandState.js +72 -36
  37. package/esm/hooks/useHotkeys.js +14 -11
  38. package/esm/hooks/useHoverHandlersDelay.js +12 -15
  39. package/esm/hooks/useOnElementResize.js +20 -12
  40. package/esm/hooks/useParentElement.js +7 -9
  41. package/esm/hooks/usePrevious.js +6 -10
  42. package/esm/hooks/useResizeObserver.js +15 -20
  43. package/esm/hooks/useSetRef.js +6 -8
  44. package/esm/hooks/useShouldRecalculate.js +11 -11
  45. package/esm/hooks/useWindowScrollerList.js +29 -20
  46. package/esm/hooks/useWindowSize.js +15 -18
  47. package/esm/index.js +31 -204
  48. package/esm/onClickHandlerForNonInteractiveElements.js +17 -17
  49. package/esm/operators.js +34 -27
  50. package/esm/platform.js +4 -8
  51. package/esm/reactTypesUtility.js +9 -16
  52. package/esm/scrollingTimer.js +11 -8
  53. package/esm/system.js +22 -16
  54. package/esm/timeUtils.js +19 -13
  55. package/esm/utils.js +72 -109
  56. package/esm/validations.js +28 -18
  57. package/package.json +1 -1
  58. package/types/compose.d.ts +1 -2
  59. package/types/getComponentFromProps.d.ts +1 -2
  60. package/types/hooks/index.d.ts +14 -14
  61. package/types/hooks/useCancellableDelayedCallback.d.ts +1 -2
  62. package/types/hooks/useDerivedStateFromProps.d.ts +1 -2
  63. package/types/hooks/useExecutionTimer.d.ts +1 -2
  64. package/types/hooks/useExpandState.d.ts +2 -3
  65. package/types/hooks/useHotkeys.d.ts +2 -3
  66. package/types/hooks/useHoverHandlersDelay.d.ts +2 -3
  67. package/types/hooks/usePrevious.d.ts +1 -1
  68. package/types/hooks/useResizeObserver.d.ts +1 -2
  69. package/types/hooks/useShouldRecalculate.d.ts +1 -2
  70. package/types/hooks/useWindowScrollerList.d.ts +2 -3
  71. package/types/hooks/useWindowSize.d.ts +1 -2
  72. package/types/index.d.ts +11 -11
  73. package/types/onClickHandlerForNonInteractiveElements.d.ts +7 -7
  74. package/types/scrollingTimer.d.ts +1 -1
  75. package/cjs/capitalize.js.map +0 -7
  76. package/cjs/compose.js.map +0 -7
  77. package/cjs/getComponentFromProps.js.map +0 -7
  78. package/cjs/hooks/index.js.map +0 -7
  79. package/cjs/hooks/useCancellableDelayedCallback.js.map +0 -7
  80. package/cjs/hooks/useDerivedStateFromProps.js.map +0 -7
  81. package/cjs/hooks/useExecutionTimer.js.map +0 -7
  82. package/cjs/hooks/useExpandState.js.map +0 -7
  83. package/cjs/hooks/useHotkeys.js.map +0 -7
  84. package/cjs/hooks/useHoverHandlersDelay.js.map +0 -7
  85. package/cjs/hooks/useOnElementResize.js.map +0 -7
  86. package/cjs/hooks/useParentElement.js.map +0 -7
  87. package/cjs/hooks/usePrevious.js.map +0 -7
  88. package/cjs/hooks/useResizeObserver.js.map +0 -7
  89. package/cjs/hooks/useSetRef.js.map +0 -7
  90. package/cjs/hooks/useShouldRecalculate.js.map +0 -7
  91. package/cjs/hooks/useWindowScrollerList.js.map +0 -7
  92. package/cjs/hooks/useWindowSize.js.map +0 -7
  93. package/cjs/index.js.map +0 -7
  94. package/cjs/onClickHandlerForNonInteractiveElements.js.map +0 -7
  95. package/cjs/operators.js.map +0 -7
  96. package/cjs/platform.js.map +0 -7
  97. package/cjs/reactTypesUtility.js.map +0 -7
  98. package/cjs/scrollingTimer.js.map +0 -7
  99. package/cjs/system.js.map +0 -7
  100. package/cjs/timeUtils.js.map +0 -7
  101. package/cjs/utils.js.map +0 -7
  102. package/cjs/validations.js.map +0 -7
  103. package/esm/capitalize.js.map +0 -7
  104. package/esm/compose.js.map +0 -7
  105. package/esm/getComponentFromProps.js.map +0 -7
  106. package/esm/hooks/index.js.map +0 -7
  107. package/esm/hooks/useCancellableDelayedCallback.js.map +0 -7
  108. package/esm/hooks/useDerivedStateFromProps.js.map +0 -7
  109. package/esm/hooks/useExecutionTimer.js.map +0 -7
  110. package/esm/hooks/useExpandState.js.map +0 -7
  111. package/esm/hooks/useHotkeys.js.map +0 -7
  112. package/esm/hooks/useHoverHandlersDelay.js.map +0 -7
  113. package/esm/hooks/useOnElementResize.js.map +0 -7
  114. package/esm/hooks/useParentElement.js.map +0 -7
  115. package/esm/hooks/usePrevious.js.map +0 -7
  116. package/esm/hooks/useResizeObserver.js.map +0 -7
  117. package/esm/hooks/useSetRef.js.map +0 -7
  118. package/esm/hooks/useShouldRecalculate.js.map +0 -7
  119. package/esm/hooks/useWindowScrollerList.js.map +0 -7
  120. package/esm/hooks/useWindowSize.js.map +0 -7
  121. package/esm/index.js.map +0 -7
  122. package/esm/onClickHandlerForNonInteractiveElements.js.map +0 -7
  123. package/esm/operators.js.map +0 -7
  124. package/esm/platform.js.map +0 -7
  125. package/esm/reactTypesUtility.js.map +0 -7
  126. package/esm/scrollingTimer.js.map +0 -7
  127. package/esm/system.js.map +0 -7
  128. package/esm/timeUtils.js.map +0 -7
  129. package/esm/utils.js.map +0 -7
  130. package/esm/validations.js.map +0 -7
package/esm/index.js CHANGED
@@ -1,204 +1,31 @@
1
- import * as React from "react";
2
- import { default as default2 } from "./getComponentFromProps";
3
- import { default as default3 } from "./onClickHandlerForNonInteractiveElements";
4
- import { capitalize } from "./capitalize";
5
- import {
6
- checkNotEmpty,
7
- checkEmpty,
8
- greaterThan,
9
- validDate,
10
- equal,
11
- notEqual,
12
- isNull,
13
- isNotNull,
14
- isIn,
15
- isNotIn,
16
- greaterThanOrEquals,
17
- lessThanOrEquals,
18
- startsWith,
19
- contains
20
- } from "./operators";
21
- import {
22
- cx,
23
- runAll,
24
- hashArray,
25
- safeCall,
26
- removeUndefinedProperties,
27
- isObject,
28
- curry,
29
- arrayMove,
30
- uniq,
31
- filter,
32
- uniqBy,
33
- groupBy,
34
- property,
35
- get,
36
- set,
37
- cloneDeep,
38
- debounce,
39
- findIndex,
40
- isEmpty,
41
- isString,
42
- isEqual,
43
- maxBy,
44
- meanBy,
45
- noop,
46
- omit,
47
- orderBy,
48
- pull,
49
- sortBy,
50
- sumBy,
51
- transform,
52
- isFunction,
53
- range,
54
- parseInt,
55
- padStart,
56
- isNaN,
57
- values,
58
- throttle,
59
- toggleInObject,
60
- toggleInArray,
61
- pick,
62
- pickBy,
63
- differenceBy,
64
- differenceWith,
65
- addOrRemove,
66
- isEqualWith,
67
- isBoolean
68
- } from "./utils";
69
- import { setRef, mergeRefs, logger } from "./system";
70
- import {
71
- useMeasure,
72
- useForceUpdate,
73
- useOnClickOutside,
74
- useUncontrolled,
75
- useExecutionTimer,
76
- useExpandState,
77
- useHotkeys,
78
- useHoverHandlersDelay,
79
- useResizeObserver,
80
- useShouldRecalculate,
81
- useWindowScrollerList,
82
- useWindowSize,
83
- usePrevious,
84
- useCancellableDelayedCallback,
85
- useDerivedStateFromProps,
86
- useSetRef,
87
- useParentElement,
88
- useOnElementResize
89
- } from "./hooks";
90
- import { getVisibleTimeByFormat, addLeadingZeros } from "./timeUtils";
91
- import { compose } from "./compose";
92
- import { DOCUMENT, WINDOW } from "./platform";
93
- import {
94
- isClassComponent,
95
- isFunctionComponent,
96
- isReactComponent,
97
- isElement,
98
- isDOMTypeElement,
99
- isCompositeTypeElement
100
- } from "./reactTypesUtility";
101
- import { resetTimer } from "./scrollingTimer";
102
- import { isRequired, isGreaterThan, isValidDate } from "./validations";
103
- export {
104
- DOCUMENT,
105
- WINDOW,
106
- addLeadingZeros,
107
- addOrRemove,
108
- arrayMove,
109
- capitalize,
110
- checkEmpty,
111
- checkNotEmpty,
112
- cloneDeep,
113
- compose,
114
- contains,
115
- curry,
116
- cx,
117
- debounce,
118
- differenceBy,
119
- differenceWith,
120
- equal,
121
- filter,
122
- findIndex,
123
- get,
124
- default2 as getComponentFromProps,
125
- getVisibleTimeByFormat,
126
- greaterThan,
127
- greaterThanOrEquals,
128
- groupBy,
129
- hashArray,
130
- isBoolean,
131
- isClassComponent,
132
- isCompositeTypeElement,
133
- isDOMTypeElement,
134
- isElement,
135
- isEmpty,
136
- isEqual,
137
- isEqualWith,
138
- isFunction,
139
- isFunctionComponent,
140
- isGreaterThan,
141
- isIn,
142
- isNaN,
143
- isNotIn,
144
- isNotNull,
145
- isNull,
146
- isObject,
147
- isReactComponent,
148
- isRequired,
149
- isString,
150
- isValidDate,
151
- lessThanOrEquals,
152
- logger,
153
- maxBy,
154
- meanBy,
155
- mergeRefs,
156
- noop,
157
- notEqual,
158
- omit,
159
- default3 as onClickHandlerForNonInteractiveElements,
160
- orderBy,
161
- padStart,
162
- parseInt,
163
- pick,
164
- pickBy,
165
- property,
166
- pull,
167
- range,
168
- removeUndefinedProperties,
169
- resetTimer,
170
- runAll,
171
- safeCall,
172
- set,
173
- setRef,
174
- sortBy,
175
- startsWith,
176
- sumBy,
177
- throttle,
178
- toggleInArray,
179
- toggleInObject,
180
- transform,
181
- uniq,
182
- uniqBy,
183
- useCancellableDelayedCallback,
184
- useDerivedStateFromProps,
185
- useExecutionTimer,
186
- useExpandState,
187
- useForceUpdate,
188
- useHotkeys,
189
- useHoverHandlersDelay,
190
- useMeasure,
191
- useOnClickOutside,
192
- useOnElementResize,
193
- useParentElement,
194
- usePrevious,
195
- useResizeObserver,
196
- useSetRef,
197
- useShouldRecalculate,
198
- useUncontrolled,
199
- useWindowScrollerList,
200
- useWindowSize,
201
- validDate,
202
- values
203
- };
204
- //# sourceMappingURL=index.js.map
1
+ export { default as getComponentFromProps } from './getComponentFromProps.js';
2
+ export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements.js';
3
+ export { capitalize } from './capitalize.js';
4
+ export { checkEmpty, checkNotEmpty, contains, equal, greaterThan, greaterThanOrEquals, isIn, isNotIn, isNotNull, isNull, lessThanOrEquals, notEqual, startsWith, validDate } from './operators.js';
5
+ export { addOrRemove, arrayMove, cx, hashArray, removeUndefinedProperties, runAll, safeCall, toggleInArray, toggleInObject } from './utils.js';
6
+ export { logger, mergeRefs, setRef } from './system.js';
7
+ export { default as useMeasure } from 'use-measure';
8
+ export { default as useExecutionTimer } from './hooks/useExecutionTimer.js';
9
+ export { default as useExpandState } from './hooks/useExpandState.js';
10
+ export { default as useHotkeys } from './hooks/useHotkeys.js';
11
+ export { default as useHoverHandlersDelay } from './hooks/useHoverHandlersDelay.js';
12
+ export { default as useResizeObserver } from './hooks/useResizeObserver.js';
13
+ export { default as useShouldRecalculate } from './hooks/useShouldRecalculate.js';
14
+ export { default as useWindowScrollerList } from './hooks/useWindowScrollerList.js';
15
+ export { default as useWindowSize } from './hooks/useWindowSize.js';
16
+ export { default as useForceUpdate } from 'use-force-update';
17
+ export { default as useOnClickOutside } from 'use-onclickoutside';
18
+ export { useUncontrolled } from 'uncontrollable';
19
+ export { default as usePrevious } from './hooks/usePrevious.js';
20
+ export { default as useCancellableDelayedCallback } from './hooks/useCancellableDelayedCallback.js';
21
+ export { default as useDerivedStateFromProps } from './hooks/useDerivedStateFromProps.js';
22
+ export { useSetRef } from './hooks/useSetRef.js';
23
+ export { useParentElement } from './hooks/useParentElement.js';
24
+ export { useOnElementResize } from './hooks/useOnElementResize.js';
25
+ export { addLeadingZeros, getVisibleTimeByFormat } from './timeUtils.js';
26
+ export { compose } from './compose.js';
27
+ export { DOCUMENT, WINDOW } from './platform.js';
28
+ export { isClassComponent, isCompositeTypeElement, isDOMTypeElement, isElement, isFunctionComponent, isReactComponent } from './reactTypesUtility.js';
29
+ export { resetTimer } from './scrollingTimer.js';
30
+ export { isGreaterThan, isRequired, isValidDate } from './validations.js';
31
+ export { cloneDeep, curry, debounce, differenceBy, differenceWith, filter, findIndex, get, groupBy, isBoolean, isEmpty, isEqual, isEqualWith, isFunction, isNaN, isObject, isString, maxBy, meanBy, noop, omit, orderBy, padStart, parseInt, pick, pickBy, property, pull, range, set, sortBy, sumBy, throttle, transform, uniq, uniqBy, values } from 'lodash';
@@ -1,20 +1,20 @@
1
- import * as React from "react";
2
- const onClickHandlerForNonInteractiveElements = (onClickHandler) => ({
3
- role: "button",
4
- tabIndex: "0",
1
+ /**
2
+ * onClickHandler: callback
3
+ *
4
+ * @param onClickHandler
5
+ */
6
+ var onClickHandlerForNonInteractiveElements = (onClickHandler => ({
7
+ role: 'button',
8
+ tabIndex: '0',
5
9
  onClick: onClickHandler,
6
- onKeyPress: (event) => {
10
+ onKeyPress: event => {
7
11
  event.stopPropagation();
8
- const { keycode, key } = event;
9
- if (key === "Enter")
10
- onClickHandler(event);
11
- else if (keycode === 13)
12
- onClickHandler(event);
12
+ const {
13
+ keycode,
14
+ key
15
+ } = event;
16
+ if (key === 'Enter') onClickHandler(event);else if (keycode === 13) onClickHandler(event);
13
17
  }
14
- });
15
- var onClickHandlerForNonInteractiveElements_default = onClickHandlerForNonInteractiveElements;
16
- export {
17
- onClickHandlerForNonInteractiveElements_default as default,
18
- onClickHandlerForNonInteractiveElements
19
- };
20
- //# sourceMappingURL=onClickHandlerForNonInteractiveElements.js.map
18
+ }));
19
+
20
+ export { onClickHandlerForNonInteractiveElements as default };
package/esm/operators.js CHANGED
@@ -1,39 +1,46 @@
1
- import * as React from "react";
2
- import { isEmpty } from "lodash";
3
- const checkNotEmpty = (value) => value === "" || value === void 0 || value == [] || value === null || isEmpty(value);
4
- const checkEmpty = (value) => !isEmpty(value);
1
+ import 'core-js/modules/web.dom-collections.iterator.js';
2
+ import 'core-js/modules/esnext.async-iterator.map.js';
3
+ import 'core-js/modules/esnext.iterator.map.js';
4
+ import { isEmpty } from 'lodash';
5
+
6
+ /**
7
+ * Check if the value is null undefined ''
8
+ *
9
+ * @param value
10
+ */
11
+
12
+ const checkNotEmpty = value => value === '' || value === undefined || value == [] || value === null || isEmpty(value);
13
+ const checkEmpty = value => !isEmpty(value);
14
+ /**
15
+ * @param value: number
16
+ * @param comparator: number
17
+ * @param value
18
+ * @param comparator
19
+ */
20
+
5
21
  const greaterThan = (value, comparator) => value > comparator;
6
- const validDate = (value) => {
22
+ /**
23
+ * Check if a valid date with format MM/DD/YYYY
24
+ *
25
+ * @param {*} value: string
26
+ * @param value
27
+ */
28
+
29
+ const validDate = value => {
7
30
  const dateValidationRegex = /^\d{1,2}\/\d{1,2}\/\d{4}$/;
8
- if (!dateValidationRegex.test(value))
9
- return false;
10
- const [m, d, y] = value.split("/").map((n) => Number(n));
31
+ if (!dateValidationRegex.test(value)) return false;
32
+ const [m, d, y] = value.split('/').map(n => Number(n));
11
33
  return m === Number(new Date(y, m - 1, d).getMonth()) + 1 && d === Number(new Date(y, m - 1, d).getDate());
12
34
  };
13
35
  const equal = (a, b) => a === b;
14
36
  const notEqual = (a, b) => !equal(a, b);
15
- const isNull = (a) => checkNotEmpty(a);
16
- const isNotNull = (a) => !isNull(a);
37
+ const isNull = a => checkNotEmpty(a);
38
+ const isNotNull = a => !isNull(a);
17
39
  const isIn = (a, b) => b.indexOf(a) > -1;
18
40
  const isNotIn = (a, b) => !isIn(a, b);
19
41
  const greaterThanOrEquals = (value, comparator) => value >= comparator;
20
42
  const lessThanOrEquals = (value, comparator) => value <= comparator;
21
43
  const startsWith = (value, comparator) => String(value).startsWith(comparator);
22
44
  const contains = (value, comparator) => String(value).includes(comparator);
23
- export {
24
- checkEmpty,
25
- checkNotEmpty,
26
- contains,
27
- equal,
28
- greaterThan,
29
- greaterThanOrEquals,
30
- isIn,
31
- isNotIn,
32
- isNotNull,
33
- isNull,
34
- lessThanOrEquals,
35
- notEqual,
36
- startsWith,
37
- validDate
38
- };
39
- //# sourceMappingURL=operators.js.map
45
+
46
+ export { checkEmpty, checkNotEmpty, contains, equal, greaterThan, greaterThanOrEquals, isIn, isNotIn, isNotNull, isNull, lessThanOrEquals, notEqual, startsWith, validDate };
package/esm/platform.js CHANGED
@@ -1,8 +1,4 @@
1
- import * as React from "react";
2
- const DOCUMENT = typeof document !== "undefined" ? document : null;
3
- const WINDOW = typeof window !== "undefined" ? window : null;
4
- export {
5
- DOCUMENT,
6
- WINDOW
7
- };
8
- //# sourceMappingURL=platform.js.map
1
+ const DOCUMENT = typeof document !== 'undefined' ? document : null;
2
+ const WINDOW = typeof window !== 'undefined' ? window : null;
3
+
4
+ export { DOCUMENT, WINDOW };
@@ -1,29 +1,22 @@
1
- import * as React from "react";
2
- import React2 from "react";
1
+ import React from 'react';
2
+
3
3
  function isClassComponent(component) {
4
- return !!(typeof component === "function" && !!component.prototype.isReactComponent);
4
+ return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
5
5
  }
6
6
  function isFunctionComponent(component) {
7
- return typeof component === "function" && String(component).includes("return React.createElement");
7
+ return typeof component === 'function' && String(component).includes('return React.createElement');
8
8
  }
9
9
  function isReactComponent(component) {
10
10
  return !!(isClassComponent(component) || isFunctionComponent(component));
11
11
  }
12
12
  function isElement(element) {
13
- return React2.isValidElement(element);
13
+ return /*#__PURE__*/React.isValidElement(element);
14
14
  }
15
15
  function isDOMTypeElement(element) {
16
- return isElement(element) && typeof element.type === "string";
16
+ return isElement(element) && typeof element.type === 'string';
17
17
  }
18
18
  function isCompositeTypeElement(element) {
19
- return isElement(element) && typeof element.type === "function";
19
+ return isElement(element) && typeof element.type === 'function';
20
20
  }
21
- export {
22
- isClassComponent,
23
- isCompositeTypeElement,
24
- isDOMTypeElement,
25
- isElement,
26
- isFunctionComponent,
27
- isReactComponent
28
- };
29
- //# sourceMappingURL=reactTypesUtility.js.map
21
+
22
+ export { isClassComponent, isCompositeTypeElement, isDOMTypeElement, isElement, isFunctionComponent, isReactComponent };
@@ -1,17 +1,20 @@
1
- import * as React from "react";
2
- const resetTimer = (func) => {
1
+ function resetTimer(func) {
3
2
  let timeout;
4
- return function(...args) {
3
+ return function () {
4
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5
+ args[_key] = arguments[_key];
6
+ }
7
+
5
8
  const context = this;
9
+
6
10
  const lastCall = () => {
7
11
  timeout = null;
8
12
  func.apply(context, args);
9
13
  };
14
+
10
15
  clearTimeout(timeout);
11
16
  timeout = setTimeout(lastCall, 300);
12
17
  };
13
- };
14
- export {
15
- resetTimer
16
- };
17
- //# sourceMappingURL=scrollingTimer.js.map
18
+ }
19
+
20
+ export { resetTimer };
package/esm/system.js CHANGED
@@ -1,5 +1,14 @@
1
- import * as React from "react";
2
- import { isFunction } from "./utils";
1
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
2
+ import 'core-js/modules/esnext.iterator.constructor.js';
3
+ import 'core-js/modules/esnext.iterator.for-each.js';
4
+ import 'core-js/modules/esnext.async-iterator.filter.js';
5
+ import 'core-js/modules/esnext.iterator.filter.js';
6
+ import '@babel/runtime/helpers/esm/defineProperty';
7
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
8
+ import 'core-js/modules/esnext.iterator.reduce.js';
9
+ import 'core-js/modules/web.dom-collections.iterator.js';
10
+ import { isFunction } from 'lodash';
11
+
3
12
  const setRef = (ref, value) => {
4
13
  if (isFunction(ref)) {
5
14
  ref(value);
@@ -7,11 +16,14 @@ const setRef = (ref, value) => {
7
16
  ref.current = value;
8
17
  }
9
18
  };
10
- function mergeRefs(...refs) {
11
- return (node) => {
12
- if (!node)
13
- return;
14
- refs.forEach((ref) => {
19
+ function mergeRefs() {
20
+ for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
21
+ refs[_key] = arguments[_key];
22
+ }
23
+
24
+ return node => {
25
+ if (!node) return;
26
+ refs.forEach(ref => {
15
27
  if (isFunction(ref)) {
16
28
  ref(node);
17
29
  } else if (ref) {
@@ -20,12 +32,6 @@ function mergeRefs(...refs) {
20
32
  });
21
33
  };
22
34
  }
23
- function logger(...args) {
24
- console.log(...args);
25
- }
26
- export {
27
- logger,
28
- mergeRefs,
29
- setRef
30
- };
31
- //# sourceMappingURL=system.js.map
35
+ function logger() {}
36
+
37
+ export { logger, mergeRefs, setRef };
package/esm/timeUtils.js CHANGED
@@ -1,14 +1,20 @@
1
- import * as React from "react";
2
- import { padStart } from "./utils";
3
- const getVisibleTimeByFormat = (format) => ({
4
- showHours: format.indexOf("H") > -1 || format.indexOf("h") > -1 || format.indexOf("k") > -1,
5
- showMinutes: format.indexOf("m") > -1,
6
- showSeconds: format.indexOf("s") > -1,
7
- use12Hours: format.indexOf("A") > -1 || format.indexOf("h") > -1 || format.indexOf("a") > -1
1
+ import 'core-js/modules/esnext.async-iterator.filter.js';
2
+ import 'core-js/modules/esnext.iterator.filter.js';
3
+ import '@babel/runtime/helpers/esm/defineProperty';
4
+ import 'core-js/modules/esnext.async-iterator.reduce.js';
5
+ import 'core-js/modules/esnext.iterator.constructor.js';
6
+ import 'core-js/modules/esnext.iterator.reduce.js';
7
+ import 'core-js/modules/web.dom-collections.iterator.js';
8
+ import 'core-js/modules/esnext.async-iterator.for-each.js';
9
+ import 'core-js/modules/esnext.iterator.for-each.js';
10
+ import { padStart } from 'lodash';
11
+
12
+ const getVisibleTimeByFormat = format => ({
13
+ showHours: format.indexOf('H') > -1 || format.indexOf('h') > -1 || format.indexOf('k') > -1,
14
+ showMinutes: format.indexOf('m') > -1,
15
+ showSeconds: format.indexOf('s') > -1,
16
+ use12Hours: format.indexOf('A') > -1 || format.indexOf('h') > -1 || format.indexOf('a') > -1
8
17
  });
9
- const addLeadingZeros = (count) => (number) => padStart(String(number), count, "0");
10
- export {
11
- addLeadingZeros,
12
- getVisibleTimeByFormat
13
- };
14
- //# sourceMappingURL=timeUtils.js.map
18
+ const addLeadingZeros = count => number => padStart(String(number), count, '0');
19
+
20
+ export { addLeadingZeros, getVisibleTimeByFormat };