@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/utils.js
CHANGED
|
@@ -1,136 +1,99 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
differenceBy,
|
|
35
|
-
differenceWith,
|
|
36
|
-
isEqualWith,
|
|
37
|
-
curry,
|
|
38
|
-
isObject,
|
|
39
|
-
isBoolean
|
|
40
|
-
} from "lodash";
|
|
41
|
-
const cx = (...classnames) => classnames.reduce((result, cn) => `${result} ${cn || ""}`, "");
|
|
42
|
-
const toggleInObject = (obj, key, value) => obj[key] !== void 0 ? omit(obj, [key]) : { ...obj, [key]: value };
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
|
+
import _defineProperty from '@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 { omit, cloneDeep, isFunction } from 'lodash';
|
|
11
|
+
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';
|
|
12
|
+
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
/**
|
|
17
|
+
* Concatenates classNames from arguments
|
|
18
|
+
*
|
|
19
|
+
* @param {...any} classnames
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const cx = function () {
|
|
23
|
+
for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24
|
+
classnames[_key] = arguments[_key];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return classnames.reduce((result, cn) => "".concat(result, " ").concat(cn || ''), '');
|
|
28
|
+
}; // if entry exists, remove it, if not, add it
|
|
29
|
+
|
|
30
|
+
const toggleInObject = (obj, key, value) => obj[key] !== undefined ? omit(obj, [key]) : _objectSpread(_objectSpread({}, obj), {}, {
|
|
31
|
+
[key]: value
|
|
32
|
+
});
|
|
33
|
+
|
|
43
34
|
const toggleInArray = (array, value) => array.indexOf(value) === -1 ? [value] : [];
|
|
35
|
+
|
|
44
36
|
const arrayMoveMutate = (array, from, to) => {
|
|
45
37
|
array.splice(to < 0 ? array.length + to : to, 0, array.splice(from, 1)[0]);
|
|
46
38
|
};
|
|
39
|
+
|
|
47
40
|
const arrayMove = (array, from, to) => {
|
|
48
41
|
array = array.slice();
|
|
49
42
|
arrayMoveMutate(array, from, to);
|
|
50
43
|
return array;
|
|
51
44
|
};
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
45
|
+
|
|
46
|
+
const accessorDefault = item => item;
|
|
47
|
+
|
|
48
|
+
const addOrRemove = function (array, item) {
|
|
49
|
+
let accessor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : accessorDefault;
|
|
50
|
+
const index = array.findIndex(iItem => accessor(iItem) === accessor(item));
|
|
51
|
+
|
|
55
52
|
if (index !== -1) {
|
|
56
53
|
const nextArray = cloneDeep(array);
|
|
57
54
|
nextArray.splice(index, 1);
|
|
58
55
|
return nextArray;
|
|
59
56
|
}
|
|
57
|
+
|
|
60
58
|
return [...array, item];
|
|
61
59
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
|
|
61
|
+
function runAll() {
|
|
62
|
+
for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
63
|
+
fns[_key2] = arguments[_key2];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return function () {
|
|
67
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
68
|
+
args[_key3] = arguments[_key3];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return fns.forEach(fn => {
|
|
72
|
+
if (Array.isArray(fn)) runAll(fn);
|
|
73
|
+
if (isFunction(fn)) fn(...args);
|
|
74
|
+
});
|
|
75
|
+
};
|
|
69
76
|
}
|
|
70
77
|
function hashArray(arr, fieldName) {
|
|
71
|
-
return arr.reduce((result, item) => ({
|
|
72
|
-
...result,
|
|
78
|
+
return arr.reduce((result, item) => _objectSpread(_objectSpread({}, result), {}, {
|
|
73
79
|
[fieldName ? item[fieldName] : item]: true
|
|
74
80
|
}), {});
|
|
75
81
|
}
|
|
76
|
-
function safeCall(fun
|
|
82
|
+
function safeCall(fun) {
|
|
77
83
|
if (isFunction(fun)) {
|
|
84
|
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
85
|
+
args[_key4 - 1] = arguments[_key4];
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
fun(...args);
|
|
79
89
|
}
|
|
80
90
|
}
|
|
81
|
-
const removeUndefinedProperties =
|
|
82
|
-
const cleanObject = {
|
|
83
|
-
|
|
91
|
+
const removeUndefinedProperties = obj => {
|
|
92
|
+
const cleanObject = _objectSpread({}, obj);
|
|
93
|
+
|
|
94
|
+
Object.keys(obj).forEach(key => cleanObject[key] === undefined && delete cleanObject[key]);
|
|
84
95
|
return cleanObject;
|
|
85
96
|
};
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
arrayMove,
|
|
90
|
-
cloneDeep,
|
|
91
|
-
curry,
|
|
92
|
-
cx,
|
|
93
|
-
debounce,
|
|
94
|
-
utils_default as default,
|
|
95
|
-
differenceBy,
|
|
96
|
-
differenceWith,
|
|
97
|
-
filter,
|
|
98
|
-
findIndex,
|
|
99
|
-
get,
|
|
100
|
-
groupBy,
|
|
101
|
-
hashArray,
|
|
102
|
-
isBoolean,
|
|
103
|
-
isEmpty,
|
|
104
|
-
isEqual,
|
|
105
|
-
isEqualWith,
|
|
106
|
-
isFunction,
|
|
107
|
-
isNaN,
|
|
108
|
-
isObject,
|
|
109
|
-
isString,
|
|
110
|
-
maxBy,
|
|
111
|
-
meanBy,
|
|
112
|
-
noop,
|
|
113
|
-
omit,
|
|
114
|
-
orderBy,
|
|
115
|
-
padStart,
|
|
116
|
-
parseInt,
|
|
117
|
-
pick,
|
|
118
|
-
pickBy,
|
|
119
|
-
property,
|
|
120
|
-
pull,
|
|
121
|
-
range,
|
|
122
|
-
removeUndefinedProperties,
|
|
123
|
-
runAll,
|
|
124
|
-
safeCall,
|
|
125
|
-
set,
|
|
126
|
-
sortBy,
|
|
127
|
-
sumBy,
|
|
128
|
-
throttle,
|
|
129
|
-
toggleInArray,
|
|
130
|
-
toggleInObject,
|
|
131
|
-
transform,
|
|
132
|
-
uniq,
|
|
133
|
-
uniqBy,
|
|
134
|
-
values
|
|
135
|
-
};
|
|
136
|
-
//# sourceMappingURL=utils.js.map
|
|
97
|
+
var utils = {};
|
|
98
|
+
|
|
99
|
+
export { addOrRemove, arrayMove, cx, utils as default, hashArray, removeUndefinedProperties, runAll, safeCall, toggleInArray, toggleInObject };
|
package/esm/validations.js
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const isRequired =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
help
|
|
1
|
+
import { checkNotEmpty, greaterThan, validDate } from './operators.js';
|
|
2
|
+
|
|
3
|
+
const isRequired = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
value,
|
|
6
|
+
help = 'Field is Required'
|
|
7
|
+
} = _ref;
|
|
8
|
+
return {
|
|
9
|
+
payload: help,
|
|
10
|
+
error: checkNotEmpty(value)
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const isGreaterThan = _ref2 => {
|
|
14
|
+
let {
|
|
15
|
+
value,
|
|
16
|
+
help,
|
|
17
|
+
comparator = 0
|
|
18
|
+
} = _ref2;
|
|
19
|
+
if (!help) help = "Max value ".concat(comparator);
|
|
10
20
|
return {
|
|
11
21
|
payload: help,
|
|
12
22
|
error: greaterThan(value, comparator)
|
|
13
23
|
};
|
|
14
24
|
};
|
|
15
|
-
const isValidDate =
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
const isValidDate = _ref3 => {
|
|
26
|
+
let {
|
|
27
|
+
value,
|
|
28
|
+
help,
|
|
29
|
+
format = 'MM/DD/AAA'
|
|
30
|
+
} = _ref3;
|
|
31
|
+
if (!help) help = "Valid Date is required ".concat(format);
|
|
18
32
|
return {
|
|
19
33
|
payload: help,
|
|
20
34
|
error: !validDate(value)
|
|
21
35
|
};
|
|
22
36
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
isRequired,
|
|
26
|
-
isValidDate
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=validations.js.map
|
|
37
|
+
|
|
38
|
+
export { isGreaterThan, isRequired, isValidDate };
|
package/package.json
CHANGED
package/types/compose.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
3
|
-
export default getComponentFromProps;
|
|
2
|
+
export default function getComponentFromProps(Component: any, props: any, children?: never[]): JSX.Element | null;
|
package/types/hooks/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export { default as useMeasure } from 'use-measure';
|
|
2
|
+
export { default as useExecutionTimer } from './useExecutionTimer';
|
|
3
|
+
export { default as useExpandState } from './useExpandState';
|
|
4
|
+
export { default as useHotkeys } from './useHotkeys';
|
|
5
|
+
export { default as useHoverHandlersDelay } from './useHoverHandlersDelay';
|
|
6
|
+
export { default as useResizeObserver } from './useResizeObserver';
|
|
7
|
+
export { default as useShouldRecalculate } from './useShouldRecalculate';
|
|
8
|
+
export { default as useWindowScrollerList } from './useWindowScrollerList';
|
|
9
|
+
export { default as useWindowSize } from './useWindowSize';
|
|
2
10
|
export { default as useForceUpdate } from 'use-force-update';
|
|
3
11
|
export { default as useOnClickOutside } from 'use-onclickoutside';
|
|
4
12
|
export { useUncontrolled } from 'uncontrollable';
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export { useWindowScrollerList } from './useWindowScrollerList';
|
|
12
|
-
export { useWindowSize } from './useWindowSize';
|
|
13
|
-
export { usePrevious } from './usePrevious';
|
|
14
|
-
export { useCancellableDelayedCallback } from './useCancellableDelayedCallback';
|
|
15
|
-
export { useDerivedStateFromProps } from './useDerivedStateFromProps';
|
|
16
|
-
export { useSetRef } from './useSetRef';
|
|
17
|
-
export { useParentElement } from './useParentElement';
|
|
18
|
-
export { useOnElementResize } from './useOnElementResize';
|
|
13
|
+
export { default as usePrevious } from './usePrevious';
|
|
14
|
+
export { default as useCancellableDelayedCallback } from './useCancellableDelayedCallback';
|
|
15
|
+
export { default as useDerivedStateFromProps } from './useDerivedStateFromProps';
|
|
16
|
+
export * from './useSetRef';
|
|
17
|
+
export * from './useParentElement';
|
|
18
|
+
export * from './useOnElementResize';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export default useCancellableDelayedCallback;
|
|
1
|
+
export default function useCancellableDelayedCallback(cb: any, delay: any): ((...args: any[]) => void)[];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export default useDerivedStateFromProps;
|
|
1
|
+
export default function useDerivedStateFromProp(prop: any, options?: {}): any[];
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export default useExecutionTimer;
|
|
1
|
+
export default function useExecutionDelay(startFn: any, cleanFn: any, delayTime: any): ((...args: any[]) => void)[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function useExpandState({ items, itemKey, expanded: expandedProp, onExpand, onExpandChange, onExpandAll, onToggleExpand, onCollapse, }: {
|
|
2
2
|
items?: never[] | undefined;
|
|
3
3
|
itemKey?: string | undefined;
|
|
4
4
|
expanded?: {} | undefined;
|
|
@@ -7,7 +7,7 @@ export declare const useExpandState: ({ items, itemKey, expanded: expandedProp,
|
|
|
7
7
|
onExpandAll?: (() => null) | undefined;
|
|
8
8
|
onToggleExpand: any;
|
|
9
9
|
onCollapse: any;
|
|
10
|
-
})
|
|
10
|
+
}): {
|
|
11
11
|
state: {
|
|
12
12
|
expanded: any;
|
|
13
13
|
isExpandedAll: boolean;
|
|
@@ -20,4 +20,3 @@ export declare const useExpandState: ({ items, itemKey, expanded: expandedProp,
|
|
|
20
20
|
};
|
|
21
21
|
setExpanded: any;
|
|
22
22
|
};
|
|
23
|
-
export default useExpandState;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function useHotkeys({ keys, handler, options }: {
|
|
2
2
|
keys: any;
|
|
3
3
|
handler: any;
|
|
4
4
|
options?: {} | undefined;
|
|
5
|
-
}, deps?: never[])
|
|
6
|
-
export default useHotkeys;
|
|
5
|
+
}, deps?: never[]): void;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function useHoverHandlersDelay({ onMouseOver, onMouseLeave, hideDelay, showDelay, }: {
|
|
2
2
|
onMouseOver: any;
|
|
3
3
|
onMouseLeave: any;
|
|
4
4
|
hideDelay?: number | undefined;
|
|
5
5
|
showDelay?: number | undefined;
|
|
6
|
-
})
|
|
6
|
+
}): {
|
|
7
7
|
onMouseOver: () => void;
|
|
8
8
|
onMouseLeave: () => void;
|
|
9
9
|
};
|
|
10
|
-
export default useHoverHandlersDelay;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
declare function usePrevious(value: any): undefined;
|
|
2
2
|
export default usePrevious;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export default useShouldRecalculate;
|
|
1
|
+
export default function useShouldRecalculate(bool: any): number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export default function useWindowScrollerList({ listInstance, outerListRef }: {
|
|
2
2
|
listInstance: any;
|
|
3
3
|
outerListRef: any;
|
|
4
|
-
})
|
|
5
|
-
export default useWindowScrollerList;
|
|
4
|
+
}): void;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export default useWindowSize;
|
|
1
|
+
export default function useWindowSize(): false | number[];
|
package/types/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export { default as getComponentFromProps } from './getComponentFromProps';
|
|
2
2
|
export { default as onClickHandlerForNonInteractiveElements } from './onClickHandlerForNonInteractiveElements';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
3
|
+
export * from './capitalize';
|
|
4
|
+
export * from './operators';
|
|
5
|
+
export * from './utils';
|
|
6
|
+
export * from './system';
|
|
7
|
+
export * from './hooks';
|
|
8
|
+
export * from './timeUtils';
|
|
9
|
+
export * from './compose';
|
|
10
|
+
export * from './platform';
|
|
11
|
+
export * from './reactTypesUtility';
|
|
12
|
+
export * from './scrollingTimer';
|
|
13
|
+
export * from './validations';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* onClickHandler: callback
|
|
3
|
-
*
|
|
4
|
-
* @param onClickHandler
|
|
5
|
-
*/
|
|
6
|
-
export declare const onClickHandlerForNonInteractiveElements: (onClickHandler: any) => {
|
|
1
|
+
declare const _default: (onClickHandler: any) => {
|
|
7
2
|
role: string;
|
|
8
3
|
tabIndex: string;
|
|
9
4
|
onClick: any;
|
|
10
5
|
onKeyPress: (event: any) => void;
|
|
11
6
|
};
|
|
12
|
-
|
|
7
|
+
/**
|
|
8
|
+
* onClickHandler: callback
|
|
9
|
+
*
|
|
10
|
+
* @param onClickHandler
|
|
11
|
+
*/
|
|
12
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare function resetTimer(func: any): (...args: any[]) => void;
|
package/cjs/capitalize.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/capitalize.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,GAAG,gBAAgB,OAAO,MAAM;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/compose.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/compose.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function. [From redux v4.0.5]\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\n\nexport const compose = (...funcs) => {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n};\n\nexport default compose;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADWhB,MAAM,UAAU,IAAI,UAAU;AACnC,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,CAAC,QAAQ;AAAA;AAGlB,MAAI,MAAM,WAAW,GAAG;AACtB,WAAO,MAAM;AAAA;AAGf,SAAO,MAAM,OAAO,CAAC,GAAG,MAAM,IAAI,SAAS,EAAE,EAAE,GAAG;AAAA;AAGpD,IAAO,kBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/getComponentFromProps.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable no-nested-ternary */\nimport React from 'react';\n\nexport const getComponentFromProps = (Component, props, children = []) => {\n if (!Component) return null;\n const componentChildren = Component.props\n ? Array.isArray(Component.props.children)\n ? Component.props.children\n : [Component.props.children]\n : null;\n return typeof Component === 'function' ? (\n <Component {...props}>{children}</Component>\n ) : (\n React.cloneElement(\n Component,\n {\n ...Component.props,\n ...props,\n },\n componentChildren ? [...componentChildren, ...children] : [...children],\n )\n );\n};\n\nexport default getComponentFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAEX,MAAM,wBAAwB,CAAC,WAAW,OAAO,WAAW,OAAO;AACxE,MAAI,CAAC;AAAW,WAAO;AACvB,QAAM,oBAAoB,UAAU,QAChC,MAAM,QAAQ,UAAU,MAAM,YAC5B,UAAU,MAAM,WAChB,CAAC,UAAU,MAAM,YACnB;AACJ,SAAO,OAAO,cAAc,aAC1B,mDAAC,WAAD;AAAA,OAAe;AAAA,KAAQ,YAEvB,qBAAM,aACJ,WACA;AAAA,OACK,UAAU;AAAA,OACV;AAAA,KAEL,oBAAoB,CAAC,GAAG,mBAAmB,GAAG,YAAY,CAAC,GAAG;AAAA;AAKpE,IAAO,gCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/cjs/hooks/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { default as useMeasure } from 'use-measure';\nexport { default as useForceUpdate } from 'use-force-update';\nexport { default as useOnClickOutside } from 'use-onclickoutside';\nexport { useUncontrolled } from 'uncontrollable';\nexport { useExecutionTimer } from './useExecutionTimer';\nexport { useExpandState } from './useExpandState';\nexport { useHotkeys } from './useHotkeys';\nexport { useHoverHandlersDelay } from './useHoverHandlersDelay';\nexport { useResizeObserver } from './useResizeObserver';\nexport { useShouldRecalculate } from './useShouldRecalculate';\nexport { useWindowScrollerList } from './useWindowScrollerList';\nexport { useWindowSize } from './useWindowSize';\nexport { usePrevious } from './usePrevious';\nexport { useCancellableDelayedCallback } from './useCancellableDelayedCallback';\nexport { useDerivedStateFromProps } from './useDerivedStateFromProps';\nexport { useSetRef } from './useSetRef';\nexport { useParentElement } from './useParentElement';\nexport { useOnElementResize } from './useOnElementResize';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAsC;AACtC,8BAA0C;AAC1C,gCAA6C;AAC7C,4BAAgC;AAChC,+BAAkC;AAClC,4BAA+B;AAC/B,wBAA2B;AAC3B,mCAAsC;AACtC,+BAAkC;AAClC,kCAAqC;AACrC,mCAAsC;AACtC,2BAA8B;AAC9B,yBAA4B;AAC5B,2CAA8C;AAC9C,sCAAyC;AACzC,uBAA0B;AAC1B,8BAAiC;AACjC,gCAAmC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useCancellableDelayedCallback.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useRef } from 'react';\n\nexport const useCancellableDelayedCallback = (cb, delay) => {\n const timeoutRef = useRef();\n const cancel = useCallback(() => {\n const timeoutId = timeoutRef.current;\n if (timeoutId) {\n timeoutRef.current = undefined;\n clearTimeout(timeoutId);\n }\n }, [timeoutRef]);\n const delayedCb = useCallback(\n (...args) => {\n timeoutRef.current = setTimeout(() => cb(...args), delay);\n },\n [cb, delay],\n );\n\n return [delayedCb, cancel];\n};\n\nexport default useCancellableDelayedCallback;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAE7B,MAAM,gCAAgC,CAAC,IAAI,UAAU;AAC1D,QAAM,aAAa;AACnB,QAAM,SAAS,8BAAY,MAAM;AAC/B,UAAM,YAAY,WAAW;AAC7B,QAAI,WAAW;AACb,iBAAW,UAAU;AACrB,mBAAa;AAAA;AAAA,KAEd,CAAC;AACJ,QAAM,YAAY,8BAChB,IAAI,SAAS;AACX,eAAW,UAAU,WAAW,MAAM,GAAG,GAAG,OAAO;AAAA,KAErD,CAAC,IAAI;AAGP,SAAO,CAAC,WAAW;AAAA;AAGrB,IAAO,wCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useDerivedStateFromProps.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useRef, useState } from 'react';\nimport { isEqual, isFunction } from '../utils';\n\nconst defaultPropUpdateOnChange = prop => prop;\n\nfunction defaultShouldUpdate({ prop, prevProp, stateValue }) {\n return !isEqual(prop, prevProp) && !isEqual(prop, stateValue);\n}\n\nfunction setStateWithUpdate(onUpdate, setState) {\n return state => {\n setState(prevState =>\n onUpdate(isFunction(state) ? state(prevState) : state, prevState),\n );\n };\n}\n\nexport const useDerivedStateFromProps = (prop, options = {}) => {\n const {\n onUpdate = defaultPropUpdateOnChange,\n shouldUpdate = defaultShouldUpdate,\n updateOnStateChange = false,\n } = options;\n\n const [stateValue, setState] = useState(onUpdate(prop, {}));\n const handleSetState = updateOnStateChange\n ? setStateWithUpdate(onUpdate, setState)\n : setState;\n const prevProp = useRef(prop);\n\n if (\n shouldUpdate({\n prop,\n prevProp: prevProp.current,\n stateValue,\n })\n ) {\n const nextProp = onUpdate(prop, prevProp.current);\n setState(nextProp);\n }\n prevProp.current = prop;\n return [stateValue, handleSetState];\n};\n\nexport default useDerivedStateFromProps;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAiC;AACjC,mBAAoC;AAEpC,MAAM,4BAA4B,UAAQ;AAE1C,6BAA6B,EAAE,MAAM,UAAU,cAAc;AAC3D,SAAO,CAAC,0BAAQ,MAAM,aAAa,CAAC,0BAAQ,MAAM;AAAA;AAGpD,4BAA4B,UAAU,UAAU;AAC9C,SAAO,WAAS;AACd,aAAS,eACP,SAAS,6BAAW,SAAS,MAAM,aAAa,OAAO;AAAA;AAAA;AAKtD,MAAM,2BAA2B,CAAC,MAAM,UAAU,OAAO;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,eAAe;AAAA,IACf,sBAAsB;AAAA,MACpB;AAEJ,QAAM,CAAC,YAAY,YAAY,2BAAS,SAAS,MAAM;AACvD,QAAM,iBAAiB,sBACnB,mBAAmB,UAAU,YAC7B;AACJ,QAAM,WAAW,yBAAO;AAExB,MACE,aAAa;AAAA,IACX;AAAA,IACA,UAAU,SAAS;AAAA,IACnB;AAAA,MAEF;AACA,UAAM,WAAW,SAAS,MAAM,SAAS;AACzC,aAAS;AAAA;AAEX,WAAS,UAAU;AACnB,SAAO,CAAC,YAAY;AAAA;AAGtB,IAAO,mCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useExecutionTimer.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useRef } from 'react';\n\nexport const useExecutionTimer = (startFn, cleanFn, delayTime) => {\n const startTimer = useRef();\n const closeTimer = useRef();\n\n const startFunction = (...args) => {\n clearTimeout(closeTimer.current);\n startTimer.current = setTimeout(() => startFn(...args), delayTime);\n };\n\n const cleanFunction = (...args) => {\n clearTimeout(startTimer.current);\n closeTimer.current = setTimeout(() => cleanFn(...args), 30);\n };\n return [startFunction, cleanFunction];\n};\n\nexport default useExecutionTimer;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAuB;AAEhB,MAAM,oBAAoB,CAAC,SAAS,SAAS,cAAc;AAChE,QAAM,aAAa;AACnB,QAAM,aAAa;AAEnB,QAAM,gBAAgB,IAAI,SAAS;AACjC,iBAAa,WAAW;AACxB,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,OAAO;AAAA;AAG1D,QAAM,gBAAgB,IAAI,SAAS;AACjC,iBAAa,WAAW;AACxB,eAAW,UAAU,WAAW,MAAM,QAAQ,GAAG,OAAO;AAAA;AAE1D,SAAO,CAAC,eAAe;AAAA;AAGzB,IAAO,4BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useExpandState.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useMemo } from 'react';\nimport { isFunction } from '../utils';\nimport { useDerivedStateFromProps } from './useDerivedStateFromProps';\n\nconst toggleStateInObject = (obj, key, value) => {\n const nextObj = { ...obj };\n if (nextObj[key]) {\n delete nextObj[key];\n } else {\n nextObj[key] = value;\n }\n return nextObj;\n};\n\nconst noop = () => null;\n\nexport const useExpandState = ({\n items = [],\n itemKey = 'id',\n expanded: expandedProp = {},\n onExpand,\n onExpandChange = noop,\n onExpandAll = noop,\n onToggleExpand,\n onCollapse,\n}) => {\n const [expanded, setExpanded] = useDerivedStateFromProps(expandedProp);\n\n const isExpandedAll = useMemo(\n () => Object.keys(expanded).length === items.length,\n [expanded, items],\n );\n\n const toggleExpandAll = (stateData = true) => {\n setExpanded(() => {\n const nextState = {};\n if (!isExpandedAll) {\n items.forEach(item => {\n nextState[item[itemKey]] = stateData;\n });\n }\n onExpandChange(nextState);\n onExpandAll(nextState);\n return nextState;\n });\n };\n\n const expand = (item, stateData = true) => {\n if (!item) return;\n if (isFunction(onExpand)) {\n onExpand(item);\n }\n setExpanded(prevState => {\n const key = item[itemKey];\n const nextState = { ...prevState, [key]: stateData };\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const toggleExpand = (item, stateData = true) => {\n if (isFunction(onToggleExpand)) {\n onToggleExpand(item);\n }\n setExpanded(prevState => {\n const key = item[itemKey];\n const nextState = toggleStateInObject(prevState, key, stateData);\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n const collapse = item => {\n if (isFunction(onCollapse)) {\n onCollapse(item);\n }\n setExpanded(prevState => {\n const nextState = { ...prevState };\n delete nextState[item[itemKey]];\n onExpandChange(nextState, item);\n return nextState;\n });\n };\n\n return {\n state: { expanded, isExpandedAll },\n actions: {\n expand,\n toggleExpandAll,\n toggleExpand,\n collapse,\n },\n setExpanded,\n };\n};\n\nexport default useExpandState;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAwB;AACxB,mBAA2B;AAC3B,sCAAyC;AAEzC,MAAM,sBAAsB,CAAC,KAAK,KAAK,UAAU;AAC/C,QAAM,UAAU,KAAK;AACrB,MAAI,QAAQ,MAAM;AAChB,WAAO,QAAQ;AAAA,SACV;AACL,YAAQ,OAAO;AAAA;AAEjB,SAAO;AAAA;AAGT,MAAM,OAAO,MAAM;AAEZ,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,UAAU,eAAe;AAAA,EACzB;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd;AAAA,EACA;AAAA,MACI;AACJ,QAAM,CAAC,UAAU,eAAe,8DAAyB;AAEzD,QAAM,gBAAgB,0BACpB,MAAM,OAAO,KAAK,UAAU,WAAW,MAAM,QAC7C,CAAC,UAAU;AAGb,QAAM,kBAAkB,CAAC,YAAY,SAAS;AAC5C,gBAAY,MAAM;AAChB,YAAM,YAAY;AAClB,UAAI,CAAC,eAAe;AAClB,cAAM,QAAQ,UAAQ;AACpB,oBAAU,KAAK,YAAY;AAAA;AAAA;AAG/B,qBAAe;AACf,kBAAY;AACZ,aAAO;AAAA;AAAA;AAIX,QAAM,SAAS,CAAC,MAAM,YAAY,SAAS;AACzC,QAAI,CAAC;AAAM;AACX,QAAI,6BAAW,WAAW;AACxB,eAAS;AAAA;AAEX,gBAAY,eAAa;AACvB,YAAM,MAAM,KAAK;AACjB,YAAM,YAAY,KAAK,YAAY,MAAM;AACzC,qBAAe,WAAW;AAC1B,aAAO;AAAA;AAAA;AAIX,QAAM,eAAe,CAAC,MAAM,YAAY,SAAS;AAC/C,QAAI,6BAAW,iBAAiB;AAC9B,qBAAe;AAAA;AAEjB,gBAAY,eAAa;AACvB,YAAM,MAAM,KAAK;AACjB,YAAM,YAAY,oBAAoB,WAAW,KAAK;AACtD,qBAAe,WAAW;AAC1B,aAAO;AAAA;AAAA;AAIX,QAAM,WAAW,UAAQ;AACvB,QAAI,6BAAW,aAAa;AAC1B,iBAAW;AAAA;AAEb,gBAAY,eAAa;AACvB,YAAM,YAAY,KAAK;AACvB,aAAO,UAAU,KAAK;AACtB,qBAAe,WAAW;AAC1B,aAAO;AAAA;AAAA;AAIX,SAAO;AAAA,IACL,OAAO,EAAE,UAAU;AAAA,IACnB,SAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,IAEF;AAAA;AAAA;AAIJ,IAAO,yBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useHotkeys.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import hotkeys from 'hotkeys-js';\nimport { useCallback, useEffect } from 'react';\n\nexport const useHotkeys = ({ keys, handler, options = {} }, deps = []) => {\n const memoizedCallback = useCallback(handler, deps);\n\n useEffect(() => {\n hotkeys(keys, options, memoizedCallback);\n\n return () => hotkeys.unbind(keys);\n }, [memoizedCallback]);\n};\n\nexport default useHotkeys;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAoB;AACpB,mBAAuC;AAEhC,MAAM,aAAa,CAAC,EAAE,MAAM,SAAS,UAAU,MAAM,OAAO,OAAO;AACxE,QAAM,mBAAmB,8BAAY,SAAS;AAE9C,8BAAU,MAAM;AACd,mCAAQ,MAAM,SAAS;AAEvB,WAAO,MAAM,0BAAQ,OAAO;AAAA,KAC3B,CAAC;AAAA;AAGN,IAAO,qBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useHoverHandlersDelay.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useCallback, useRef } from 'react';\n\nexport const useHoverHandlersDelay = ({\n onMouseOver,\n onMouseLeave,\n hideDelay = 300,\n showDelay = 300,\n}) => {\n const hideTimer = useRef();\n const showTimer = useRef();\n\n const delayedHide = useCallback(() => {\n clearTimeout(showTimer.current);\n hideTimer.current = setTimeout(onMouseLeave, hideDelay);\n }, []);\n\n const delayedShow = useCallback(() => {\n clearTimeout(hideTimer.current);\n showTimer.current = setTimeout(onMouseOver, showDelay);\n }, []);\n\n return {\n onMouseOver: delayedShow,\n onMouseLeave: delayedHide,\n };\n};\n\nexport default useHoverHandlersDelay;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAE7B,MAAM,wBAAwB,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,YAAY;AAAA,MACR;AACJ,QAAM,YAAY;AAClB,QAAM,YAAY;AAElB,QAAM,cAAc,8BAAY,MAAM;AACpC,iBAAa,UAAU;AACvB,cAAU,UAAU,WAAW,cAAc;AAAA,KAC5C;AAEH,QAAM,cAAc,8BAAY,MAAM;AACpC,iBAAa,UAAU;AACvB,cAAU,UAAU,WAAW,aAAa;AAAA,KAC3C;AAEH,SAAO;AAAA,IACL,aAAa;AAAA,IACb,cAAc;AAAA;AAAA;AAIlB,IAAO,gCAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useOnElementResize.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useEffect, useRef, useMemo } from 'react';\n\n// Custom hook to track dimension of a component\n// Taken and modified from https://stackoverflow.com/a/60218754\nexport const useOnElementResize = (targetRef: React.RefObject<HTMLDivElement>): Record<'width' | 'height', number> => {\n const [width, setWidth] = useState(targetRef.current ? targetRef.current?.offsetWidth : 0);\n const [height, setHeight] = useState(targetRef.current ? targetRef.current?.offsetWidth : 0);\n const observer = useRef(null);\n\n useEffect(() => {\n function outputsize() {\n setWidth(targetRef.current?.offsetWidth);\n setHeight(targetRef.current?.offsetHeight);\n }\n\n observer.current = new ResizeObserver(outputsize).observe(targetRef.current);\n\n return () => {\n observer.current?.disconnect();\n };\n }, [targetRef]);\n\n return useMemo(\n () => ({\n width,\n height,\n }),\n [width, height],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA4D;AAIrD,MAAM,qBAAqB,CAAC,cAAmF;AACpH,QAAM,CAAC,OAAO,YAAY,2BAAS,UAAU,UAAU,UAAU,SAAS,cAAc;AACxF,QAAM,CAAC,QAAQ,aAAa,2BAAS,UAAU,UAAU,UAAU,SAAS,cAAc;AAC1F,QAAM,WAAW,yBAAO;AAExB,8BAAU,MAAM;AACd,0BAAsB;AACpB,eAAS,UAAU,SAAS;AAC5B,gBAAU,UAAU,SAAS;AAAA;AAG/B,aAAS,UAAU,IAAI,eAAe,YAAY,QAAQ,UAAU;AAEpE,WAAO,MAAM;AACX,eAAS,SAAS;AAAA;AAAA,KAEnB,CAAC;AAEJ,SAAO,0BACL,MAAO;AAAA,IACL;AAAA,IACA;AAAA,MAEF,CAAC,OAAO;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useParentElement.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useState } from 'react';\n\nexport const useParentElement = (ref) => {\n const [parent, setParent] = useState(ref.current);\n\n useEffect(() => {\n if (ref.current) setParent(ref.current.parentNode);\n });\n return parent;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AAE7B,MAAM,mBAAmB,CAAC,QAAQ;AACvC,QAAM,CAAC,QAAQ,aAAa,2BAAS,IAAI;AAEzC,8BAAU,MAAM;AACd,QAAI,IAAI;AAAS,gBAAU,IAAI,QAAQ;AAAA;AAEzC,SAAO;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/usePrevious.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useRef } from 'react';\n\nexport const usePrevious = (value) => {\n const ref = useRef();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n\nexport default usePrevious;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkC;AAE3B,MAAM,cAAc,CAAC,UAAU;AACpC,QAAM,MAAM;AAEZ,8BAAU,MAAM;AACd,QAAI,UAAU;AAAA,KACb,CAAC;AAEJ,SAAO,IAAI;AAAA;AAGb,IAAO,sBAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useResizeObserver.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useState } from 'react';\nimport raf from 'raf';\nimport ResizeObserver from 'resize-observer-polyfill';\n\nexport const useResizeObserver = (handler, el) => {\n const [node, setRef] = useState(el);\n\n const resizeObserver = new ResizeObserver(entries => {\n if (!Array.isArray(entries)) return;\n if (!entries.length) return;\n const entry = entries[0];\n\n // execute on the next animation frame\n raf(() =>\n handler(\n {\n width: entry.target.offsetWidth,\n height: entry.target.offsetHeight,\n },\n entry.target,\n ),\n );\n });\n\n const htmlEl = el || node;\n\n useEffect(() => {\n if (htmlEl) resizeObserver.observe(htmlEl);\n return () => htmlEl && resizeObserver.unobserve(htmlEl);\n }, [htmlEl]);\n\n return [setRef];\n};\n\nexport default useResizeObserver;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAoC;AACpC,iBAAgB;AAChB,sCAA2B;AAEpB,MAAM,oBAAoB,CAAC,SAAS,OAAO;AAChD,QAAM,CAAC,MAAM,UAAU,2BAAS;AAEhC,QAAM,iBAAiB,IAAI,wCAAe,aAAW;AACnD,QAAI,CAAC,MAAM,QAAQ;AAAU;AAC7B,QAAI,CAAC,QAAQ;AAAQ;AACrB,UAAM,QAAQ,QAAQ;AAGtB,4BAAI,MACF,QACE;AAAA,MACE,OAAO,MAAM,OAAO;AAAA,MACpB,QAAQ,MAAM,OAAO;AAAA,OAEvB,MAAM;AAAA;AAKZ,QAAM,SAAS,MAAM;AAErB,8BAAU,MAAM;AACd,QAAI;AAAQ,qBAAe,QAAQ;AACnC,WAAO,MAAM,UAAU,eAAe,UAAU;AAAA,KAC/C,CAAC;AAEJ,SAAO,CAAC;AAAA;AAGV,IAAO,4BAAQ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|