@elliemae/ds-utilities 2.4.2-rc.12 → 2.4.2-rc.13
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/compose.js +0 -1
- package/cjs/getComponentFromProps.js +1 -2
- package/cjs/hooks/useCallbackAfterRender.js +1 -3
- package/cjs/hooks/useCancellableDelayedCallback.js +0 -1
- package/cjs/hooks/useDerivedStateFromProps.js +0 -1
- package/cjs/hooks/useExecutionTimer.js +0 -1
- package/cjs/hooks/useExpandState.js +0 -1
- package/cjs/hooks/useFocusTrap.js +7 -2
- package/cjs/hooks/useHotkeys.js +0 -1
- package/cjs/hooks/useIsShowingEllipsis.js +1 -2
- package/cjs/hooks/useOnElementResize.js +5 -12
- package/cjs/hooks/useParentElement.js +0 -1
- package/cjs/hooks/useResizeObserver.js +0 -1
- package/cjs/hooks/useWindowSize.js +0 -1
- package/cjs/operators.js +0 -1
- package/cjs/system.js +0 -1
- package/cjs/timeUtils.js +0 -1
- package/cjs/utils.js +1 -2
- package/cjs/validations.js +2 -2
- package/esm/compose.js +0 -1
- package/esm/getComponentFromProps.js +0 -1
- package/esm/hooks/useCallbackAfterRender.js +1 -3
- package/esm/hooks/useCancellableDelayedCallback.js +0 -1
- package/esm/hooks/useDerivedStateFromProps.js +0 -1
- package/esm/hooks/useExecutionTimer.js +0 -1
- package/esm/hooks/useExpandState.js +0 -1
- package/esm/hooks/useFocusTrap.js +7 -2
- package/esm/hooks/useHotkeys.js +0 -1
- package/esm/hooks/useIsShowingEllipsis.js +1 -2
- package/esm/hooks/useOnElementResize.js +5 -12
- package/esm/hooks/useParentElement.js +0 -1
- package/esm/hooks/useResizeObserver.js +0 -1
- package/esm/hooks/useWindowSize.js +0 -1
- package/esm/operators.js +0 -1
- package/esm/system.js +0 -1
- package/esm/timeUtils.js +0 -1
- package/esm/utils.js +1 -2
- package/esm/validations.js +2 -2
- package/package.json +1 -1
package/cjs/compose.js
CHANGED
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
6
6
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
7
|
require('core-js/modules/esnext.iterator.reduce.js');
|
|
8
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Composes single-argument functions from right to left. The rightmost
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
3
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
4
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
5
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
6
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
7
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
10
9
|
var React = require('react');
|
|
11
10
|
var jsxRuntime = require('react/jsx-runtime');
|
|
12
11
|
|
|
@@ -7,9 +7,7 @@ var React = require('react');
|
|
|
7
7
|
const useCallbackAfterRender = () => {
|
|
8
8
|
const lastRun = React.useRef(null);
|
|
9
9
|
React.useEffect(() => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
(_lastRun$current = lastRun.current) === null || _lastRun$current === void 0 ? void 0 : _lastRun$current.call(lastRun);
|
|
10
|
+
lastRun.current?.();
|
|
13
11
|
lastRun.current = null;
|
|
14
12
|
});
|
|
15
13
|
return callback => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
4
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
6
5
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
6
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/es.error.cause.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
7
8
|
|
|
@@ -19,11 +20,15 @@ const getVariableType = arg => {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
const throwTypeError = (validPropKey, invalidProp) => {
|
|
22
|
-
throw new Error(
|
|
23
|
+
throw new Error(`Warning: You are trying to pass a not valid "${validPropKey}" property to use a useFocusTrap hook, please provide a valid type.
|
|
24
|
+
|
|
25
|
+
Received: ${getVariableType(invalidProp)}
|
|
26
|
+
Expected: ${useFocusTrapProps[validPropKey]}
|
|
27
|
+
`);
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
const throwRequiredError = validPropKey => {
|
|
26
|
-
throw new Error(
|
|
31
|
+
throw new Error(`Warning: Please provide a "${validPropKey}" property to use a useFocusTrap hook, this property is required.`);
|
|
27
32
|
};
|
|
28
33
|
|
|
29
34
|
const validateProps = componentProps => {
|
package/cjs/hooks/useHotkeys.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
|
|
8
7
|
const useIsShowingEllipsis = () => {
|
|
@@ -12,7 +11,7 @@ const useIsShowingEllipsis = () => {
|
|
|
12
11
|
if (entries.length) {
|
|
13
12
|
const [textWrapperEntry] = entries;
|
|
14
13
|
const el = textWrapperEntry.target;
|
|
15
|
-
setIsShowingEllipsis(
|
|
14
|
+
setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
|
|
16
15
|
}
|
|
17
16
|
}), []);
|
|
18
17
|
React.useEffect(() => {
|
|
@@ -2,31 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
|
|
8
7
|
// Taken and modified from https://stackoverflow.com/a/60218754
|
|
9
8
|
|
|
10
9
|
const useOnElementResize = targetRef => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const [width, setWidth] = React.useState((_targetRef$current$of = (_targetRef$current = targetRef.current) === null || _targetRef$current === void 0 ? void 0 : _targetRef$current.offsetWidth) !== null && _targetRef$current$of !== void 0 ? _targetRef$current$of : 0);
|
|
14
|
-
const [height, setHeight] = React.useState((_targetRef$current$of2 = (_targetRef$current2 = targetRef.current) === null || _targetRef$current2 === void 0 ? void 0 : _targetRef$current2.offsetHeight) !== null && _targetRef$current$of2 !== void 0 ? _targetRef$current$of2 : 0);
|
|
10
|
+
const [width, setWidth] = React.useState(targetRef.current?.offsetWidth ?? 0);
|
|
11
|
+
const [height, setHeight] = React.useState(targetRef.current?.offsetHeight ?? 0);
|
|
15
12
|
const observer = React.useRef();
|
|
16
13
|
React.useEffect(() => {
|
|
17
14
|
function outputsize() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
setWidth((_targetRef$current$of3 = (_targetRef$current3 = targetRef.current) === null || _targetRef$current3 === void 0 ? void 0 : _targetRef$current3.offsetWidth) !== null && _targetRef$current$of3 !== void 0 ? _targetRef$current$of3 : 0);
|
|
21
|
-
setHeight((_targetRef$current$of4 = (_targetRef$current4 = targetRef.current) === null || _targetRef$current4 === void 0 ? void 0 : _targetRef$current4.offsetHeight) !== null && _targetRef$current$of4 !== void 0 ? _targetRef$current$of4 : 0);
|
|
15
|
+
setWidth(targetRef.current?.offsetWidth ?? 0);
|
|
16
|
+
setHeight(targetRef.current?.offsetHeight ?? 0);
|
|
22
17
|
}
|
|
23
18
|
|
|
24
19
|
observer.current = new ResizeObserver(outputsize);
|
|
25
20
|
observer.current.observe(targetRef.current);
|
|
26
21
|
return () => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
(_observer$current = observer.current) === null || _observer$current === void 0 ? void 0 : _observer$current.disconnect();
|
|
22
|
+
observer.current?.disconnect();
|
|
30
23
|
};
|
|
31
24
|
}, [targetRef]);
|
|
32
25
|
return React.useMemo(() => ({
|
package/cjs/operators.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
require('core-js/modules/esnext.async-iterator.map.js');
|
|
7
6
|
require('core-js/modules/esnext.iterator.map.js');
|
|
8
7
|
var lodash = require('lodash');
|
package/cjs/system.js
CHANGED
|
@@ -8,7 +8,6 @@ require('core-js/modules/esnext.iterator.for-each.js');
|
|
|
8
8
|
require('@babel/runtime/helpers/defineProperty');
|
|
9
9
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
10
10
|
require('core-js/modules/esnext.iterator.reduce.js');
|
|
11
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
12
11
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
13
12
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
14
13
|
var lodash = require('lodash');
|
package/cjs/timeUtils.js
CHANGED
|
@@ -6,7 +6,6 @@ require('@babel/runtime/helpers/defineProperty');
|
|
|
6
6
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
7
7
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
8
|
require('core-js/modules/esnext.iterator.reduce.js');
|
|
9
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
9
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
10
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
12
11
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
package/cjs/utils.js
CHANGED
|
@@ -6,7 +6,6 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
6
6
|
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
7
7
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
8
|
require('core-js/modules/esnext.iterator.reduce.js');
|
|
9
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
10
9
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
10
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
12
11
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
@@ -31,7 +30,7 @@ const cx = function () {
|
|
|
31
30
|
classnames[_key] = arguments[_key];
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
return classnames.reduce((result, cn) =>
|
|
33
|
+
return classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');
|
|
35
34
|
}; // if entry exists, remove it, if not, add it
|
|
36
35
|
|
|
37
36
|
const toggleInObject = (obj, key, value) => obj[key] !== undefined ? lodash.omit(obj, [key]) : _objectSpread(_objectSpread({}, obj), {}, {
|
package/cjs/validations.js
CHANGED
|
@@ -20,7 +20,7 @@ const isGreaterThan = _ref2 => {
|
|
|
20
20
|
help,
|
|
21
21
|
comparator = 0
|
|
22
22
|
} = _ref2;
|
|
23
|
-
if (!help) help =
|
|
23
|
+
if (!help) help = `Max value ${comparator}`;
|
|
24
24
|
return {
|
|
25
25
|
payload: help,
|
|
26
26
|
error: operators.greaterThan(value, comparator)
|
|
@@ -32,7 +32,7 @@ const isValidDate = _ref3 => {
|
|
|
32
32
|
help,
|
|
33
33
|
format = 'MM/DD/AAA'
|
|
34
34
|
} = _ref3;
|
|
35
|
-
if (!help) help =
|
|
35
|
+
if (!help) help = `Valid Date is required ${format}`;
|
|
36
36
|
return {
|
|
37
37
|
payload: help,
|
|
38
38
|
error: !operators.validDate(value)
|
package/esm/compose.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
3
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Composes single-argument functions from right to left. The rightmost
|
|
@@ -4,7 +4,6 @@ import 'core-js/modules/esnext.iterator.filter.js';
|
|
|
4
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
7
|
import React from 'react';
|
|
9
8
|
import { jsx } from 'react/jsx-runtime';
|
|
10
9
|
|
|
@@ -3,9 +3,7 @@ import { useRef, useEffect } from 'react';
|
|
|
3
3
|
const useCallbackAfterRender = () => {
|
|
4
4
|
const lastRun = useRef(null);
|
|
5
5
|
useEffect(() => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(_lastRun$current = lastRun.current) === null || _lastRun$current === void 0 ? void 0 : _lastRun$current.call(lastRun);
|
|
6
|
+
lastRun.current?.();
|
|
9
7
|
lastRun.current = null;
|
|
10
8
|
});
|
|
11
9
|
return callback => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
2
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
3
3
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
6
5
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
6
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import 'core-js/modules/es.error.cause.js';
|
|
1
2
|
import { useEffect, useCallback } from 'react';
|
|
2
3
|
import { PropTypes, describe } from '@elliemae/ds-props-helpers';
|
|
3
4
|
|
|
@@ -15,11 +16,15 @@ const getVariableType = arg => {
|
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const throwTypeError = (validPropKey, invalidProp) => {
|
|
18
|
-
throw new Error(
|
|
19
|
+
throw new Error(`Warning: You are trying to pass a not valid "${validPropKey}" property to use a useFocusTrap hook, please provide a valid type.
|
|
20
|
+
|
|
21
|
+
Received: ${getVariableType(invalidProp)}
|
|
22
|
+
Expected: ${useFocusTrapProps[validPropKey]}
|
|
23
|
+
`);
|
|
19
24
|
};
|
|
20
25
|
|
|
21
26
|
const throwRequiredError = validPropKey => {
|
|
22
|
-
throw new Error(
|
|
27
|
+
throw new Error(`Warning: Please provide a "${validPropKey}" property to use a useFocusTrap hook, this property is required.`);
|
|
23
28
|
};
|
|
24
29
|
|
|
25
30
|
const validateProps = componentProps => {
|
package/esm/hooks/useHotkeys.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
1
|
import { useState, useMemo, useEffect } from 'react';
|
|
3
2
|
|
|
4
3
|
const useIsShowingEllipsis = () => {
|
|
@@ -8,7 +7,7 @@ const useIsShowingEllipsis = () => {
|
|
|
8
7
|
if (entries.length) {
|
|
9
8
|
const [textWrapperEntry] = entries;
|
|
10
9
|
const el = textWrapperEntry.target;
|
|
11
|
-
setIsShowingEllipsis(
|
|
10
|
+
setIsShowingEllipsis(el?.scrollWidth > el?.clientWidth);
|
|
12
11
|
}
|
|
13
12
|
}), []);
|
|
14
13
|
useEffect(() => {
|
|
@@ -1,28 +1,21 @@
|
|
|
1
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
1
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
3
2
|
|
|
4
3
|
// Taken and modified from https://stackoverflow.com/a/60218754
|
|
5
4
|
|
|
6
5
|
const useOnElementResize = targetRef => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const [width, setWidth] = useState((_targetRef$current$of = (_targetRef$current = targetRef.current) === null || _targetRef$current === void 0 ? void 0 : _targetRef$current.offsetWidth) !== null && _targetRef$current$of !== void 0 ? _targetRef$current$of : 0);
|
|
10
|
-
const [height, setHeight] = useState((_targetRef$current$of2 = (_targetRef$current2 = targetRef.current) === null || _targetRef$current2 === void 0 ? void 0 : _targetRef$current2.offsetHeight) !== null && _targetRef$current$of2 !== void 0 ? _targetRef$current$of2 : 0);
|
|
6
|
+
const [width, setWidth] = useState(targetRef.current?.offsetWidth ?? 0);
|
|
7
|
+
const [height, setHeight] = useState(targetRef.current?.offsetHeight ?? 0);
|
|
11
8
|
const observer = useRef();
|
|
12
9
|
useEffect(() => {
|
|
13
10
|
function outputsize() {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
setWidth((_targetRef$current$of3 = (_targetRef$current3 = targetRef.current) === null || _targetRef$current3 === void 0 ? void 0 : _targetRef$current3.offsetWidth) !== null && _targetRef$current$of3 !== void 0 ? _targetRef$current$of3 : 0);
|
|
17
|
-
setHeight((_targetRef$current$of4 = (_targetRef$current4 = targetRef.current) === null || _targetRef$current4 === void 0 ? void 0 : _targetRef$current4.offsetHeight) !== null && _targetRef$current$of4 !== void 0 ? _targetRef$current$of4 : 0);
|
|
11
|
+
setWidth(targetRef.current?.offsetWidth ?? 0);
|
|
12
|
+
setHeight(targetRef.current?.offsetHeight ?? 0);
|
|
18
13
|
}
|
|
19
14
|
|
|
20
15
|
observer.current = new ResizeObserver(outputsize);
|
|
21
16
|
observer.current.observe(targetRef.current);
|
|
22
17
|
return () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
(_observer$current = observer.current) === null || _observer$current === void 0 ? void 0 : _observer$current.disconnect();
|
|
18
|
+
observer.current?.disconnect();
|
|
26
19
|
};
|
|
27
20
|
}, [targetRef]);
|
|
28
21
|
return useMemo(() => ({
|
package/esm/operators.js
CHANGED
package/esm/system.js
CHANGED
|
@@ -6,7 +6,6 @@ import 'core-js/modules/esnext.iterator.filter.js';
|
|
|
6
6
|
import '@babel/runtime/helpers/esm/defineProperty';
|
|
7
7
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
8
8
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
9
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
10
9
|
import { isFunction } from 'lodash';
|
|
11
10
|
|
|
12
11
|
const setRef = (ref, value) => {
|
package/esm/timeUtils.js
CHANGED
|
@@ -4,7 +4,6 @@ import '@babel/runtime/helpers/esm/defineProperty';
|
|
|
4
4
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
5
5
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
6
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
7
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
8
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
9
|
import { padStart } from 'lodash';
|
package/esm/utils.js
CHANGED
|
@@ -4,7 +4,6 @@ import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
|
4
4
|
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
5
5
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
6
|
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
7
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
8
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
9
|
import { omit, cloneDeep, isFunction } from 'lodash';
|
|
@@ -24,7 +23,7 @@ const cx = function () {
|
|
|
24
23
|
classnames[_key] = arguments[_key];
|
|
25
24
|
}
|
|
26
25
|
|
|
27
|
-
return classnames.reduce((result, cn) =>
|
|
26
|
+
return classnames.reduce((result, cn) => `${result} ${cn || ''}`, '');
|
|
28
27
|
}; // if entry exists, remove it, if not, add it
|
|
29
28
|
|
|
30
29
|
const toggleInObject = (obj, key, value) => obj[key] !== undefined ? omit(obj, [key]) : _objectSpread(_objectSpread({}, obj), {}, {
|
package/esm/validations.js
CHANGED
|
@@ -16,7 +16,7 @@ const isGreaterThan = _ref2 => {
|
|
|
16
16
|
help,
|
|
17
17
|
comparator = 0
|
|
18
18
|
} = _ref2;
|
|
19
|
-
if (!help) help =
|
|
19
|
+
if (!help) help = `Max value ${comparator}`;
|
|
20
20
|
return {
|
|
21
21
|
payload: help,
|
|
22
22
|
error: greaterThan(value, comparator)
|
|
@@ -28,7 +28,7 @@ const isValidDate = _ref3 => {
|
|
|
28
28
|
help,
|
|
29
29
|
format = 'MM/DD/AAA'
|
|
30
30
|
} = _ref3;
|
|
31
|
-
if (!help) help =
|
|
31
|
+
if (!help) help = `Valid Date is required ${format}`;
|
|
32
32
|
return {
|
|
33
33
|
payload: help,
|
|
34
34
|
error: !validDate(value)
|