@jahia/data-helper 1.1.7 → 1.1.8
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/{dist/esm → esm}/fragments/PredefinedFragments.js +1 -1
- package/esm/fragments/PredefinedFragments.js.map +1 -0
- package/esm/fragments/encodeName.js.map +1 -0
- package/{dist/esm → esm}/fragments/fragments.utils.js +34 -25
- package/esm/fragments/fragments.utils.js.map +1 -0
- package/esm/fragments/getIsNodeTypeFragment.js +30 -0
- package/esm/fragments/getIsNodeTypeFragment.js.map +1 -0
- package/{dist/esm → esm}/fragments/getPermissionFragment.js +10 -5
- package/esm/fragments/getPermissionFragment.js.map +1 -0
- package/esm/fragments/index.js +3 -0
- package/esm/fragments/index.js.map +1 -0
- package/esm/hooks/index.js +6 -0
- package/{dist/esm → esm}/hooks/index.js.map +1 -1
- package/esm/hooks/useContentPreview/index.js +2 -0
- package/esm/hooks/useContentPreview/index.js.map +1 -0
- package/{dist/esm → esm}/hooks/useContentPreview/useContentPreview.gql-queries.js +2 -2
- package/{dist/esm → esm}/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -1
- package/{dist/esm → esm}/hooks/useContentPreview/useContentPreview.js +2 -2
- package/esm/hooks/useContentPreview/useContentPreview.js.map +1 -0
- package/esm/hooks/useContentPreview/useContentPreview.spec.js +35 -0
- package/esm/hooks/useContentPreview/useContentPreview.spec.js.map +1 -0
- package/esm/hooks/useDeepCompareMemo/index.js +2 -0
- package/esm/hooks/useDeepCompareMemo/index.js.map +1 -0
- package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
- package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +36 -0
- package/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeChecks/index.js +1 -1
- package/esm/hooks/useNodeChecks/index.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeChecks/useNodeChecks.js +14 -10
- package/esm/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
- package/esm/hooks/useNodeChecks/useNodeChecks.spec.js +184 -0
- package/esm/hooks/useNodeChecks/useNodeChecks.spec.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeInfo/index.js +1 -1
- package/esm/hooks/useNodeInfo/index.js.map +1 -0
- package/esm/hooks/useNodeInfo/useMemoRequest.js +50 -0
- package/esm/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +16 -22
- package/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeInfo/useNodeInfo.js +26 -37
- package/esm/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
- package/esm/hooks/useNodeInfo/useNodeInfo.spec.js +453 -0
- package/esm/hooks/useNodeInfo/useNodeInfo.spec.js.map +1 -0
- package/{dist/esm → esm}/hooks/useNodeInfo/useNodeInfo.utils.js +10 -3
- package/esm/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
- package/esm/hooks/useSchemaFields/index.js +2 -0
- package/esm/hooks/useSchemaFields/index.js.map +1 -0
- package/{dist/esm → esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js +1 -1
- package/{dist/esm → esm}/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -1
- package/{dist/esm → esm}/hooks/useSchemaFields/useSchemaFields.js +2 -2
- package/esm/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
- package/{dist/esm → esm}/hooks/useSiteInfo/index.js +1 -1
- package/esm/hooks/useSiteInfo/index.js.map +1 -0
- package/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js +6 -0
- package/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -0
- package/{dist/esm → esm}/hooks/useSiteInfo/useSiteInfo.js +8 -12
- package/esm/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
- package/esm/hooks/useSiteInfo/useSiteInfo.spec.js +65 -0
- package/esm/hooks/useSiteInfo/useSiteInfo.spec.js.map +1 -0
- package/{dist/esm → esm}/hooks/useTreeEntries/index.js +1 -1
- package/esm/hooks/useTreeEntries/index.js.map +1 -0
- package/{dist/esm → esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js +2 -2
- package/{dist/esm → esm}/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -1
- package/{dist/esm → esm}/hooks/useTreeEntries/useTreeEntries.js +24 -8
- package/esm/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
- package/esm/hooks/useTreeEntries/useTreeEntries.spec.js +47 -0
- package/esm/hooks/useTreeEntries/useTreeEntries.spec.js.map +1 -0
- package/esm/index.js +4 -0
- package/esm/index.js.map +1 -0
- package/{dist/esm → esm}/legacy/Picker.gql-fragments.js +1 -1
- package/{dist/esm → esm}/legacy/Picker.gql-fragments.js.map +1 -1
- package/{dist/esm → esm}/legacy/Picker.js +135 -102
- package/esm/legacy/Picker.js.map +1 -0
- package/esm/legacy/index.js +3 -0
- package/esm/legacy/index.js.map +1 -0
- package/{dist/js → js}/fragments/PredefinedFragments.js +22 -22
- package/js/fragments/PredefinedFragments.js.map +1 -0
- package/js/fragments/encodeName.js.map +1 -0
- package/{dist/js → js}/fragments/fragments.utils.js +36 -27
- package/js/fragments/fragments.utils.js.map +1 -0
- package/js/fragments/getIsNodeTypeFragment.js +39 -0
- package/js/fragments/getIsNodeTypeFragment.js.map +1 -0
- package/js/fragments/getPermissionFragment.js +53 -0
- package/js/fragments/getPermissionFragment.js.map +1 -0
- package/{dist/js → js}/fragments/index.js.map +1 -1
- package/{dist/js → js}/hooks/index.js.map +1 -1
- package/{dist/js → js}/hooks/useContentPreview/index.js.map +1 -1
- package/js/hooks/useContentPreview/useContentPreview.gql-queries.js +14 -0
- package/js/hooks/useContentPreview/useContentPreview.gql-queries.js.map +1 -0
- package/{dist/js → js}/hooks/useContentPreview/useContentPreview.js +2 -2
- package/js/hooks/useContentPreview/useContentPreview.js.map +1 -0
- package/js/hooks/useContentPreview/useContentPreview.spec.js +37 -0
- package/js/hooks/useContentPreview/useContentPreview.spec.js.map +1 -0
- package/{dist/js → js}/hooks/useDeepCompareMemo/index.js.map +1 -1
- package/{dist/js → js}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +1 -1
- package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +1 -0
- package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js +38 -0
- package/js/hooks/useDeepCompareMemo/useDeepCompareMemo.spec.js.map +1 -0
- package/{dist/js → js}/hooks/useNodeChecks/index.js.map +1 -1
- package/{dist/js → js}/hooks/useNodeChecks/useNodeChecks.js +16 -13
- package/js/hooks/useNodeChecks/useNodeChecks.js.map +1 -0
- package/js/hooks/useNodeChecks/useNodeChecks.spec.js +187 -0
- package/js/hooks/useNodeChecks/useNodeChecks.spec.js.map +1 -0
- package/{dist/js → js}/hooks/useNodeInfo/index.js.map +1 -1
- package/js/hooks/useNodeInfo/useMemoRequest.js +57 -0
- package/js/hooks/useNodeInfo/useMemoRequest.js.map +1 -0
- package/{dist/js → js}/hooks/useNodeInfo/useNodeInfo.gql-queries.js +18 -24
- package/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +1 -0
- package/{dist/js → js}/hooks/useNodeInfo/useNodeInfo.js +26 -37
- package/js/hooks/useNodeInfo/useNodeInfo.js.map +1 -0
- package/js/hooks/useNodeInfo/useNodeInfo.spec.js +456 -0
- package/js/hooks/useNodeInfo/useNodeInfo.spec.js.map +1 -0
- package/js/hooks/useNodeInfo/useNodeInfo.utils.js +63 -0
- package/js/hooks/useNodeInfo/useNodeInfo.utils.js.map +1 -0
- package/{dist/js → js}/hooks/useSchemaFields/index.js.map +1 -1
- package/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js +13 -0
- package/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +1 -0
- package/{dist/js → js}/hooks/useSchemaFields/useSchemaFields.js +2 -2
- package/js/hooks/useSchemaFields/useSchemaFields.js.map +1 -0
- package/{dist/js → js}/hooks/useSiteInfo/index.js.map +1 -1
- package/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js +14 -0
- package/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +1 -0
- package/js/hooks/useSiteInfo/useSiteInfo.js +42 -0
- package/js/hooks/useSiteInfo/useSiteInfo.js.map +1 -0
- package/js/hooks/useSiteInfo/useSiteInfo.spec.js +67 -0
- package/js/hooks/useSiteInfo/useSiteInfo.spec.js.map +1 -0
- package/{dist/js → js}/hooks/useTreeEntries/index.js.map +1 -1
- package/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js +14 -0
- package/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +1 -0
- package/js/hooks/useTreeEntries/useTreeEntries.js +117 -0
- package/js/hooks/useTreeEntries/useTreeEntries.js.map +1 -0
- package/js/hooks/useTreeEntries/useTreeEntries.spec.js +49 -0
- package/js/hooks/useTreeEntries/useTreeEntries.spec.js.map +1 -0
- package/{dist/js → js}/index.js.map +1 -1
- package/js/legacy/Picker.gql-fragments.js +29 -0
- package/js/legacy/Picker.gql-fragments.js.map +1 -0
- package/js/legacy/Picker.js +396 -0
- package/js/legacy/Picker.js.map +1 -0
- package/{dist/js → js}/legacy/index.js.map +1 -1
- package/package.json +20 -12
- package/.autorc +0 -10
- package/.eslintrc +0 -8
- package/CHANGELOG.md +0 -508
- package/build.mjs +0 -9
- package/dist/esm/fragments/PredefinedFragments.js.map +0 -1
- package/dist/esm/fragments/encodeName.js.map +0 -1
- package/dist/esm/fragments/fragments.utils.js.map +0 -1
- package/dist/esm/fragments/getIsNodeTypeFragment.js +0 -26
- package/dist/esm/fragments/getIsNodeTypeFragment.js.map +0 -1
- package/dist/esm/fragments/getPermissionFragment.js.map +0 -1
- package/dist/esm/fragments/getSubNodesCountFragment.js +0 -24
- package/dist/esm/fragments/getSubNodesCountFragment.js.map +0 -1
- package/dist/esm/fragments/index.js +0 -3
- package/dist/esm/fragments/index.js.map +0 -1
- package/dist/esm/hooks/index.js +0 -6
- package/dist/esm/hooks/useContentPreview/index.js +0 -2
- package/dist/esm/hooks/useContentPreview/index.js.map +0 -1
- package/dist/esm/hooks/useContentPreview/useContentPreview.js.map +0 -1
- package/dist/esm/hooks/useDeepCompareMemo/index.js +0 -2
- package/dist/esm/hooks/useDeepCompareMemo/index.js.map +0 -1
- package/dist/esm/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -1
- package/dist/esm/hooks/useNodeChecks/index.js.map +0 -1
- package/dist/esm/hooks/useNodeChecks/useNodeChecks.js.map +0 -1
- package/dist/esm/hooks/useNodeInfo/index.js.map +0 -1
- package/dist/esm/hooks/useNodeInfo/useMemoRequest.js +0 -43
- package/dist/esm/hooks/useNodeInfo/useMemoRequest.js.map +0 -1
- package/dist/esm/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -1
- package/dist/esm/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
- package/dist/esm/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -1
- package/dist/esm/hooks/useSchemaFields/index.js +0 -2
- package/dist/esm/hooks/useSchemaFields/index.js.map +0 -1
- package/dist/esm/hooks/useSchemaFields/useSchemaFields.js.map +0 -1
- package/dist/esm/hooks/useSiteInfo/index.js.map +0 -1
- package/dist/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js +0 -6
- package/dist/esm/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +0 -1
- package/dist/esm/hooks/useSiteInfo/useSiteInfo.js.map +0 -1
- package/dist/esm/hooks/useTreeEntries/index.js.map +0 -1
- package/dist/esm/hooks/useTreeEntries/useTreeEntries.js.map +0 -1
- package/dist/esm/index.js +0 -4
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/legacy/Picker.js.map +0 -1
- package/dist/esm/legacy/index.js +0 -3
- package/dist/esm/legacy/index.js.map +0 -1
- package/dist/js/fragments/PredefinedFragments.js.map +0 -1
- package/dist/js/fragments/encodeName.js.map +0 -1
- package/dist/js/fragments/fragments.utils.js.map +0 -1
- package/dist/js/fragments/getIsNodeTypeFragment.js +0 -35
- package/dist/js/fragments/getIsNodeTypeFragment.js.map +0 -1
- package/dist/js/fragments/getPermissionFragment.js +0 -48
- package/dist/js/fragments/getPermissionFragment.js.map +0 -1
- package/dist/js/fragments/getSubNodesCountFragment.js +0 -33
- package/dist/js/fragments/getSubNodesCountFragment.js.map +0 -1
- package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js +0 -14
- package/dist/js/hooks/useContentPreview/useContentPreview.gql-queries.js.map +0 -1
- package/dist/js/hooks/useContentPreview/useContentPreview.js.map +0 -1
- package/dist/js/hooks/useDeepCompareMemo/useDeepCompareMemo.js.map +0 -1
- package/dist/js/hooks/useNodeChecks/useNodeChecks.js.map +0 -1
- package/dist/js/hooks/useNodeInfo/useMemoRequest.js +0 -50
- package/dist/js/hooks/useNodeInfo/useMemoRequest.js.map +0 -1
- package/dist/js/hooks/useNodeInfo/useNodeInfo.gql-queries.js.map +0 -1
- package/dist/js/hooks/useNodeInfo/useNodeInfo.js.map +0 -1
- package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js +0 -57
- package/dist/js/hooks/useNodeInfo/useNodeInfo.utils.js.map +0 -1
- package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js +0 -13
- package/dist/js/hooks/useSchemaFields/useSchemaFields.gql-queries.js.map +0 -1
- package/dist/js/hooks/useSchemaFields/useSchemaFields.js.map +0 -1
- package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js +0 -14
- package/dist/js/hooks/useSiteInfo/useSiteInfo.gql-queries.js.map +0 -1
- package/dist/js/hooks/useSiteInfo/useSiteInfo.js +0 -47
- package/dist/js/hooks/useSiteInfo/useSiteInfo.js.map +0 -1
- package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js +0 -14
- package/dist/js/hooks/useTreeEntries/useTreeEntries.gql-queries.js.map +0 -1
- package/dist/js/hooks/useTreeEntries/useTreeEntries.js +0 -102
- package/dist/js/hooks/useTreeEntries/useTreeEntries.js.map +0 -1
- package/dist/js/legacy/Picker.gql-fragments.js +0 -29
- package/dist/js/legacy/Picker.gql-fragments.js.map +0 -1
- package/dist/js/legacy/Picker.js +0 -363
- package/dist/js/legacy/Picker.js.map +0 -1
- package/dist/types/fragments/PredefinedFragments.d.ts +0 -31
- package/dist/types/fragments/encodeName.d.ts +0 -1
- package/dist/types/fragments/fragments.utils.d.ts +0 -6
- package/dist/types/fragments/getIsNodeTypeFragment.d.ts +0 -10
- package/dist/types/fragments/getPermissionFragment.d.ts +0 -14
- package/dist/types/fragments/getSubNodesCountFragment.d.ts +0 -8
- package/dist/types/hooks/useContentPreview/useContentPreview.d.ts +0 -25
- package/dist/types/hooks/useContentPreview/useContentPreview.gql-queries.d.ts +0 -1
- package/dist/types/hooks/useDeepCompareMemo/useDeepCompareMemo.d.ts +0 -1
- package/dist/types/hooks/useNodeChecks/useNodeChecks.d.ts +0 -18
- package/dist/types/hooks/useNodeInfo/useMemoRequest.d.ts +0 -6
- package/dist/types/hooks/useNodeInfo/useNodeInfo.d.ts +0 -33
- package/dist/types/hooks/useNodeInfo/useNodeInfo.gql-queries.d.ts +0 -33
- package/dist/types/hooks/useNodeInfo/useNodeInfo.utils.d.ts +0 -12
- package/dist/types/hooks/useSchemaFields/useSchemaFields.d.ts +0 -5
- package/dist/types/hooks/useSchemaFields/useSchemaFields.gql-queries.d.ts +0 -1
- package/dist/types/hooks/useSiteInfo/useSiteInfo.d.ts +0 -63
- package/dist/types/hooks/useSiteInfo/useSiteInfo.gql-queries.d.ts +0 -1
- package/dist/types/hooks/useTreeEntries/useTreeEntries.d.ts +0 -39
- package/dist/types/hooks/useTreeEntries/useTreeEntries.gql-queries.d.ts +0 -1
- package/dist/types/legacy/Picker.d.ts +0 -84
- package/dist/types/legacy/Picker.gql-fragments.d.ts +0 -17
- package/tsconfig.json +0 -27
- /package/{dist/esm → esm}/fragments/encodeName.js +0 -0
- /package/{dist/types → esm}/fragments/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useContentPreview/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useDeepCompareMemo/index.d.ts +0 -0
- /package/{dist/esm → esm}/hooks/useDeepCompareMemo/useDeepCompareMemo.js +0 -0
- /package/{dist/types → esm}/hooks/useNodeChecks/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useNodeInfo/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useSchemaFields/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useSiteInfo/index.d.ts +0 -0
- /package/{dist/types → esm}/hooks/useTreeEntries/index.d.ts +0 -0
- /package/{dist/types → esm}/index.d.ts +0 -0
- /package/{dist/types → esm}/legacy/index.d.ts +0 -0
- /package/{dist/js → js}/fragments/encodeName.js +0 -0
- /package/{dist/js → js}/fragments/index.js +0 -0
- /package/{dist/js → js}/hooks/index.js +0 -0
- /package/{dist/js → js}/hooks/useContentPreview/index.js +0 -0
- /package/{dist/js → js}/hooks/useDeepCompareMemo/index.js +0 -0
- /package/{dist/js → js}/hooks/useNodeChecks/index.js +0 -0
- /package/{dist/js → js}/hooks/useNodeInfo/index.js +0 -0
- /package/{dist/js → js}/hooks/useSchemaFields/index.js +0 -0
- /package/{dist/js → js}/hooks/useSiteInfo/index.js +0 -0
- /package/{dist/js → js}/hooks/useTreeEntries/index.js +0 -0
- /package/{dist/js → js}/index.js +0 -0
- /package/{dist/js → js}/legacy/index.js +0 -0
|
@@ -1,29 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
import _includes from "lodash/includes";
|
|
3
|
+
import _startsWith from "lodash/startsWith";
|
|
4
|
+
import _split from "lodash/split";
|
|
5
|
+
import _tail from "lodash/tail";
|
|
6
|
+
import _each from "lodash/each";
|
|
7
|
+
import _map from "lodash/map";
|
|
8
|
+
import _forEachRight from "lodash/forEachRight";
|
|
9
|
+
import _sortBy from "lodash/sortBy";
|
|
10
|
+
import _forEach from "lodash/forEach";
|
|
11
|
+
import _repeat from "lodash/repeat";
|
|
12
|
+
import _indexOf from "lodash/indexOf";
|
|
13
|
+
import _assign from "lodash/assign";
|
|
14
|
+
import _union from "lodash/union";
|
|
15
|
+
import _eq from "lodash/eq";
|
|
16
|
+
import _clone from "lodash/clone";
|
|
17
|
+
import _filter from "lodash/filter";
|
|
12
18
|
var _templateObject;
|
|
13
19
|
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
20
|
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; }
|
|
21
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
23
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
25
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
26
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
27
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
29
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
31
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
32
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
33
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
15
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
37
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
38
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
16
39
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
|
|
18
|
-
//
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
// TODO BACKLOG-12393 - refactor Legacy Picker into hook without lodash
|
|
19
42
|
import React from 'react';
|
|
20
|
-
import { Query } from '
|
|
43
|
+
import { Query } from 'react-apollo';
|
|
21
44
|
import gql from 'graphql-tag';
|
|
22
|
-
import
|
|
23
|
-
import {
|
|
24
|
-
import
|
|
25
|
-
import deepEquals from 'fast-deep-equal';
|
|
26
|
-
var clone = rfdc();
|
|
45
|
+
import PropTypes from 'prop-types';
|
|
46
|
+
import { displayName, nodeCacheRequiredFields, replaceFragmentsInDocument } from '../fragments';
|
|
47
|
+
import { PickerItemsFragment } from './Picker.gql-fragments';
|
|
27
48
|
export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
28
49
|
_inherits(Picker, _React$Component);
|
|
29
50
|
var _super = _createSuper(Picker);
|
|
@@ -40,19 +61,18 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
40
61
|
defaultSelectedPaths = props.defaultSelectedPaths,
|
|
41
62
|
onSelectionChange = props.onSelectionChange,
|
|
42
63
|
defaultOpenPaths = props.defaultOpenPaths;
|
|
43
|
-
var resolvedFragments = fragments || [PickerItemsFragment.mixinTypes, PickerItemsFragment.primaryNodeType, PickerItemsFragment.isPublished, displayName];
|
|
44
64
|
_this.query = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query PickerQuery($rootPaths:[String!]!, $selectable:[String]!, $openable:[String]!, $openPaths:[String!]!, $types:[String]!) {\n jcr {\n rootNodes:nodesByPath(paths: $rootPaths) {\n name\n children(typesFilter:{types:$types}, limit:1) {\n pageInfo {\n nodesCount\n }\n }\n selectable : isNodeType(type: {types:$selectable})\n openable : isNodeType(type: {types:$openable})\n ... NodeCacheRequiredFields\n ... node\n },\n openNodes:nodesByPath(paths: $openPaths) {\n ... NodeCacheRequiredFields\n children(typesFilter:{types:$types}) {\n nodes {\n name\n children(typesFilter:{types:$types}, limit:1) {\n pageInfo {\n nodesCount\n }\n }\n selectable : isNodeType(type: {types:$selectable})\n openable : isNodeType(type: {types:$openable})\n ... NodeCacheRequiredFields\n ... node\n }\n }\n }\n }\n }\n ", ""])), nodeCacheRequiredFields.gql);
|
|
45
|
-
_this.query = replaceFragmentsInDocument(_this.query,
|
|
65
|
+
_this.query = replaceFragmentsInDocument(_this.query, fragments);
|
|
46
66
|
var state = {};
|
|
47
67
|
_this.eventsHandlers = {};
|
|
48
|
-
if (
|
|
68
|
+
if (openPaths === null) {
|
|
49
69
|
// Uncontrolled mode
|
|
50
70
|
state.isOpenControlled = false;
|
|
51
71
|
state.openPaths = [];
|
|
52
72
|
_this.eventsHandlers.onOpenItem = function (path, open) {
|
|
53
73
|
_this.setState(function (prevState) {
|
|
54
74
|
return {
|
|
55
|
-
openPaths: open ? [].concat(_toConsumableArray(prevState.openPaths), [path]) : prevState.openPaths
|
|
75
|
+
openPaths: open ? [].concat(_toConsumableArray(prevState.openPaths), [path]) : _filter(prevState.openPaths, function (thispath) {
|
|
56
76
|
return thispath !== path;
|
|
57
77
|
})
|
|
58
78
|
};
|
|
@@ -67,17 +87,17 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
67
87
|
_this.eventsHandlers.onOpenItem = onOpenItem;
|
|
68
88
|
}
|
|
69
89
|
}
|
|
70
|
-
if (
|
|
90
|
+
if (selectedPaths === null) {
|
|
71
91
|
// Uncontrolled mode
|
|
72
92
|
state.isSelectControlled = false;
|
|
73
|
-
state.selectedPaths = defaultSelectedPaths ?
|
|
93
|
+
state.selectedPaths = defaultSelectedPaths ? _clone(defaultSelectedPaths) : [];
|
|
74
94
|
// Open selected path if open is uncontrolled
|
|
75
95
|
if (defaultSelectedPaths && !state.isOpenControlled) {
|
|
76
96
|
state.openPaths = _this.addPathToOpenPath(defaultSelectedPaths, rootPaths, state.openPaths);
|
|
77
97
|
}
|
|
78
98
|
_this.eventsHandlers.onSelectItem = function (path, selected, multiple) {
|
|
79
99
|
_this.setState(function (prevState) {
|
|
80
|
-
var newSelectedPaths = selected ? [].concat(_toConsumableArray(multiple ? prevState.selectedPaths : []), [path]) : prevState.selectedPaths
|
|
100
|
+
var newSelectedPaths = selected ? [].concat(_toConsumableArray(multiple ? prevState.selectedPaths : []), [path]) : _filter(prevState.selectedPaths, function (thispath) {
|
|
81
101
|
return thispath !== path;
|
|
82
102
|
});
|
|
83
103
|
onSelectionChange(newSelectedPaths);
|
|
@@ -108,13 +128,13 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
108
128
|
queryVariables = _this$props.queryVariables;
|
|
109
129
|
var vars = {
|
|
110
130
|
rootPaths: rootPaths,
|
|
111
|
-
types:
|
|
131
|
+
types: _union(openableTypes, selectableTypes),
|
|
112
132
|
selectable: selectableTypes,
|
|
113
133
|
openable: openableTypes,
|
|
114
134
|
openPaths: openPaths
|
|
115
135
|
};
|
|
116
136
|
if (queryVariables) {
|
|
117
|
-
|
|
137
|
+
_assign(vars, queryVariables);
|
|
118
138
|
}
|
|
119
139
|
return vars;
|
|
120
140
|
}
|
|
@@ -128,17 +148,17 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
128
148
|
var addNode = function addNode(node, depth, index) {
|
|
129
149
|
var selected = false;
|
|
130
150
|
if (node.selectable) {
|
|
131
|
-
selected = selectedPaths
|
|
151
|
+
selected = _indexOf(selectedPaths, node.path) !== -1;
|
|
132
152
|
}
|
|
133
153
|
var pickerNode = {
|
|
134
154
|
name: node.name,
|
|
135
155
|
path: node.path,
|
|
136
|
-
open: node.openable && openPaths
|
|
156
|
+
open: node.openable && _indexOf(openPaths, node.path) !== -1,
|
|
137
157
|
selected: selected,
|
|
138
158
|
openable: node.openable,
|
|
139
159
|
selectable: node.selectable,
|
|
140
160
|
depth: depth,
|
|
141
|
-
prefix: ' '
|
|
161
|
+
prefix: _repeat(' ', depth * 3),
|
|
142
162
|
node: node,
|
|
143
163
|
hidden: false,
|
|
144
164
|
hasChildren: node.children.pageInfo.nodesCount > 0
|
|
@@ -149,19 +169,17 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
149
169
|
};
|
|
150
170
|
if (jcr) {
|
|
151
171
|
if (jcr.rootNodes) {
|
|
152
|
-
jcr.rootNodes
|
|
172
|
+
_forEach(jcr.rootNodes, function (rootNode) {
|
|
153
173
|
var root = addNode(rootNode, 0, 0);
|
|
154
|
-
root.hidden = _this2.props.hideRoot
|
|
174
|
+
root.hidden = _this2.props.hideRoot;
|
|
155
175
|
});
|
|
156
176
|
}
|
|
157
177
|
if (jcr.openNodes) {
|
|
158
|
-
jcr.openNodes
|
|
159
|
-
return a.path > b.path ? 1 : b.path > a.path ? -1 : 0;
|
|
160
|
-
}).forEach(function (node) {
|
|
178
|
+
_sortBy(jcr.openNodes, ['path']).forEach(function (node) {
|
|
161
179
|
var parent = nodesById[node.uuid];
|
|
162
180
|
if (parent) {
|
|
163
|
-
var parentIndex = pickerEntries
|
|
164
|
-
node.children.nodes
|
|
181
|
+
var parentIndex = _indexOf(pickerEntries, parent);
|
|
182
|
+
_forEachRight(node.children.nodes, function (child) {
|
|
165
183
|
addNode(child, parent.depth + 1, parentIndex + 1);
|
|
166
184
|
});
|
|
167
185
|
}
|
|
@@ -170,15 +188,13 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
170
188
|
}
|
|
171
189
|
|
|
172
190
|
// Nodes loaded, fill selection list
|
|
173
|
-
var selectedNodes = pickerEntries
|
|
191
|
+
var selectedNodes = _filter(pickerEntries, function (node) {
|
|
174
192
|
return node.selected;
|
|
175
193
|
}).map(function (node) {
|
|
176
194
|
return node.node;
|
|
177
195
|
});
|
|
178
|
-
selectedPaths = selectedNodes
|
|
179
|
-
|
|
180
|
-
});
|
|
181
|
-
pickerEntries = pickerEntries.filter(function (pickerNode) {
|
|
196
|
+
selectedPaths = _map(selectedNodes, 'path');
|
|
197
|
+
pickerEntries = _filter(pickerEntries, function (pickerNode) {
|
|
182
198
|
return !pickerNode.hidden;
|
|
183
199
|
});
|
|
184
200
|
return pickerEntries;
|
|
@@ -186,23 +202,20 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
186
202
|
}, {
|
|
187
203
|
key: "addPathToOpenPath",
|
|
188
204
|
value: function addPathToOpenPath(pathsToOpen, rootPaths, openPaths) {
|
|
189
|
-
pathsToOpen
|
|
205
|
+
_each(pathsToOpen, function (path) {
|
|
190
206
|
var rootFound = false;
|
|
191
207
|
if (!path.endsWith('/')) {
|
|
192
208
|
path += '/';
|
|
193
209
|
}
|
|
194
|
-
|
|
195
|
-
_path$split2 = _toArray(_path$split),
|
|
196
|
-
tail = _path$split2.slice(0);
|
|
197
|
-
tail.reduce(function (acc, it) {
|
|
210
|
+
_tail(_split(path, '/')).reduce(function (acc, it) {
|
|
198
211
|
if (!rootFound) {
|
|
199
|
-
rootPaths
|
|
200
|
-
rootFound = rootFound || acc
|
|
212
|
+
_forEach(rootPaths, function (rootPath) {
|
|
213
|
+
rootFound = rootFound || _startsWith(acc, rootPath) && rootPath;
|
|
201
214
|
});
|
|
202
215
|
}
|
|
203
|
-
if (rootFound && !openPaths
|
|
216
|
+
if (rootFound && !_includes(openPaths, acc)) {
|
|
204
217
|
openPaths.push(acc);
|
|
205
|
-
if (!openPaths
|
|
218
|
+
if (!_includes(openPaths, rootFound)) {
|
|
206
219
|
openPaths.push(rootFound);
|
|
207
220
|
}
|
|
208
221
|
}
|
|
@@ -230,19 +243,19 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
230
243
|
value: function render() {
|
|
231
244
|
var _this4 = this;
|
|
232
245
|
var selectedPaths = this.state.selectedPaths ? this.state.selectedPaths : this.props.selectedPaths;
|
|
233
|
-
var openPaths = this.state.openPaths
|
|
246
|
+
var openPaths = this.state.openPaths ? this.state.openPaths : this.props.openPaths;
|
|
234
247
|
var setRefetch = this.props.setRefetch;
|
|
235
|
-
openPaths =
|
|
248
|
+
openPaths = _clone(openPaths);
|
|
236
249
|
var vars = this.getVariables(selectedPaths, openPaths);
|
|
237
250
|
return /*#__PURE__*/React.createElement(Query, {
|
|
238
251
|
query: this.query,
|
|
239
252
|
variables: vars,
|
|
240
253
|
fetchPolicy: "cache-first"
|
|
241
|
-
}, function (
|
|
242
|
-
var error =
|
|
243
|
-
loading =
|
|
244
|
-
data =
|
|
245
|
-
refetch =
|
|
254
|
+
}, function (_ref) {
|
|
255
|
+
var error = _ref.error,
|
|
256
|
+
loading = _ref.loading,
|
|
257
|
+
data = _ref.data,
|
|
258
|
+
refetch = _ref.refetch;
|
|
246
259
|
if (setRefetch) {
|
|
247
260
|
setRefetch({
|
|
248
261
|
query: _this4.query,
|
|
@@ -284,14 +297,14 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
284
297
|
}], [{
|
|
285
298
|
key: "getDerivedStateFromProps",
|
|
286
299
|
value: function getDerivedStateFromProps(nextProps, prevState) {
|
|
287
|
-
if (prevState.isOpenControlled !==
|
|
300
|
+
if (prevState.isOpenControlled !== (nextProps.openPaths !== null) || prevState.isSelectControlled !== (nextProps.selectedPaths !== null)) {
|
|
288
301
|
console.warn('Cannot change between controlled/uncontrolled modes');
|
|
289
302
|
}
|
|
290
303
|
var newState = {};
|
|
291
|
-
if (prevState.isOpenControlled && !
|
|
304
|
+
if (prevState.isOpenControlled && !_eq(nextProps.openPaths, prevState.openPaths)) {
|
|
292
305
|
newState.openPaths = nextProps.openPaths;
|
|
293
306
|
}
|
|
294
|
-
if (prevState.isSelectControlled && !
|
|
307
|
+
if (prevState.isSelectControlled && !_eq(nextProps.selectedPaths, prevState.selectedPaths)) {
|
|
295
308
|
newState.selectedPaths = nextProps.selectedPaths;
|
|
296
309
|
}
|
|
297
310
|
if (newState.openPaths || newState.selectedPaths) {
|
|
@@ -302,55 +315,75 @@ export var Picker = /*#__PURE__*/function (_React$Component) {
|
|
|
302
315
|
}]);
|
|
303
316
|
return Picker;
|
|
304
317
|
}(React.Component);
|
|
305
|
-
|
|
318
|
+
Picker.defaultProps = {
|
|
319
|
+
onLoading: null,
|
|
320
|
+
defaultOpenPaths: null,
|
|
321
|
+
openPaths: null,
|
|
322
|
+
defaultSelectedPaths: null,
|
|
323
|
+
selectedPaths: null,
|
|
324
|
+
setRefetch: null,
|
|
325
|
+
queryVariables: null,
|
|
326
|
+
fragments: [PickerItemsFragment.mixinTypes, PickerItemsFragment.primaryNodeType, PickerItemsFragment.isPublished, displayName],
|
|
327
|
+
onSelectionChange: null,
|
|
328
|
+
onOpenItem: null,
|
|
329
|
+
onSelectItem: null,
|
|
330
|
+
children: null,
|
|
331
|
+
hideRoot: false
|
|
332
|
+
};
|
|
333
|
+
Picker.propTypes = {
|
|
306
334
|
/**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
335
|
+
* List of root paths for the picker
|
|
336
|
+
*/
|
|
337
|
+
rootPaths: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
310
338
|
/**
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
onOpenItem: _pt.func,
|
|
315
|
-
onSelectItem: _pt.func,
|
|
339
|
+
* List of folder paths that are open by default (uncontrolled mode)
|
|
340
|
+
*/
|
|
341
|
+
defaultOpenPaths: PropTypes.arrayOf(PropTypes.string),
|
|
316
342
|
/**
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
343
|
+
* List of node types that can be "opened" (folders)
|
|
344
|
+
*/
|
|
345
|
+
openableTypes: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
320
346
|
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
347
|
+
* List of open folders in controlled mode
|
|
348
|
+
*/
|
|
349
|
+
openPaths: PropTypes.arrayOf(PropTypes.string),
|
|
324
350
|
/**
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
351
|
+
* List of node types that can be "selected" (items)
|
|
352
|
+
*/
|
|
353
|
+
selectableTypes: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
328
354
|
/**
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
355
|
+
* Preselected items path (uncontrolled mode)
|
|
356
|
+
*/
|
|
357
|
+
defaultSelectedPaths: PropTypes.arrayOf(PropTypes.string),
|
|
332
358
|
/**
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
359
|
+
* List of selected path in controlled mode
|
|
360
|
+
*/
|
|
361
|
+
selectedPaths: PropTypes.arrayOf(PropTypes.string),
|
|
336
362
|
/**
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
363
|
+
* Callback when the selection has changed
|
|
364
|
+
*/
|
|
365
|
+
onSelectionChange: PropTypes.func,
|
|
340
366
|
/**
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
onLoading: _pt.func.isRequired,
|
|
367
|
+
* Optional function which receives refetch function of the Query component when the component is strapped
|
|
368
|
+
*/
|
|
369
|
+
setRefetch: PropTypes.func,
|
|
345
370
|
/**
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
371
|
+
* Optional set of fragments to add to the graphQL query. Can be a string that identify a predefinedFragment or a fragment definition
|
|
372
|
+
*/
|
|
373
|
+
fragments: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
374
|
+
applyFor: PropTypes.string.isRequired,
|
|
375
|
+
variables: PropTypes.object,
|
|
376
|
+
gql: PropTypes.object.isRequired
|
|
377
|
+
})])),
|
|
350
378
|
/**
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
379
|
+
* Optional set of variable to pass to the graphQL query, in order to fulfill fragments needs
|
|
380
|
+
*/
|
|
381
|
+
queryVariables: PropTypes.object,
|
|
382
|
+
// eslint-disable-next-line react/boolean-prop-naming
|
|
383
|
+
hideRoot: PropTypes.bool,
|
|
384
|
+
children: PropTypes.func,
|
|
385
|
+
onOpenItem: PropTypes.func,
|
|
386
|
+
onSelectItem: PropTypes.func,
|
|
387
|
+
onLoading: PropTypes.func
|
|
388
|
+
};
|
|
356
389
|
//# sourceMappingURL=Picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Query","gql","PropTypes","displayName","nodeCacheRequiredFields","replaceFragmentsInDocument","PickerItemsFragment","Picker","_React$Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","fragments","rootPaths","onOpenItem","onSelectItem","openPaths","selectedPaths","defaultSelectedPaths","onSelectionChange","defaultOpenPaths","query","_templateObject","_taggedTemplateLiteral","state","eventsHandlers","isOpenControlled","path","open","setState","prevState","concat","_toConsumableArray","_filter","thispath","addPathToOpenPath","isSelectControlled","_clone","selected","multiple","newSelectedPaths","bind","_assertThisInitialized","_createClass","key","value","getVariables","_this$props","openableTypes","selectableTypes","queryVariables","vars","types","_union","selectable","openable","_assign","getPickerEntries","data","_this2","pickerEntries","nodesById","jcr","addNode","node","depth","index","_indexOf","pickerNode","name","prefix","_repeat","hidden","hasChildren","children","pageInfo","nodesCount","splice","uuid","rootNodes","_forEach","rootNode","root","hideRoot","openNodes","_sortBy","forEach","parent","parentIndex","_forEachRight","nodes","child","selectedNodes","map","_map","pathsToOpen","_each","rootFound","endsWith","_tail","_split","reduce","acc","it","rootPath","_startsWith","_includes","push","paths","_this3","Array","render","_this4","setRefetch","createElement","variables","fetchPolicy","_ref","error","loading","refetch","queryParams","renderProp","onLoading","previousEntries","_objectSpread","getDerivedStateFromProps","nextProps","console","warn","newState","_eq","Component","defaultProps","mixinTypes","primaryNodeType","isPublished","propTypes","arrayOf","string","isRequired","func","oneOfType","shape","applyFor","object","bool"],"sources":["Picker.js"],"sourcesContent":["// TODO BACKLOG-12393 - refactor Legacy Picker into hook without lodash\nimport React from 'react';\nimport {Query} from 'react-apollo';\nimport gql from 'graphql-tag';\nimport * as _ from 'lodash';\nimport PropTypes from 'prop-types';\nimport {displayName, nodeCacheRequiredFields, replaceFragmentsInDocument} from '../fragments';\nimport {PickerItemsFragment} from './Picker.gql-fragments';\n\nexport class Picker extends React.Component {\n constructor(props) {\n super(props);\n\n const {\n fragments,\n rootPaths,\n onOpenItem,\n onSelectItem,\n openPaths,\n selectedPaths,\n defaultSelectedPaths,\n onSelectionChange,\n defaultOpenPaths\n } = props;\n\n this.query = gql`\n query PickerQuery($rootPaths:[String!]!, $selectable:[String]!, $openable:[String]!, $openPaths:[String!]!, $types:[String]!) {\n jcr {\n rootNodes:nodesByPath(paths: $rootPaths) {\n name\n children(typesFilter:{types:$types}, limit:1) {\n pageInfo {\n nodesCount\n }\n }\n selectable : isNodeType(type: {types:$selectable})\n openable : isNodeType(type: {types:$openable})\n ... NodeCacheRequiredFields\n ... node\n },\n openNodes:nodesByPath(paths: $openPaths) {\n ... NodeCacheRequiredFields\n children(typesFilter:{types:$types}) {\n nodes {\n name\n children(typesFilter:{types:$types}, limit:1) {\n pageInfo {\n nodesCount\n }\n }\n selectable : isNodeType(type: {types:$selectable})\n openable : isNodeType(type: {types:$openable})\n ... NodeCacheRequiredFields\n ... node\n }\n }\n }\n }\n }\n ${nodeCacheRequiredFields.gql}`;\n this.query = replaceFragmentsInDocument(this.query, fragments);\n\n const state = {};\n\n this.eventsHandlers = {};\n\n if (openPaths === null) {\n // Uncontrolled mode\n state.isOpenControlled = false;\n state.openPaths = [];\n this.eventsHandlers.onOpenItem = (path, open) => {\n this.setState(prevState => ({\n openPaths: open\n ? [...prevState.openPaths, path]\n : _.filter(prevState.openPaths, thispath => thispath !== path)\n }));\n };\n\n if (defaultOpenPaths) {\n state.openPaths = this.addPathToOpenPath(defaultOpenPaths, rootPaths, state.openPaths);\n }\n } else {\n state.isOpenControlled = true;\n if (onOpenItem) {\n this.eventsHandlers.onOpenItem = onOpenItem;\n }\n }\n\n if (selectedPaths === null) {\n // Uncontrolled mode\n state.isSelectControlled = false;\n state.selectedPaths = defaultSelectedPaths ? _.clone(defaultSelectedPaths) : [];\n // Open selected path if open is uncontrolled\n if (defaultSelectedPaths && !state.isOpenControlled) {\n state.openPaths = this.addPathToOpenPath(defaultSelectedPaths, rootPaths, state.openPaths);\n }\n\n this.eventsHandlers.onSelectItem = (path, selected, multiple) => {\n this.setState(prevState => {\n const newSelectedPaths = selected\n ? [...(multiple ? prevState.selectedPaths : []), path]\n : _.filter(prevState.selectedPaths, thispath => thispath !== path);\n onSelectionChange(newSelectedPaths);\n return {\n selectedPaths: newSelectedPaths\n };\n });\n };\n } else if (onSelectItem) {\n state.isSelectControlled = true;\n if (onSelectItem) {\n this.eventsHandlers.onSelectItem = onSelectItem;\n }\n }\n\n this.state = state;\n\n // Binding\n this.openPaths = this.openPaths.bind(this);\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if ((prevState.isOpenControlled !== (nextProps.openPaths !== null)) || (prevState.isSelectControlled !== (nextProps.selectedPaths !== null))) {\n console.warn('Cannot change between controlled/uncontrolled modes');\n }\n\n const newState = {};\n\n if (prevState.isOpenControlled && !_.eq(nextProps.openPaths, prevState.openPaths)) {\n newState.openPaths = nextProps.openPaths;\n }\n\n if (prevState.isSelectControlled && !_.eq(nextProps.selectedPaths, prevState.selectedPaths)) {\n newState.selectedPaths = nextProps.selectedPaths;\n }\n\n if (newState.openPaths || newState.selectedPaths) {\n return newState;\n }\n\n return null;\n }\n\n getVariables(selectedPaths, openPaths) {\n const {rootPaths, openableTypes, selectableTypes, queryVariables} = this.props;\n\n const vars = {\n rootPaths,\n types: _.union(openableTypes, selectableTypes),\n selectable: selectableTypes,\n openable: openableTypes,\n openPaths\n };\n\n if (queryVariables) {\n _.assign(vars, queryVariables);\n }\n\n return vars;\n }\n\n getPickerEntries(data, selectedPaths, openPaths) {\n let pickerEntries = [];\n const nodesById = {};\n const {jcr} = data;\n\n const addNode = function (node, depth, index) {\n let selected = false;\n if (node.selectable) {\n selected = _.indexOf(selectedPaths, node.path) !== -1;\n }\n\n const pickerNode = {\n name: node.name,\n path: node.path,\n open: node.openable && _.indexOf(openPaths, node.path) !== -1,\n selected,\n openable: node.openable,\n selectable: node.selectable,\n depth,\n prefix: _.repeat(' ', depth * 3),\n node,\n hidden: false,\n hasChildren: node.children.pageInfo.nodesCount > 0\n };\n pickerEntries.splice(index, 0, pickerNode);\n nodesById[node.uuid] = pickerNode;\n return pickerNode;\n };\n\n if (jcr) {\n if (jcr.rootNodes) {\n _.forEach(jcr.rootNodes, rootNode => {\n const root = addNode(rootNode, 0, 0);\n root.hidden = this.props.hideRoot;\n });\n }\n\n if (jcr.openNodes) {\n _.sortBy(jcr.openNodes, ['path']).forEach(node => {\n const parent = nodesById[node.uuid];\n if (parent) {\n const parentIndex = _.indexOf(pickerEntries, parent);\n _.forEachRight(node.children.nodes, child => {\n addNode(child, parent.depth + 1, parentIndex + 1);\n });\n }\n });\n }\n }\n\n // Nodes loaded, fill selection list\n const selectedNodes = _.filter(pickerEntries, node => node.selected).map(node => node.node);\n\n selectedPaths = _.map(selectedNodes, 'path');\n pickerEntries = _.filter(pickerEntries, pickerNode => !pickerNode.hidden);\n\n return pickerEntries;\n }\n\n addPathToOpenPath(pathsToOpen, rootPaths, openPaths) {\n _.each(pathsToOpen, path => {\n let rootFound = false;\n if (!path.endsWith('/')) {\n path += '/';\n }\n\n _.tail(_.split(path, '/')).reduce((acc, it) => {\n if (!rootFound) {\n _.forEach(rootPaths, rootPath => {\n rootFound = rootFound || (_.startsWith(acc, rootPath) && rootPath);\n });\n }\n\n if (rootFound && !_.includes(openPaths, acc)) {\n openPaths.push(acc);\n if (!_.includes(openPaths, rootFound)) {\n openPaths.push(rootFound);\n }\n }\n\n return acc + '/' + it;\n }, '');\n });\n return openPaths;\n }\n\n openPaths(paths) {\n if (!(paths instanceof Array)) {\n paths = [paths];\n }\n\n this.setState(prevState => {\n const openPaths = this.addPathToOpenPath(paths, this.props.rootPaths, prevState.openPaths);\n return {openPaths};\n });\n }\n\n render() {\n const selectedPaths = this.state.selectedPaths ? this.state.selectedPaths : this.props.selectedPaths;\n let openPaths = this.state.openPaths ? this.state.openPaths : this.props.openPaths;\n const {setRefetch} = this.props;\n\n openPaths = _.clone(openPaths);\n\n const vars = this.getVariables(selectedPaths, openPaths);\n\n return (\n <Query query={this.query} variables={vars} fetchPolicy='cache-first'>\n {({error, loading, data, refetch}) => {\n if (setRefetch) {\n setRefetch({\n query: this.query,\n queryParams: vars,\n refetch\n });\n }\n\n const renderProp = this.props.children;\n if (this.props.onLoading) {\n this.props.onLoading(loading);\n }\n\n if (loading) {\n if (this.previousEntries) {\n return renderProp({pickerEntries: this.previousEntries, loading, ...this.eventsHandlers});\n }\n\n return renderProp({pickerEntries: [], loading, ...this.eventsHandlers});\n }\n\n if (error) {\n return renderProp({pickerEntries: [], error, loading, ...this.eventsHandlers});\n }\n\n const pickerEntries = this.getPickerEntries(data, selectedPaths, openPaths);\n this.previousEntries = pickerEntries;\n\n return renderProp({pickerEntries, loading, ...this.eventsHandlers});\n }}\n </Query>\n );\n }\n}\n\nPicker.defaultProps = {\n onLoading: null,\n defaultOpenPaths: null,\n openPaths: null,\n defaultSelectedPaths: null,\n selectedPaths: null,\n setRefetch: null,\n queryVariables: null,\n fragments: [PickerItemsFragment.mixinTypes, PickerItemsFragment.primaryNodeType, PickerItemsFragment.isPublished, displayName],\n onSelectionChange: null,\n onOpenItem: null,\n onSelectItem: null,\n children: null,\n hideRoot: false\n};\n\nPicker.propTypes = {\n\n /**\n * List of root paths for the picker\n */\n rootPaths: PropTypes.arrayOf(PropTypes.string).isRequired,\n\n /**\n * List of folder paths that are open by default (uncontrolled mode)\n */\n defaultOpenPaths: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * List of node types that can be \"opened\" (folders)\n */\n openableTypes: PropTypes.arrayOf(PropTypes.string).isRequired,\n\n /**\n * List of open folders in controlled mode\n */\n openPaths: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * List of node types that can be \"selected\" (items)\n */\n selectableTypes: PropTypes.arrayOf(PropTypes.string).isRequired,\n\n /**\n * Preselected items path (uncontrolled mode)\n */\n defaultSelectedPaths: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * List of selected path in controlled mode\n */\n selectedPaths: PropTypes.arrayOf(PropTypes.string),\n\n /**\n * Callback when the selection has changed\n */\n onSelectionChange: PropTypes.func,\n\n /**\n * Optional function which receives refetch function of the Query component when the component is strapped\n */\n setRefetch: PropTypes.func,\n\n /**\n * Optional set of fragments to add to the graphQL query. Can be a string that identify a predefinedFragment or a fragment definition\n */\n fragments: PropTypes.arrayOf(PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.shape({\n applyFor: PropTypes.string.isRequired,\n variables: PropTypes.object,\n gql: PropTypes.object.isRequired\n })\n ])),\n\n /**\n * Optional set of variable to pass to the graphQL query, in order to fulfill fragments needs\n */\n queryVariables: PropTypes.object,\n\n // eslint-disable-next-line react/boolean-prop-naming\n hideRoot: PropTypes.bool,\n children: PropTypes.func,\n onOpenItem: PropTypes.func,\n onSelectItem: PropTypes.func,\n onLoading: PropTypes.func\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAQC,KAAK,QAAO,cAAc;AAClC,OAAOC,GAAG,MAAM,aAAa;AAE7B,OAAOC,SAAS,MAAM,YAAY;AAClC,SAAQC,WAAW,EAAEC,uBAAuB,EAAEC,0BAA0B,QAAO,cAAc;AAC7F,SAAQC,mBAAmB,QAAO,wBAAwB;AAE1D,WAAaC,MAAM,0BAAAC,gBAAA;EAAAC,SAAA,CAAAF,MAAA,EAAAC,gBAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,MAAA;EACf,SAAAA,OAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,MAAA;IACfM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IAEX,IACII,SAAS,GASTJ,KAAK,C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I,MAAM,CAAC;EAEzD;AACJ;AACA;EACI1H,aAAa,EAAEnB,SAAS,CAAC4I,OAAO,CAAC5I,SAAS,CAAC6I,MAAM,CAAC;EAElD;AACJ;AACA;EACIxH,iBAAiB,EAAErB,SAAS,CAAC+I,IAAI;EAEjC;AACJ;AACA;EACI5B,UAAU,EAAEnH,SAAS,CAAC+I,IAAI;EAE1B;AACJ;AACA;EACIjI,SAAS,EAAEd,SAAS,CAAC4I,OAAO,CAAC5I,SAAS,CAACgJ,SAAS,CAAC,CAC7ChJ,SAAS,CAAC6I,MAAM,EAChB7I,SAAS,CAACiJ,KAAK,CAAC;IACZC,QAAQ,EAAElJ,SAAS,CAAC6I,MAAM,CAACC,UAAU;IACrCzB,SAAS,EAAErH,SAAS,CAACmJ,MAAM;IAC3BpJ,GAAG,EAAEC,SAAS,CAACmJ,MAAM,CAACL;EAC1B,CAAC,CAAC,CACL,CAAC,CAAC;EAEH;AACJ;AACA;EACI1F,cAAc,EAAEpD,SAAS,CAACmJ,MAAM;EAEhC;EACA9D,QAAQ,EAAErF,SAAS,CAACoJ,IAAI;EACxBxE,QAAQ,EAAE5E,SAAS,CAAC+I,IAAI;EACxB/H,UAAU,EAAEhB,SAAS,CAAC+I,IAAI;EAC1B9H,YAAY,EAAEjB,SAAS,CAAC+I,IAAI;EAC5BlB,SAAS,EAAE7H,SAAS,CAAC+I;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.js"],"sourcesContent":["export * from './Picker';\nexport * from './Picker.gql-fragments';\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,wBAAwB"}
|