@bigbinary/neeto-team-members-frontend 4.4.3 → 4.4.5

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.
@@ -16,7 +16,7 @@ import 'ramda';
16
16
  import 'react-i18next';
17
17
  import './index-DcjmIrWp.js';
18
18
  import './useTeamsApi-BTrW3Vtj.js';
19
- export { M as default } from './index-DduR7qdk.js';
19
+ export { M as default } from './index-Ha4Z8MdN.js';
20
20
  import './RolesRadioGroup-DJ4pOHcX.js';
21
21
  import 'react/jsx-runtime';
22
22
  import '@babel/runtime/helpers/objectWithoutProperties';
package/dist/Roles.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import require$$0, { useRef, memo, useCallback, useEffect, useState, createElement, Fragment as Fragment$1, useMemo } from 'react';
3
+ import { c as commonjsGlobal } from './_commonjsHelpers-BFTU3MAI.js';
3
4
  import i18next, { t } from 'i18next';
4
5
  import { isNotEmpty, isPresent, _findBy, noop } from '@bigbinary/neeto-cist';
5
6
  import { PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
6
7
  import { withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
7
- import Container from '@bigbinary/neeto-molecules/Container';
8
8
  import Spinner from '@bigbinary/neetoui/Spinner';
9
9
  import { not, map, prop, identical, includes, __, groupBy, pluck, isEmpty, filter } from 'ramda';
10
- import { c as commonjsGlobal } from './_commonjsHelpers-BFTU3MAI.js';
11
10
  import { w as withReactQuery } from './withReactQuery-CHybbL5V.js';
12
11
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
13
12
  import { useQuery } from '@tanstack/react-query';
14
13
  import axios from 'axios';
15
14
  import { B as BASE_URL, Q as QUERY_KEYS, A as ADMIN_ROLES } from './constants-Dq8t7rmL.js';
16
15
  import { b as useCreateRole, c as useUpdateRole, S as ScrollToErrorField, d as useDestroyRole, u as useFetchRoles, e as useBulkUpdateRoles } from './index-DcjmIrWp.js';
16
+ import Container from '@bigbinary/neeto-molecules/Container';
17
17
  import { n } from './inject-css-DmrvuTKK.js';
18
18
  import NeetoHeader from '@bigbinary/neeto-molecules/Header';
19
19
  import Button from '@bigbinary/neetoui/Button';
@@ -493,6 +493,8 @@ var dist = {exports: {}};
493
493
  value: true
494
494
  });
495
495
 
496
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
497
+
496
498
  var _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
497
499
 
498
500
  var _react = __webpack_require__(4);
@@ -547,7 +549,7 @@ var dist = {exports: {}};
547
549
  _this.panes[group].push(node);
548
550
  }
549
551
  });
550
- _this.addEvents(node, groups);
552
+ _this.addEvents(node);
551
553
  }, _this.unregisterPane = function (node, groups) {
552
554
  groups.forEach(function (group) {
553
555
  if (_this.findPane(node, group)) {
@@ -555,9 +557,15 @@ var dist = {exports: {}};
555
557
  _this.panes[group].splice(_this.panes[group].indexOf(node), 1);
556
558
  }
557
559
  });
558
- }, _this.addEvents = function (node, groups) {
560
+ }, _this.addEvents = function (node) {
559
561
  /* For some reason element.addEventListener doesnt work with document.body */
560
- node.onscroll = _this.handlePaneScroll.bind(_this, node, groups); // eslint-disable-line
562
+ var nodeGroups = [];
563
+ if (_this.panes && _typeof(_this.panes) === 'object') {
564
+ Object.keys(_this.panes).forEach(function (pane) {
565
+ if (_this.findNode(_this.panes[pane], node)) nodeGroups.push(pane);
566
+ });
567
+ }
568
+ node.onscroll = _this.handlePaneScroll.bind(_this, node, nodeGroups); // eslint-disable-line
561
569
  }, _this.removeEvents = function (node) {
562
570
  /* For some reason element.removeEventListener doesnt work with document.body */
563
571
  node.onscroll = null; // eslint-disable-line
@@ -569,6 +577,14 @@ var dist = {exports: {}};
569
577
  return _this.panes[group].find(function (pane) {
570
578
  return pane === node;
571
579
  });
580
+ }, _this.findNode = function (pane, node) {
581
+ if (!pane) {
582
+ return false;
583
+ }
584
+
585
+ return pane.find(function (savedNode) {
586
+ return savedNode === node;
587
+ });
572
588
  }, _this.handlePaneScroll = function (node, groups) {
573
589
  if (!_this.props.enabled) {
574
590
  return;
@@ -587,7 +603,7 @@ var dist = {exports: {}};
587
603
  _this.syncScrollPosition(scrolledPane, pane);
588
604
  /* Re-attach event listeners after we're done scrolling */
589
605
  window.requestAnimationFrame(function () {
590
- _this.addEvents(pane, groups);
606
+ _this.addEvents(pane);
591
607
  });
592
608
  }
593
609
  });
@@ -728,7 +744,7 @@ var dist = {exports: {}};
728
744
  }
729
745
  };
730
746
 
731
- _this.childRef = (0, _react.createRef)();
747
+ _this.childRef = props.innerRef ? props.innerRef : (0, _react.createRef)();
732
748
  return _this;
733
749
  }
734
750
 
@@ -779,7 +795,9 @@ var dist = {exports: {}};
779
795
  if (this.props.attachTo) {
780
796
  return this.props.children;
781
797
  }
782
- return (0, _react.cloneElement)(_react.Children.only(this.props.children), { ref: this.childRef });
798
+ return (0, _react.cloneElement)(_react.Children.only(this.props.children), {
799
+ ref: this.childRef
800
+ });
783
801
  }
784
802
  }]);
785
803
 
@@ -791,7 +809,9 @@ var dist = {exports: {}};
791
809
  children: _propTypes2.default.node.isRequired,
792
810
  attachTo: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.shape({ current: _propTypes2.default.any })]),
793
811
  group: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.arrayOf(_propTypes2.default.string)]),
794
- enabled: _propTypes2.default.bool
812
+ enabled: _propTypes2.default.bool,
813
+ innerRef: _propTypes2.default.oneOfType([// Either a function
814
+ _propTypes2.default.func, _propTypes2.default.shape({ current: _propTypes2.default.any })])
795
815
  };
796
816
  ScrollSyncPane.defaultProps = {
797
817
  group: 'default',