@panneau/core 3.0.228 → 3.0.256
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/es/hooks.js +9 -1
- package/es/utils.js +2 -2
- package/package.json +2 -2
package/es/hooks.js
CHANGED
|
@@ -2,6 +2,7 @@ import get from 'lodash/get';
|
|
|
2
2
|
import isArray from 'lodash/isArray';
|
|
3
3
|
import { useMemo, useRef, useEffect, useCallback, useState } from 'react';
|
|
4
4
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
5
|
+
import isObject from 'lodash/isObject';
|
|
5
6
|
import isString from 'lodash/isString';
|
|
6
7
|
import { EventsManager, MediasParser } from '@panneau/core';
|
|
7
8
|
import { createUseEvent, loadPackage } from '@panneau/core/utils';
|
|
@@ -10,7 +11,6 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
|
10
11
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
11
12
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
12
13
|
import { getCsrfToken, postJSON, getCSRFHeaders } from '@folklore/fetch';
|
|
13
|
-
import isObject from 'lodash/isObject';
|
|
14
14
|
import { useFieldsManager, usePanneauResources, useResource, useUrlGenerator } from '@panneau/core/contexts';
|
|
15
15
|
import { useIntl } from 'react-intl';
|
|
16
16
|
import dayjs from 'dayjs';
|
|
@@ -186,6 +186,14 @@ var useActions = function useActions() {
|
|
|
186
186
|
}, getDeletePropsFromItem !== null ? getDeletePropsFromItem(item) : null);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
+
if (isObject(action)) {
|
|
190
|
+
var _ref3 = action || {},
|
|
191
|
+
_ref3$itemLinkProp = _ref3.itemLinkProp,
|
|
192
|
+
itemLinkProp = _ref3$itemLinkProp === void 0 ? null : _ref3$itemLinkProp;
|
|
193
|
+
return _objectSpread(_objectSpread({}, action), itemLinkProp !== null && isObject(item) && typeof item[itemLinkProp] !== 'undefined' ? {
|
|
194
|
+
href: item[itemLinkProp]
|
|
195
|
+
} : null);
|
|
196
|
+
}
|
|
189
197
|
return action;
|
|
190
198
|
}).filter(function (action) {
|
|
191
199
|
return action !== null;
|
package/es/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ import EventEmitter from 'wolfy87-eventemitter';
|
|
|
4
4
|
import isNumber from 'lodash/isNumber';
|
|
5
5
|
import { snakeCase } from 'snake-case';
|
|
6
6
|
import isObject from 'lodash/isObject';
|
|
7
|
-
import { useEffect } from 'react';
|
|
7
|
+
import { useEffect, isValidElement } from 'react';
|
|
8
8
|
import { pascalCase, kebabCase, snakeCase as snakeCase$1 } from 'change-case';
|
|
9
9
|
export { kebabCase as dashCase, pascalCase, snakeCase } from 'change-case';
|
|
10
10
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
@@ -432,7 +432,7 @@ var getSelectOptions = function getSelectOptions(options) {
|
|
|
432
432
|
}
|
|
433
433
|
return {
|
|
434
434
|
value: value,
|
|
435
|
-
label: "".concat(label)
|
|
435
|
+
label: /*#__PURE__*/isValidElement(label) ? label : "".concat(label)
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.256",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -110,5 +110,5 @@
|
|
|
110
110
|
"publishConfig": {
|
|
111
111
|
"access": "public"
|
|
112
112
|
},
|
|
113
|
-
"gitHead": "
|
|
113
|
+
"gitHead": "d841aee21fa1e406ed2674e9f7fb5622d185b05c"
|
|
114
114
|
}
|