@elliemae/ds-utilities 2.2.0-alpha.3 → 3.0.0-next.0
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/cjs/capitalize.js +7 -35
- package/cjs/compose.js +32 -39
- package/cjs/getComponentFromProps.js +29 -47
- package/cjs/hooks/index.js +60 -68
- package/cjs/hooks/useCancellableDelayedCallback.js +18 -43
- package/cjs/hooks/useDerivedStateFromProps.js +36 -47
- package/cjs/hooks/useExecutionTimer.js +24 -43
- package/cjs/hooks/useExpandState.js +82 -69
- package/cjs/hooks/useHotkeys.js +24 -44
- package/cjs/hooks/useHoverHandlersDelay.js +18 -48
- package/cjs/hooks/useOnElementResize.js +27 -44
- package/cjs/hooks/useParentElement.js +13 -40
- package/cjs/hooks/usePrevious.js +10 -41
- package/cjs/hooks/useResizeObserver.js +25 -52
- package/cjs/hooks/useSetRef.js +11 -38
- package/cjs/hooks/useShouldRecalculate.js +14 -41
- package/cjs/hooks/useWindowScrollerList.js +33 -51
- package/cjs/hooks/useWindowSize.js +19 -49
- package/cjs/index.js +266 -145
- package/cjs/onClickHandlerForNonInteractiveElements.js +19 -46
- package/cjs/operators.js +51 -56
- package/cjs/platform.js +9 -37
- package/cjs/reactTypesUtility.js +22 -45
- package/cjs/scrollingTimer.js +15 -37
- package/cjs/system.js +30 -47
- package/cjs/timeUtils.js +24 -42
- package/cjs/utils.js +237 -101
- package/cjs/validations.js +35 -48
- package/esm/capitalize.js +3 -6
- package/esm/compose.js +29 -11
- package/esm/getComponentFromProps.js +22 -18
- package/esm/hooks/index.js +18 -40
- package/esm/hooks/useCancellableDelayedCallback.js +14 -12
- package/esm/hooks/useDerivedStateFromProps.js +31 -15
- package/esm/hooks/useExecutionTimer.js +20 -12
- package/esm/hooks/useExpandState.js +72 -36
- package/esm/hooks/useHotkeys.js +14 -11
- package/esm/hooks/useHoverHandlersDelay.js +12 -15
- package/esm/hooks/useOnElementResize.js +20 -12
- package/esm/hooks/useParentElement.js +7 -9
- package/esm/hooks/usePrevious.js +6 -10
- package/esm/hooks/useResizeObserver.js +15 -20
- package/esm/hooks/useSetRef.js +6 -8
- package/esm/hooks/useShouldRecalculate.js +11 -11
- package/esm/hooks/useWindowScrollerList.js +29 -20
- package/esm/hooks/useWindowSize.js +15 -18
- package/esm/index.js +31 -204
- package/esm/onClickHandlerForNonInteractiveElements.js +17 -17
- package/esm/operators.js +34 -27
- package/esm/platform.js +4 -8
- package/esm/reactTypesUtility.js +9 -16
- package/esm/scrollingTimer.js +11 -8
- package/esm/system.js +22 -16
- package/esm/timeUtils.js +19 -13
- package/esm/utils.js +72 -109
- package/esm/validations.js +28 -18
- package/package.json +1 -1
- package/types/compose.d.ts +1 -2
- package/types/getComponentFromProps.d.ts +1 -2
- package/types/hooks/index.d.ts +14 -14
- package/types/hooks/useCancellableDelayedCallback.d.ts +1 -2
- package/types/hooks/useDerivedStateFromProps.d.ts +1 -2
- package/types/hooks/useExecutionTimer.d.ts +1 -2
- package/types/hooks/useExpandState.d.ts +2 -3
- package/types/hooks/useHotkeys.d.ts +2 -3
- package/types/hooks/useHoverHandlersDelay.d.ts +2 -3
- package/types/hooks/usePrevious.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +1 -2
- package/types/hooks/useShouldRecalculate.d.ts +1 -2
- package/types/hooks/useWindowScrollerList.d.ts +2 -3
- package/types/hooks/useWindowSize.d.ts +1 -2
- package/types/index.d.ts +11 -11
- package/types/onClickHandlerForNonInteractiveElements.d.ts +7 -7
- package/types/scrollingTimer.d.ts +1 -1
- package/cjs/capitalize.js.map +0 -7
- package/cjs/compose.js.map +0 -7
- package/cjs/getComponentFromProps.js.map +0 -7
- package/cjs/hooks/index.js.map +0 -7
- package/cjs/hooks/useCancellableDelayedCallback.js.map +0 -7
- package/cjs/hooks/useDerivedStateFromProps.js.map +0 -7
- package/cjs/hooks/useExecutionTimer.js.map +0 -7
- package/cjs/hooks/useExpandState.js.map +0 -7
- package/cjs/hooks/useHotkeys.js.map +0 -7
- package/cjs/hooks/useHoverHandlersDelay.js.map +0 -7
- package/cjs/hooks/useOnElementResize.js.map +0 -7
- package/cjs/hooks/useParentElement.js.map +0 -7
- package/cjs/hooks/usePrevious.js.map +0 -7
- package/cjs/hooks/useResizeObserver.js.map +0 -7
- package/cjs/hooks/useSetRef.js.map +0 -7
- package/cjs/hooks/useShouldRecalculate.js.map +0 -7
- package/cjs/hooks/useWindowScrollerList.js.map +0 -7
- package/cjs/hooks/useWindowSize.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/onClickHandlerForNonInteractiveElements.js.map +0 -7
- package/cjs/operators.js.map +0 -7
- package/cjs/platform.js.map +0 -7
- package/cjs/reactTypesUtility.js.map +0 -7
- package/cjs/scrollingTimer.js.map +0 -7
- package/cjs/system.js.map +0 -7
- package/cjs/timeUtils.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/cjs/validations.js.map +0 -7
- package/esm/capitalize.js.map +0 -7
- package/esm/compose.js.map +0 -7
- package/esm/getComponentFromProps.js.map +0 -7
- package/esm/hooks/index.js.map +0 -7
- package/esm/hooks/useCancellableDelayedCallback.js.map +0 -7
- package/esm/hooks/useDerivedStateFromProps.js.map +0 -7
- package/esm/hooks/useExecutionTimer.js.map +0 -7
- package/esm/hooks/useExpandState.js.map +0 -7
- package/esm/hooks/useHotkeys.js.map +0 -7
- package/esm/hooks/useHoverHandlersDelay.js.map +0 -7
- package/esm/hooks/useOnElementResize.js.map +0 -7
- package/esm/hooks/useParentElement.js.map +0 -7
- package/esm/hooks/usePrevious.js.map +0 -7
- package/esm/hooks/useResizeObserver.js.map +0 -7
- package/esm/hooks/useSetRef.js.map +0 -7
- package/esm/hooks/useShouldRecalculate.js.map +0 -7
- package/esm/hooks/useWindowScrollerList.js.map +0 -7
- package/esm/hooks/useWindowSize.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/onClickHandlerForNonInteractiveElements.js.map +0 -7
- package/esm/operators.js.map +0 -7
- package/esm/platform.js.map +0 -7
- package/esm/reactTypesUtility.js.map +0 -7
- package/esm/scrollingTimer.js.map +0 -7
- package/esm/system.js.map +0 -7
- package/esm/timeUtils.js.map +0 -7
- package/esm/utils.js.map +0 -7
- package/esm/validations.js.map +0 -7
package/esm/index.js
CHANGED
|
@@ -1,204 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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:
|
|
10
|
+
onKeyPress: event => {
|
|
7
11
|
event.stopPropagation();
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const {
|
|
13
|
+
keycode,
|
|
14
|
+
key
|
|
15
|
+
} = event;
|
|
16
|
+
if (key === 'Enter') onClickHandler(event);else if (keycode === 13) onClickHandler(event);
|
|
13
17
|
}
|
|
14
|
-
});
|
|
15
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
16
|
-
const isNotNull =
|
|
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
|
-
|
|
24
|
-
|
|
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
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
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 };
|
package/esm/reactTypesUtility.js
CHANGED
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
3
|
function isClassComponent(component) {
|
|
4
|
-
return !!(typeof component ===
|
|
4
|
+
return !!(typeof component === 'function' && !!component.prototype.isReactComponent);
|
|
5
5
|
}
|
|
6
6
|
function isFunctionComponent(component) {
|
|
7
|
-
return typeof component ===
|
|
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
|
|
13
|
+
return /*#__PURE__*/React.isValidElement(element);
|
|
14
14
|
}
|
|
15
15
|
function isDOMTypeElement(element) {
|
|
16
|
-
return isElement(element) && typeof element.type ===
|
|
16
|
+
return isElement(element) && typeof element.type === 'string';
|
|
17
17
|
}
|
|
18
18
|
function isCompositeTypeElement(element) {
|
|
19
|
-
return isElement(element) && typeof element.type ===
|
|
19
|
+
return isElement(element) && typeof element.type === 'function';
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
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 };
|
package/esm/scrollingTimer.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
const resetTimer = (func) => {
|
|
1
|
+
function resetTimer(func) {
|
|
3
2
|
let timeout;
|
|
4
|
-
return function(
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=scrollingTimer.js.map
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { resetTimer };
|
package/esm/system.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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(
|
|
24
|
-
|
|
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
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
getVisibleTimeByFormat
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=timeUtils.js.map
|
|
18
|
+
const addLeadingZeros = count => number => padStart(String(number), count, '0');
|
|
19
|
+
|
|
20
|
+
export { addLeadingZeros, getVisibleTimeByFormat };
|