@elliemae/ds-utilities 2.0.0-alpha.7 → 2.0.0-next.1
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var
|
|
5
|
+
var lodash = require('lodash');
|
|
6
6
|
var useDerivedStateFromProps = require('./useDerivedStateFromProps.js');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -59,7 +59,7 @@ function useExpandState({
|
|
|
59
59
|
const expand = (item, stateData = true) => {
|
|
60
60
|
if (!item) return;
|
|
61
61
|
|
|
62
|
-
if (
|
|
62
|
+
if (lodash.isFunction(onExpand)) {
|
|
63
63
|
onExpand(item);
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -76,7 +76,7 @@ function useExpandState({
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
const toggleExpand = (item, stateData = true) => {
|
|
79
|
-
if (
|
|
79
|
+
if (lodash.isFunction(onToggleExpand)) {
|
|
80
80
|
onToggleExpand(item);
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -89,7 +89,7 @@ function useExpandState({
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
const collapse = item => {
|
|
92
|
-
if (
|
|
92
|
+
if (lodash.isFunction(onCollapse)) {
|
|
93
93
|
onCollapse(item);
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
|
-
import { isFunction } from '
|
|
3
|
+
import { isFunction } from 'lodash';
|
|
4
4
|
import useDerivedStateFromProp from './useDerivedStateFromProps.js';
|
|
5
5
|
|
|
6
6
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|