@bigbinary/neeto-team-members-frontend 4.2.6 → 4.3.0
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/README.md +25 -29
- package/dist/Groups.js +767 -0
- package/dist/Groups.js.map +1 -0
- package/dist/ManageMember.js +55 -0
- package/dist/ManageMember.js.map +1 -0
- package/dist/MembersDropdown.js +220 -0
- package/dist/MembersDropdown.js.map +1 -0
- package/dist/Permissions-6735df34.js +223 -0
- package/dist/Permissions-6735df34.js.map +1 -0
- package/dist/Permissions-952ec2fa.js +235 -0
- package/dist/Permissions-952ec2fa.js.map +1 -0
- package/dist/Permissions.js +16 -0
- package/dist/Permissions.js.map +1 -0
- package/dist/Profile.js +961 -0
- package/dist/Profile.js.map +1 -0
- package/dist/Roles.js +2353 -0
- package/dist/Roles.js.map +1 -0
- package/dist/RolesRadioGroup-3aa7b822.js +297 -0
- package/dist/RolesRadioGroup-3aa7b822.js.map +1 -0
- package/dist/RolesRadioGroup-94aca05f.js +337 -0
- package/dist/RolesRadioGroup-94aca05f.js.map +1 -0
- package/dist/RolesRadioGroup.js +22 -0
- package/dist/RolesRadioGroup.js.map +1 -0
- package/dist/TeamMembers.js +817 -0
- package/dist/TeamMembers.js.map +1 -0
- package/dist/TeamsAndMembersDropdown.js +414 -0
- package/dist/TeamsAndMembersDropdown.js.map +1 -0
- package/dist/TeamsDropdown.js +110 -0
- package/dist/TeamsDropdown.js.map +1 -0
- package/dist/_commonjsHelpers-1789f0cf.js +8 -0
- package/dist/_commonjsHelpers-1789f0cf.js.map +1 -0
- package/dist/_commonjsHelpers-b3309d7b.js +11 -0
- package/dist/_commonjsHelpers-b3309d7b.js.map +1 -0
- package/dist/cjs/Groups.js +812 -0
- package/dist/cjs/Groups.js.map +1 -0
- package/dist/cjs/ManageMember.js +61 -0
- package/dist/cjs/ManageMember.js.map +1 -0
- package/dist/cjs/MembersDropdown.js +231 -0
- package/dist/cjs/MembersDropdown.js.map +1 -0
- package/dist/cjs/Permissions.js +22 -0
- package/dist/cjs/Permissions.js.map +1 -0
- package/dist/cjs/Profile.js +1003 -0
- package/dist/cjs/Profile.js.map +1 -0
- package/dist/cjs/Roles.js +2382 -0
- package/dist/cjs/Roles.js.map +1 -0
- package/dist/cjs/RolesRadioGroup.js +28 -0
- package/dist/cjs/RolesRadioGroup.js.map +1 -0
- package/dist/cjs/TeamMembers.js +837 -0
- package/dist/cjs/TeamMembers.js.map +1 -0
- package/dist/cjs/TeamsAndMembersDropdown.js +427 -0
- package/dist/cjs/TeamsAndMembersDropdown.js.map +1 -0
- package/dist/cjs/TeamsDropdown.js +119 -0
- package/dist/cjs/TeamsDropdown.js.map +1 -0
- package/dist/cjs/constants.js +15 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/hooks.js +28 -0
- package/dist/cjs/hooks.js.map +1 -0
- package/dist/cjs/index.js +124 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/utils.js +544 -0
- package/dist/cjs/utils.js.map +1 -0
- package/dist/constants-2685e5d6.js +57 -0
- package/dist/constants-2685e5d6.js.map +1 -0
- package/dist/constants-576b89ac.js +45 -0
- package/dist/constants-576b89ac.js.map +1 -0
- package/dist/constants.js +4 -0
- package/dist/constants.js.map +1 -0
- package/dist/defineProperty-2cb3c6e2.js +43 -0
- package/dist/defineProperty-2cb3c6e2.js.map +1 -0
- package/dist/defineProperty-9b13c73c.js +46 -0
- package/dist/defineProperty-9b13c73c.js.map +1 -0
- package/dist/hooks.js +18 -0
- package/dist/hooks.js.map +1 -0
- package/dist/index-2757050a.js +1022 -0
- package/dist/index-2757050a.js.map +1 -0
- package/dist/index-5f1a8667.js +179 -0
- package/dist/index-5f1a8667.js.map +1 -0
- package/dist/index-7b978a0f.js +149 -0
- package/dist/index-7b978a0f.js.map +1 -0
- package/dist/index-9d0683d6.js +137 -0
- package/dist/index-9d0683d6.js.map +1 -0
- package/dist/index-cbfbc296.js +167 -0
- package/dist/index-cbfbc296.js.map +1 -0
- package/dist/index-f4f1d674.js +981 -0
- package/dist/index-f4f1d674.js.map +1 -0
- package/dist/index.js +97 -10060
- package/dist/index.js.map +1 -1
- package/dist/inject-css-80a5faa3.js +6 -0
- package/dist/inject-css-80a5faa3.js.map +1 -0
- package/dist/inject-css-c86de496.js +4 -0
- package/dist/inject-css-c86de496.js.map +1 -0
- package/dist/objectWithoutProperties-2fed2d7d.js +33 -0
- package/dist/objectWithoutProperties-2fed2d7d.js.map +1 -0
- package/dist/objectWithoutProperties-a0edb288.js +31 -0
- package/dist/objectWithoutProperties-a0edb288.js.map +1 -0
- package/dist/queryClient-71ecdd08.js +14 -0
- package/dist/queryClient-71ecdd08.js.map +1 -0
- package/dist/queryClient-febad37e.js +16 -0
- package/dist/queryClient-febad37e.js.map +1 -0
- package/dist/slicedToArray-6674c4b8.js +44 -0
- package/dist/slicedToArray-6674c4b8.js.map +1 -0
- package/dist/slicedToArray-8e69d42b.js +46 -0
- package/dist/slicedToArray-8e69d42b.js.map +1 -0
- package/dist/toConsumableArray-0e395868.js +20 -0
- package/dist/toConsumableArray-0e395868.js.map +1 -0
- package/dist/toConsumableArray-e41a15ba.js +22 -0
- package/dist/toConsumableArray-e41a15ba.js.map +1 -0
- package/dist/unsupportedIterableToArray-7c7192e5.js +17 -0
- package/dist/unsupportedIterableToArray-7c7192e5.js.map +1 -0
- package/dist/unsupportedIterableToArray-fa2816fd.js +20 -0
- package/dist/unsupportedIterableToArray-fa2816fd.js.map +1 -0
- package/dist/useMembersSidenav-68b9f94e.js +17 -0
- package/dist/useMembersSidenav-68b9f94e.js.map +1 -0
- package/dist/useMembersSidenav-7aaa6f93.js +23 -0
- package/dist/useMembersSidenav-7aaa6f93.js.map +1 -0
- package/dist/useTeamsApi-6254d23b.js +2208 -0
- package/dist/useTeamsApi-6254d23b.js.map +1 -0
- package/dist/useTeamsApi-da997902.js +2194 -0
- package/dist/useTeamsApi-da997902.js.map +1 -0
- package/dist/utils-531cc50b.js +41 -0
- package/dist/utils-531cc50b.js.map +1 -0
- package/dist/utils-d5dc0b0b.js +45 -0
- package/dist/utils-d5dc0b0b.js.map +1 -0
- package/dist/utils.js +538 -0
- package/dist/utils.js.map +1 -0
- package/dist/withReactQuery-efba53ba.js +21 -0
- package/dist/withReactQuery-efba53ba.js.map +1 -0
- package/dist/withReactQuery-f0b38396.js +19 -0
- package/dist/withReactQuery-f0b38396.js.map +1 -0
- package/package.json +15 -3
- package/dist/index.cjs.js +0 -10157
- package/dist/index.cjs.js.map +0 -1
package/dist/Roles.js
ADDED
|
@@ -0,0 +1,2353 @@
|
|
|
1
|
+
import { _ as _slicedToArray } from './slicedToArray-6674c4b8.js';
|
|
2
|
+
import require$$0, { useRef, memo, useCallback, useEffect, useState, Fragment as Fragment$1, useMemo } from 'react';
|
|
3
|
+
import i18next, { t } from 'i18next';
|
|
4
|
+
import { isNotEmpty, isPresent, _findBy, replaceById } from '@bigbinary/neeto-cist';
|
|
5
|
+
import { PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
6
|
+
import { withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
|
+
import Container from '@bigbinary/neeto-molecules/Container';
|
|
8
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
9
|
+
import { not, map, prop, identical, modify, includes, __, groupBy, pluck, isEmpty, filter } from 'ramda';
|
|
10
|
+
import { c as commonjsGlobal } from './_commonjsHelpers-1789f0cf.js';
|
|
11
|
+
import { w as withReactQuery } from './withReactQuery-f0b38396.js';
|
|
12
|
+
import { a as _defineProperty, _ as _typeof } from './defineProperty-2cb3c6e2.js';
|
|
13
|
+
import { useQuery } from '@tanstack/react-query';
|
|
14
|
+
import axios from 'axios';
|
|
15
|
+
import { B as BASE_URL, Q as QUERY_KEYS, A as ADMIN_ROLES } from './constants-576b89ac.js';
|
|
16
|
+
import { u as useCreateRole, a as useUpdateRole, S as ScrollToErrorField, b as useDestroyRole, c as useFetchRoles, d as useBulkUpdateRoles } from './index-cbfbc296.js';
|
|
17
|
+
import { n } from './inject-css-c86de496.js';
|
|
18
|
+
import ExternalLink from '@bigbinary/neeto-icons/ExternalLink';
|
|
19
|
+
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
20
|
+
import Button from '@bigbinary/neetoui/Button';
|
|
21
|
+
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
22
|
+
import { useTranslation, Trans } from 'react-i18next';
|
|
23
|
+
import { taxonomies } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
24
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
25
|
+
import Pane from '@bigbinary/neetoui/Pane';
|
|
26
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
27
|
+
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
28
|
+
import Form from '@bigbinary/neetoui/formik/Form';
|
|
29
|
+
import Input from '@bigbinary/neetoui/formik/Input';
|
|
30
|
+
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
31
|
+
import { object, string } from 'yup';
|
|
32
|
+
import { P as Permissions, g as getChildrenRemovedFromRoot, s as sortPermissionsBySequence, a as getPermissionGroups, b as getModifiedPermissions } from './Permissions-6735df34.js';
|
|
33
|
+
import NoData from '@bigbinary/neetoui/NoData';
|
|
34
|
+
import { _ as _toConsumableArray } from './toConsumableArray-0e395868.js';
|
|
35
|
+
import classnames from 'classnames';
|
|
36
|
+
import Checkbox from '@bigbinary/neetoui/Checkbox';
|
|
37
|
+
import { i as isOverflown, g as getScrollBarWidth } from './utils-531cc50b.js';
|
|
38
|
+
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
39
|
+
import Alert from '@bigbinary/neetoui/Alert';
|
|
40
|
+
import Search from '@bigbinary/neeto-icons/Search';
|
|
41
|
+
import Input$1 from '@bigbinary/neetoui/Input';
|
|
42
|
+
import Down from '@bigbinary/neeto-icons/Down';
|
|
43
|
+
import Up from '@bigbinary/neeto-icons/Up';
|
|
44
|
+
import './unsupportedIterableToArray-7c7192e5.js';
|
|
45
|
+
import './queryClient-71ecdd08.js';
|
|
46
|
+
import './objectWithoutProperties-a0edb288.js';
|
|
47
|
+
import 'formik';
|
|
48
|
+
|
|
49
|
+
var dist = {exports: {}};
|
|
50
|
+
|
|
51
|
+
dist.exports;
|
|
52
|
+
|
|
53
|
+
(function (module, exports) {
|
|
54
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
55
|
+
module.exports = factory(require$$0);
|
|
56
|
+
})(commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE_4__) {
|
|
57
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
58
|
+
/******/ // The module cache
|
|
59
|
+
/******/ var installedModules = {};
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // The require function
|
|
62
|
+
/******/ function __webpack_require__(moduleId) {
|
|
63
|
+
/******/
|
|
64
|
+
/******/ // Check if module is in cache
|
|
65
|
+
/******/ if(installedModules[moduleId]) {
|
|
66
|
+
/******/ return installedModules[moduleId].exports;
|
|
67
|
+
/******/ }
|
|
68
|
+
/******/ // Create a new module (and put it into the cache)
|
|
69
|
+
/******/ var module = installedModules[moduleId] = {
|
|
70
|
+
/******/ i: moduleId,
|
|
71
|
+
/******/ l: false,
|
|
72
|
+
/******/ exports: {}
|
|
73
|
+
/******/ };
|
|
74
|
+
/******/
|
|
75
|
+
/******/ // Execute the module function
|
|
76
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
77
|
+
/******/
|
|
78
|
+
/******/ // Flag the module as loaded
|
|
79
|
+
/******/ module.l = true;
|
|
80
|
+
/******/
|
|
81
|
+
/******/ // Return the exports of the module
|
|
82
|
+
/******/ return module.exports;
|
|
83
|
+
/******/ }
|
|
84
|
+
/******/
|
|
85
|
+
/******/
|
|
86
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
87
|
+
/******/ __webpack_require__.m = modules;
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // expose the module cache
|
|
90
|
+
/******/ __webpack_require__.c = installedModules;
|
|
91
|
+
/******/
|
|
92
|
+
/******/ // identity function for calling harmony imports with the correct context
|
|
93
|
+
/******/ __webpack_require__.i = function(value) { return value; };
|
|
94
|
+
/******/
|
|
95
|
+
/******/ // define getter function for harmony exports
|
|
96
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
97
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
98
|
+
/******/ Object.defineProperty(exports, name, {
|
|
99
|
+
/******/ configurable: false,
|
|
100
|
+
/******/ enumerable: true,
|
|
101
|
+
/******/ get: getter
|
|
102
|
+
/******/ });
|
|
103
|
+
/******/ }
|
|
104
|
+
/******/ };
|
|
105
|
+
/******/
|
|
106
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
107
|
+
/******/ __webpack_require__.n = function(module) {
|
|
108
|
+
/******/ var getter = module && module.__esModule ?
|
|
109
|
+
/******/ function getDefault() { return module['default']; } :
|
|
110
|
+
/******/ function getModuleExports() { return module; };
|
|
111
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
112
|
+
/******/ return getter;
|
|
113
|
+
/******/ };
|
|
114
|
+
/******/
|
|
115
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
116
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
117
|
+
/******/
|
|
118
|
+
/******/ // __webpack_public_path__
|
|
119
|
+
/******/ __webpack_require__.p = "";
|
|
120
|
+
/******/
|
|
121
|
+
/******/ // Load entry module and return exports
|
|
122
|
+
/******/ return __webpack_require__(__webpack_require__.s = 10);
|
|
123
|
+
/******/ })
|
|
124
|
+
/************************************************************************/
|
|
125
|
+
/******/ ([
|
|
126
|
+
/* 0 */
|
|
127
|
+
/***/ (function(module, exports) {
|
|
128
|
+
|
|
129
|
+
// shim for using process in browser
|
|
130
|
+
var process = module.exports = {};
|
|
131
|
+
|
|
132
|
+
// cached from whatever global is present so that test runners that stub it
|
|
133
|
+
// don't break things. But we need to wrap it in a try catch in case it is
|
|
134
|
+
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
135
|
+
// function because try/catches deoptimize in certain engines.
|
|
136
|
+
|
|
137
|
+
var cachedSetTimeout;
|
|
138
|
+
var cachedClearTimeout;
|
|
139
|
+
|
|
140
|
+
function defaultSetTimout() {
|
|
141
|
+
throw new Error('setTimeout has not been defined');
|
|
142
|
+
}
|
|
143
|
+
function defaultClearTimeout () {
|
|
144
|
+
throw new Error('clearTimeout has not been defined');
|
|
145
|
+
}
|
|
146
|
+
(function () {
|
|
147
|
+
try {
|
|
148
|
+
if (typeof setTimeout === 'function') {
|
|
149
|
+
cachedSetTimeout = setTimeout;
|
|
150
|
+
} else {
|
|
151
|
+
cachedSetTimeout = defaultSetTimout;
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
cachedSetTimeout = defaultSetTimout;
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
if (typeof clearTimeout === 'function') {
|
|
158
|
+
cachedClearTimeout = clearTimeout;
|
|
159
|
+
} else {
|
|
160
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
161
|
+
}
|
|
162
|
+
} catch (e) {
|
|
163
|
+
cachedClearTimeout = defaultClearTimeout;
|
|
164
|
+
}
|
|
165
|
+
} ());
|
|
166
|
+
function runTimeout(fun) {
|
|
167
|
+
if (cachedSetTimeout === setTimeout) {
|
|
168
|
+
//normal enviroments in sane situations
|
|
169
|
+
return setTimeout(fun, 0);
|
|
170
|
+
}
|
|
171
|
+
// if setTimeout wasn't available but was latter defined
|
|
172
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
173
|
+
cachedSetTimeout = setTimeout;
|
|
174
|
+
return setTimeout(fun, 0);
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
178
|
+
return cachedSetTimeout(fun, 0);
|
|
179
|
+
} catch(e){
|
|
180
|
+
try {
|
|
181
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
182
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
183
|
+
} catch(e){
|
|
184
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
185
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
function runClearTimeout(marker) {
|
|
192
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
193
|
+
//normal enviroments in sane situations
|
|
194
|
+
return clearTimeout(marker);
|
|
195
|
+
}
|
|
196
|
+
// if clearTimeout wasn't available but was latter defined
|
|
197
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
198
|
+
cachedClearTimeout = clearTimeout;
|
|
199
|
+
return clearTimeout(marker);
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
203
|
+
return cachedClearTimeout(marker);
|
|
204
|
+
} catch (e){
|
|
205
|
+
try {
|
|
206
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
207
|
+
return cachedClearTimeout.call(null, marker);
|
|
208
|
+
} catch (e){
|
|
209
|
+
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
210
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
211
|
+
return cachedClearTimeout.call(this, marker);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
}
|
|
218
|
+
var queue = [];
|
|
219
|
+
var draining = false;
|
|
220
|
+
var currentQueue;
|
|
221
|
+
var queueIndex = -1;
|
|
222
|
+
|
|
223
|
+
function cleanUpNextTick() {
|
|
224
|
+
if (!draining || !currentQueue) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
draining = false;
|
|
228
|
+
if (currentQueue.length) {
|
|
229
|
+
queue = currentQueue.concat(queue);
|
|
230
|
+
} else {
|
|
231
|
+
queueIndex = -1;
|
|
232
|
+
}
|
|
233
|
+
if (queue.length) {
|
|
234
|
+
drainQueue();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function drainQueue() {
|
|
239
|
+
if (draining) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
243
|
+
draining = true;
|
|
244
|
+
|
|
245
|
+
var len = queue.length;
|
|
246
|
+
while(len) {
|
|
247
|
+
currentQueue = queue;
|
|
248
|
+
queue = [];
|
|
249
|
+
while (++queueIndex < len) {
|
|
250
|
+
if (currentQueue) {
|
|
251
|
+
currentQueue[queueIndex].run();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
queueIndex = -1;
|
|
255
|
+
len = queue.length;
|
|
256
|
+
}
|
|
257
|
+
currentQueue = null;
|
|
258
|
+
draining = false;
|
|
259
|
+
runClearTimeout(timeout);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
process.nextTick = function (fun) {
|
|
263
|
+
var args = new Array(arguments.length - 1);
|
|
264
|
+
if (arguments.length > 1) {
|
|
265
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
266
|
+
args[i - 1] = arguments[i];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
queue.push(new Item(fun, args));
|
|
270
|
+
if (queue.length === 1 && !draining) {
|
|
271
|
+
runTimeout(drainQueue);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
// v8 likes predictible objects
|
|
276
|
+
function Item(fun, array) {
|
|
277
|
+
this.fun = fun;
|
|
278
|
+
this.array = array;
|
|
279
|
+
}
|
|
280
|
+
Item.prototype.run = function () {
|
|
281
|
+
this.fun.apply(null, this.array);
|
|
282
|
+
};
|
|
283
|
+
process.title = 'browser';
|
|
284
|
+
process.browser = true;
|
|
285
|
+
process.env = {};
|
|
286
|
+
process.argv = [];
|
|
287
|
+
process.version = ''; // empty string to avoid regexp issues
|
|
288
|
+
process.versions = {};
|
|
289
|
+
|
|
290
|
+
function noop() {}
|
|
291
|
+
|
|
292
|
+
process.on = noop;
|
|
293
|
+
process.addListener = noop;
|
|
294
|
+
process.once = noop;
|
|
295
|
+
process.off = noop;
|
|
296
|
+
process.removeListener = noop;
|
|
297
|
+
process.removeAllListeners = noop;
|
|
298
|
+
process.emit = noop;
|
|
299
|
+
process.prependListener = noop;
|
|
300
|
+
process.prependOnceListener = noop;
|
|
301
|
+
|
|
302
|
+
process.listeners = function (name) { return [] };
|
|
303
|
+
|
|
304
|
+
process.binding = function (name) {
|
|
305
|
+
throw new Error('process.binding is not supported');
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
process.cwd = function () { return '/' };
|
|
309
|
+
process.chdir = function (dir) {
|
|
310
|
+
throw new Error('process.chdir is not supported');
|
|
311
|
+
};
|
|
312
|
+
process.umask = function() { return 0; };
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
/***/ }),
|
|
316
|
+
/* 1 */
|
|
317
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
322
|
+
* All rights reserved.
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the BSD-style license found in the
|
|
325
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
326
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
327
|
+
*
|
|
328
|
+
*
|
|
329
|
+
*/
|
|
330
|
+
|
|
331
|
+
function makeEmptyFunction(arg) {
|
|
332
|
+
return function () {
|
|
333
|
+
return arg;
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* This function accepts and discards inputs; it has no side effects. This is
|
|
339
|
+
* primarily useful idiomatically for overridable function endpoints which
|
|
340
|
+
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
|
341
|
+
*/
|
|
342
|
+
var emptyFunction = function emptyFunction() {};
|
|
343
|
+
|
|
344
|
+
emptyFunction.thatReturns = makeEmptyFunction;
|
|
345
|
+
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
|
346
|
+
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
|
347
|
+
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
|
348
|
+
emptyFunction.thatReturnsThis = function () {
|
|
349
|
+
return this;
|
|
350
|
+
};
|
|
351
|
+
emptyFunction.thatReturnsArgument = function (arg) {
|
|
352
|
+
return arg;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
module.exports = emptyFunction;
|
|
356
|
+
|
|
357
|
+
/***/ }),
|
|
358
|
+
/* 2 */
|
|
359
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
360
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
361
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
362
|
+
* All rights reserved.
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the BSD-style license found in the
|
|
365
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
366
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
367
|
+
*
|
|
368
|
+
*/
|
|
369
|
+
|
|
370
|
+
function invariant(condition, format, a, b, c, d, e, f) {
|
|
371
|
+
|
|
372
|
+
if (!condition) {
|
|
373
|
+
var error;
|
|
374
|
+
if (format === undefined) {
|
|
375
|
+
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
|
376
|
+
} else {
|
|
377
|
+
var args = [a, b, c, d, e, f];
|
|
378
|
+
var argIndex = 0;
|
|
379
|
+
error = new Error(format.replace(/%s/g, function () {
|
|
380
|
+
return args[argIndex++];
|
|
381
|
+
}));
|
|
382
|
+
error.name = 'Invariant Violation';
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
error.framesToPop = 1; // we don't care about invariant's own frame
|
|
386
|
+
throw error;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
module.exports = invariant;
|
|
391
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)));
|
|
392
|
+
|
|
393
|
+
/***/ }),
|
|
394
|
+
/* 3 */
|
|
395
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
396
|
+
/**
|
|
397
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
398
|
+
* All rights reserved.
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the BSD-style license found in the
|
|
401
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
402
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
403
|
+
*/
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
408
|
+
|
|
409
|
+
module.exports = ReactPropTypesSecret;
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
/***/ }),
|
|
413
|
+
/* 4 */
|
|
414
|
+
/***/ (function(module, exports) {
|
|
415
|
+
|
|
416
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
|
|
417
|
+
|
|
418
|
+
/***/ }),
|
|
419
|
+
/* 5 */
|
|
420
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
Object.defineProperty(exports, "__esModule", {
|
|
424
|
+
value: true
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
var _react = __webpack_require__(4);
|
|
428
|
+
|
|
429
|
+
var _react2 = _interopRequireDefault(_react);
|
|
430
|
+
|
|
431
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
432
|
+
|
|
433
|
+
var ScrollSyncContext = _react2.default.createContext({
|
|
434
|
+
registerPane: function registerPane() {},
|
|
435
|
+
unregisterPane: function unregisterPane() {}
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
exports.default = ScrollSyncContext;
|
|
439
|
+
module.exports = exports['default'];
|
|
440
|
+
|
|
441
|
+
/***/ }),
|
|
442
|
+
/* 6 */
|
|
443
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
444
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
445
|
+
* Copyright 2014-2015, Facebook, Inc.
|
|
446
|
+
* All rights reserved.
|
|
447
|
+
*
|
|
448
|
+
* This source code is licensed under the BSD-style license found in the
|
|
449
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
450
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
451
|
+
*
|
|
452
|
+
*/
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
var emptyFunction = __webpack_require__(1);
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Similar to invariant but only logs a warning if the condition is not met.
|
|
460
|
+
* This can be used to log issues in development environments in critical
|
|
461
|
+
* paths. Removing the logging code for production environments will keep the
|
|
462
|
+
* same logic and follow the same code paths.
|
|
463
|
+
*/
|
|
464
|
+
|
|
465
|
+
var warning = emptyFunction;
|
|
466
|
+
|
|
467
|
+
module.exports = warning;
|
|
468
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)));
|
|
469
|
+
|
|
470
|
+
/***/ }),
|
|
471
|
+
/* 7 */
|
|
472
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
473
|
+
|
|
474
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
475
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
476
|
+
* All rights reserved.
|
|
477
|
+
*
|
|
478
|
+
* This source code is licensed under the BSD-style license found in the
|
|
479
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
480
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
481
|
+
*/
|
|
482
|
+
|
|
483
|
+
{
|
|
484
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
485
|
+
// http://fb.me/prop-types-in-prod
|
|
486
|
+
module.exports = __webpack_require__(12)();
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)));
|
|
490
|
+
|
|
491
|
+
/***/ }),
|
|
492
|
+
/* 8 */
|
|
493
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
Object.defineProperty(exports, "__esModule", {
|
|
497
|
+
value: true
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
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; }; }();
|
|
501
|
+
|
|
502
|
+
var _react = __webpack_require__(4);
|
|
503
|
+
|
|
504
|
+
var _react2 = _interopRequireDefault(_react);
|
|
505
|
+
|
|
506
|
+
var _propTypes = __webpack_require__(7);
|
|
507
|
+
|
|
508
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
509
|
+
|
|
510
|
+
var _ScrollSyncContext = __webpack_require__(5);
|
|
511
|
+
|
|
512
|
+
var _ScrollSyncContext2 = _interopRequireDefault(_ScrollSyncContext);
|
|
513
|
+
|
|
514
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
515
|
+
|
|
516
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
517
|
+
|
|
518
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
519
|
+
|
|
520
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* ScrollSync provider component
|
|
524
|
+
*
|
|
525
|
+
*/
|
|
526
|
+
|
|
527
|
+
var ScrollSync = function (_Component) {
|
|
528
|
+
_inherits(ScrollSync, _Component);
|
|
529
|
+
|
|
530
|
+
function ScrollSync() {
|
|
531
|
+
var _ref;
|
|
532
|
+
|
|
533
|
+
var _temp, _this, _ret;
|
|
534
|
+
|
|
535
|
+
_classCallCheck(this, ScrollSync);
|
|
536
|
+
|
|
537
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
538
|
+
args[_key] = arguments[_key];
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ScrollSync.__proto__ || Object.getPrototypeOf(ScrollSync)).call.apply(_ref, [this].concat(args))), _this), _this.panes = {}, _this.registerPane = function (node, groups) {
|
|
542
|
+
groups.forEach(function (group) {
|
|
543
|
+
if (!_this.panes[group]) {
|
|
544
|
+
_this.panes[group] = [];
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if (!_this.findPane(node, group)) {
|
|
548
|
+
if (_this.panes[group].length > 0) {
|
|
549
|
+
_this.syncScrollPosition(_this.panes[group][0], node);
|
|
550
|
+
}
|
|
551
|
+
_this.panes[group].push(node);
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
_this.addEvents(node, groups);
|
|
555
|
+
}, _this.unregisterPane = function (node, groups) {
|
|
556
|
+
groups.forEach(function (group) {
|
|
557
|
+
if (_this.findPane(node, group)) {
|
|
558
|
+
_this.removeEvents(node);
|
|
559
|
+
_this.panes[group].splice(_this.panes[group].indexOf(node), 1);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
}, _this.addEvents = function (node, groups) {
|
|
563
|
+
/* For some reason element.addEventListener doesnt work with document.body */
|
|
564
|
+
node.onscroll = _this.handlePaneScroll.bind(_this, node, groups); // eslint-disable-line
|
|
565
|
+
}, _this.removeEvents = function (node) {
|
|
566
|
+
/* For some reason element.removeEventListener doesnt work with document.body */
|
|
567
|
+
node.onscroll = null; // eslint-disable-line
|
|
568
|
+
}, _this.findPane = function (node, group) {
|
|
569
|
+
if (!_this.panes[group]) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
return _this.panes[group].find(function (pane) {
|
|
574
|
+
return pane === node;
|
|
575
|
+
});
|
|
576
|
+
}, _this.handlePaneScroll = function (node, groups) {
|
|
577
|
+
if (!_this.props.enabled) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
window.requestAnimationFrame(function () {
|
|
582
|
+
_this.syncScrollPositions(node, groups);
|
|
583
|
+
});
|
|
584
|
+
}, _this.syncScrollPositions = function (scrolledPane, groups) {
|
|
585
|
+
groups.forEach(function (group) {
|
|
586
|
+
_this.panes[group].forEach(function (pane) {
|
|
587
|
+
/* For all panes beside the currently scrolling one */
|
|
588
|
+
if (scrolledPane !== pane) {
|
|
589
|
+
/* Remove event listeners from the node that we'll manipulate */
|
|
590
|
+
_this.removeEvents(pane, group);
|
|
591
|
+
_this.syncScrollPosition(scrolledPane, pane);
|
|
592
|
+
/* Re-attach event listeners after we're done scrolling */
|
|
593
|
+
window.requestAnimationFrame(function () {
|
|
594
|
+
_this.addEvents(pane, groups);
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
});
|
|
598
|
+
});
|
|
599
|
+
if (_this.props.onSync) _this.props.onSync(scrolledPane);
|
|
600
|
+
}, _temp), _possibleConstructorReturn(_this, _ret);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
_createClass(ScrollSync, [{
|
|
604
|
+
key: 'getContextValue',
|
|
605
|
+
value: function getContextValue() {
|
|
606
|
+
return {
|
|
607
|
+
registerPane: this.registerPane,
|
|
608
|
+
unregisterPane: this.unregisterPane
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
}, {
|
|
612
|
+
key: 'syncScrollPosition',
|
|
613
|
+
value: function syncScrollPosition(scrolledPane, pane) {
|
|
614
|
+
var scrollTop = scrolledPane.scrollTop,
|
|
615
|
+
scrollHeight = scrolledPane.scrollHeight,
|
|
616
|
+
clientHeight = scrolledPane.clientHeight,
|
|
617
|
+
scrollLeft = scrolledPane.scrollLeft,
|
|
618
|
+
scrollWidth = scrolledPane.scrollWidth,
|
|
619
|
+
clientWidth = scrolledPane.clientWidth;
|
|
620
|
+
|
|
621
|
+
|
|
622
|
+
var scrollTopOffset = scrollHeight - clientHeight;
|
|
623
|
+
var scrollLeftOffset = scrollWidth - clientWidth;
|
|
624
|
+
|
|
625
|
+
var _props = this.props,
|
|
626
|
+
proportional = _props.proportional,
|
|
627
|
+
vertical = _props.vertical,
|
|
628
|
+
horizontal = _props.horizontal;
|
|
629
|
+
|
|
630
|
+
/* Calculate the actual pane height */
|
|
631
|
+
|
|
632
|
+
var paneHeight = pane.scrollHeight - clientHeight;
|
|
633
|
+
var paneWidth = pane.scrollWidth - clientWidth;
|
|
634
|
+
/* Adjust the scrollTop position of it accordingly */
|
|
635
|
+
if (vertical && scrollTopOffset > 0) {
|
|
636
|
+
pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop; // eslint-disable-line
|
|
637
|
+
}
|
|
638
|
+
if (horizontal && scrollLeftOffset > 0) {
|
|
639
|
+
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft; // eslint-disable-line
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}, {
|
|
643
|
+
key: 'render',
|
|
644
|
+
value: function render() {
|
|
645
|
+
return _react2.default.createElement(
|
|
646
|
+
_ScrollSyncContext2.default.Provider,
|
|
647
|
+
{ value: this.getContextValue() },
|
|
648
|
+
_react2.default.Children.only(this.props.children)
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
}]);
|
|
652
|
+
|
|
653
|
+
return ScrollSync;
|
|
654
|
+
}(_react.Component);
|
|
655
|
+
|
|
656
|
+
ScrollSync.propTypes = {
|
|
657
|
+
/**
|
|
658
|
+
* Callback to be invoked any time synchronization happens
|
|
659
|
+
*
|
|
660
|
+
* @param {Element} el The element that has received the scroll event
|
|
661
|
+
*/
|
|
662
|
+
onSync: _propTypes2.default.func,
|
|
663
|
+
children: _propTypes2.default.element.isRequired,
|
|
664
|
+
proportional: _propTypes2.default.bool,
|
|
665
|
+
vertical: _propTypes2.default.bool,
|
|
666
|
+
horizontal: _propTypes2.default.bool,
|
|
667
|
+
enabled: _propTypes2.default.bool
|
|
668
|
+
};
|
|
669
|
+
ScrollSync.defaultProps = {
|
|
670
|
+
proportional: true,
|
|
671
|
+
vertical: true,
|
|
672
|
+
horizontal: true,
|
|
673
|
+
enabled: true
|
|
674
|
+
};
|
|
675
|
+
exports.default = ScrollSync;
|
|
676
|
+
module.exports = exports['default'];
|
|
677
|
+
|
|
678
|
+
/***/ }),
|
|
679
|
+
/* 9 */
|
|
680
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
681
|
+
|
|
682
|
+
|
|
683
|
+
Object.defineProperty(exports, "__esModule", {
|
|
684
|
+
value: true
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
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; }; }();
|
|
688
|
+
|
|
689
|
+
var _react = __webpack_require__(4);
|
|
690
|
+
|
|
691
|
+
var _propTypes = __webpack_require__(7);
|
|
692
|
+
|
|
693
|
+
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
694
|
+
|
|
695
|
+
var _ScrollSyncContext = __webpack_require__(5);
|
|
696
|
+
|
|
697
|
+
var _ScrollSyncContext2 = _interopRequireDefault(_ScrollSyncContext);
|
|
698
|
+
|
|
699
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
700
|
+
|
|
701
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
702
|
+
|
|
703
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
704
|
+
|
|
705
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } /* eslint react/no-find-dom-node: 0 */
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* ScrollSyncPane Component
|
|
709
|
+
*
|
|
710
|
+
* Wrap your content in it to keep its scroll position in sync with other panes
|
|
711
|
+
*
|
|
712
|
+
* @example ./example.md
|
|
713
|
+
*/
|
|
714
|
+
|
|
715
|
+
var ScrollSyncPane = function (_Component) {
|
|
716
|
+
_inherits(ScrollSyncPane, _Component);
|
|
717
|
+
|
|
718
|
+
function ScrollSyncPane(props) {
|
|
719
|
+
_classCallCheck(this, ScrollSyncPane);
|
|
720
|
+
|
|
721
|
+
var _this = _possibleConstructorReturn(this, (ScrollSyncPane.__proto__ || Object.getPrototypeOf(ScrollSyncPane)).call(this, props));
|
|
722
|
+
|
|
723
|
+
_this.toArray = function (groups) {
|
|
724
|
+
return [].concat(groups);
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
_this.updateNode = function () {
|
|
728
|
+
if (_this.props.attachTo) {
|
|
729
|
+
_this.node = _this.props.attachTo.current;
|
|
730
|
+
} else {
|
|
731
|
+
_this.node = _this.childRef.current;
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
_this.childRef = (0, _react.createRef)();
|
|
736
|
+
return _this;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
_createClass(ScrollSyncPane, [{
|
|
740
|
+
key: 'componentDidMount',
|
|
741
|
+
value: function componentDidMount() {
|
|
742
|
+
if (this.props.enabled) {
|
|
743
|
+
this.updateNode();
|
|
744
|
+
if (this.node) {
|
|
745
|
+
this.context.registerPane(this.node, this.toArray(this.props.group));
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}, {
|
|
750
|
+
key: 'componentDidUpdate',
|
|
751
|
+
value: function componentDidUpdate(prevProps) {
|
|
752
|
+
if (this.props.attachTo !== prevProps.attachTo) {
|
|
753
|
+
if (this.node) {
|
|
754
|
+
this.context.unregisterPane(this.node, this.toArray(prevProps.group));
|
|
755
|
+
}
|
|
756
|
+
this.updateNode();
|
|
757
|
+
if (this.node) {
|
|
758
|
+
this.context.registerPane(this.node, this.toArray(prevProps.group));
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (this.node && this.props.enabled !== prevProps.enabled) {
|
|
762
|
+
if (this.props.enabled) {
|
|
763
|
+
this.context.registerPane(this.node, this.toArray(prevProps.group));
|
|
764
|
+
} else {
|
|
765
|
+
this.context.unregisterPane(this.node, this.toArray(prevProps.group));
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
if (this.node && this.props.enabled && this.props.group !== prevProps.group) {
|
|
769
|
+
this.context.unregisterPane(this.node, this.toArray(prevProps.group));
|
|
770
|
+
this.context.registerPane(this.node, this.toArray(this.props.group));
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}, {
|
|
774
|
+
key: 'componentWillUnmount',
|
|
775
|
+
value: function componentWillUnmount() {
|
|
776
|
+
if (this.node && this.props.enabled) {
|
|
777
|
+
this.context.unregisterPane(this.node, this.toArray(this.props.group));
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}, {
|
|
781
|
+
key: 'render',
|
|
782
|
+
value: function render() {
|
|
783
|
+
if (this.props.attachTo) {
|
|
784
|
+
return this.props.children;
|
|
785
|
+
}
|
|
786
|
+
return (0, _react.cloneElement)(_react.Children.only(this.props.children), { ref: this.childRef });
|
|
787
|
+
}
|
|
788
|
+
}]);
|
|
789
|
+
|
|
790
|
+
return ScrollSyncPane;
|
|
791
|
+
}(_react.Component);
|
|
792
|
+
|
|
793
|
+
ScrollSyncPane.contextType = _ScrollSyncContext2.default;
|
|
794
|
+
ScrollSyncPane.propTypes = {
|
|
795
|
+
children: _propTypes2.default.node.isRequired,
|
|
796
|
+
attachTo: _propTypes2.default.oneOfType([_propTypes2.default.func, _propTypes2.default.shape({ current: _propTypes2.default.any })]),
|
|
797
|
+
group: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.arrayOf(_propTypes2.default.string)]),
|
|
798
|
+
enabled: _propTypes2.default.bool
|
|
799
|
+
};
|
|
800
|
+
ScrollSyncPane.defaultProps = {
|
|
801
|
+
group: 'default',
|
|
802
|
+
enabled: true
|
|
803
|
+
};
|
|
804
|
+
exports.default = ScrollSyncPane;
|
|
805
|
+
module.exports = exports['default'];
|
|
806
|
+
|
|
807
|
+
/***/ }),
|
|
808
|
+
/* 10 */
|
|
809
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
Object.defineProperty(exports, "__esModule", {
|
|
813
|
+
value: true
|
|
814
|
+
});
|
|
815
|
+
|
|
816
|
+
var _ScrollSync = __webpack_require__(8);
|
|
817
|
+
|
|
818
|
+
Object.defineProperty(exports, 'ScrollSync', {
|
|
819
|
+
enumerable: true,
|
|
820
|
+
get: function get() {
|
|
821
|
+
return _interopRequireDefault(_ScrollSync).default;
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
var _ScrollSyncPane = __webpack_require__(9);
|
|
826
|
+
|
|
827
|
+
Object.defineProperty(exports, 'ScrollSyncPane', {
|
|
828
|
+
enumerable: true,
|
|
829
|
+
get: function get() {
|
|
830
|
+
return _interopRequireDefault(_ScrollSyncPane).default;
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
|
|
834
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
835
|
+
|
|
836
|
+
/***/ }),
|
|
837
|
+
/* 11 */
|
|
838
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
839
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
840
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
841
|
+
* All rights reserved.
|
|
842
|
+
*
|
|
843
|
+
* This source code is licensed under the BSD-style license found in the
|
|
844
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
845
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
846
|
+
*/
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Assert that the values match with the type specs.
|
|
850
|
+
* Error messages are memorized and will only be shown once.
|
|
851
|
+
*
|
|
852
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
853
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
854
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
855
|
+
* @param {string} componentName Name of the component for error messages.
|
|
856
|
+
* @param {?Function} getStack Returns the component stack.
|
|
857
|
+
* @private
|
|
858
|
+
*/
|
|
859
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
module.exports = checkPropTypes;
|
|
863
|
+
|
|
864
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)));
|
|
865
|
+
|
|
866
|
+
/***/ }),
|
|
867
|
+
/* 12 */
|
|
868
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
869
|
+
/**
|
|
870
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
871
|
+
* All rights reserved.
|
|
872
|
+
*
|
|
873
|
+
* This source code is licensed under the BSD-style license found in the
|
|
874
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
875
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
876
|
+
*/
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
var emptyFunction = __webpack_require__(1);
|
|
881
|
+
var invariant = __webpack_require__(2);
|
|
882
|
+
var ReactPropTypesSecret = __webpack_require__(3);
|
|
883
|
+
|
|
884
|
+
module.exports = function() {
|
|
885
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
886
|
+
if (secret === ReactPropTypesSecret) {
|
|
887
|
+
// It is still safe when called from React.
|
|
888
|
+
return;
|
|
889
|
+
}
|
|
890
|
+
invariant(
|
|
891
|
+
false,
|
|
892
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
893
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
894
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
895
|
+
);
|
|
896
|
+
} shim.isRequired = shim;
|
|
897
|
+
function getShim() {
|
|
898
|
+
return shim;
|
|
899
|
+
} // Important!
|
|
900
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
901
|
+
var ReactPropTypes = {
|
|
902
|
+
array: shim,
|
|
903
|
+
bool: shim,
|
|
904
|
+
func: shim,
|
|
905
|
+
number: shim,
|
|
906
|
+
object: shim,
|
|
907
|
+
string: shim,
|
|
908
|
+
symbol: shim,
|
|
909
|
+
|
|
910
|
+
any: shim,
|
|
911
|
+
arrayOf: getShim,
|
|
912
|
+
element: shim,
|
|
913
|
+
instanceOf: getShim,
|
|
914
|
+
node: shim,
|
|
915
|
+
objectOf: getShim,
|
|
916
|
+
oneOf: getShim,
|
|
917
|
+
oneOfType: getShim,
|
|
918
|
+
shape: getShim
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
ReactPropTypes.checkPropTypes = emptyFunction;
|
|
922
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
923
|
+
|
|
924
|
+
return ReactPropTypes;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
/***/ }),
|
|
929
|
+
/* 13 */
|
|
930
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
931
|
+
/* WEBPACK VAR INJECTION */(function(process) {/**
|
|
932
|
+
* Copyright 2013-present, Facebook, Inc.
|
|
933
|
+
* All rights reserved.
|
|
934
|
+
*
|
|
935
|
+
* This source code is licensed under the BSD-style license found in the
|
|
936
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
|
937
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
|
938
|
+
*/
|
|
939
|
+
|
|
940
|
+
|
|
941
|
+
|
|
942
|
+
var emptyFunction = __webpack_require__(1);
|
|
943
|
+
var invariant = __webpack_require__(2);
|
|
944
|
+
var warning = __webpack_require__(6);
|
|
945
|
+
|
|
946
|
+
var ReactPropTypesSecret = __webpack_require__(3);
|
|
947
|
+
var checkPropTypes = __webpack_require__(11);
|
|
948
|
+
|
|
949
|
+
module.exports = function(isValidElement, throwOnDirectAccess) {
|
|
950
|
+
/* global Symbol */
|
|
951
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
952
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
953
|
+
|
|
954
|
+
/**
|
|
955
|
+
* Returns the iterator method function contained on the iterable object.
|
|
956
|
+
*
|
|
957
|
+
* Be sure to invoke the function with the iterable as context:
|
|
958
|
+
*
|
|
959
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
960
|
+
* if (iteratorFn) {
|
|
961
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
962
|
+
* ...
|
|
963
|
+
* }
|
|
964
|
+
*
|
|
965
|
+
* @param {?object} maybeIterable
|
|
966
|
+
* @return {?function}
|
|
967
|
+
*/
|
|
968
|
+
function getIteratorFn(maybeIterable) {
|
|
969
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
970
|
+
if (typeof iteratorFn === 'function') {
|
|
971
|
+
return iteratorFn;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
/**
|
|
976
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
977
|
+
* supplied to React components. Example usage:
|
|
978
|
+
*
|
|
979
|
+
* var Props = require('ReactPropTypes');
|
|
980
|
+
* var MyArticle = React.createClass({
|
|
981
|
+
* propTypes: {
|
|
982
|
+
* // An optional string prop named "description".
|
|
983
|
+
* description: Props.string,
|
|
984
|
+
*
|
|
985
|
+
* // A required enum prop named "category".
|
|
986
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
987
|
+
*
|
|
988
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
989
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
990
|
+
* },
|
|
991
|
+
* render: function() { ... }
|
|
992
|
+
* });
|
|
993
|
+
*
|
|
994
|
+
* A more formal specification of how these methods are used:
|
|
995
|
+
*
|
|
996
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
997
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
998
|
+
*
|
|
999
|
+
* Each and every declaration produces a function with the same signature. This
|
|
1000
|
+
* allows the creation of custom validation functions. For example:
|
|
1001
|
+
*
|
|
1002
|
+
* var MyLink = React.createClass({
|
|
1003
|
+
* propTypes: {
|
|
1004
|
+
* // An optional string or URI prop named "href".
|
|
1005
|
+
* href: function(props, propName, componentName) {
|
|
1006
|
+
* var propValue = props[propName];
|
|
1007
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
1008
|
+
* !(propValue instanceof URI)) {
|
|
1009
|
+
* return new Error(
|
|
1010
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
1011
|
+
* componentName
|
|
1012
|
+
* );
|
|
1013
|
+
* }
|
|
1014
|
+
* }
|
|
1015
|
+
* },
|
|
1016
|
+
* render: function() {...}
|
|
1017
|
+
* });
|
|
1018
|
+
*
|
|
1019
|
+
* @internal
|
|
1020
|
+
*/
|
|
1021
|
+
|
|
1022
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
1023
|
+
|
|
1024
|
+
// Important!
|
|
1025
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
1026
|
+
var ReactPropTypes = {
|
|
1027
|
+
array: createPrimitiveTypeChecker('array'),
|
|
1028
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
1029
|
+
func: createPrimitiveTypeChecker('function'),
|
|
1030
|
+
number: createPrimitiveTypeChecker('number'),
|
|
1031
|
+
object: createPrimitiveTypeChecker('object'),
|
|
1032
|
+
string: createPrimitiveTypeChecker('string'),
|
|
1033
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
1034
|
+
|
|
1035
|
+
any: createAnyTypeChecker(),
|
|
1036
|
+
arrayOf: createArrayOfTypeChecker,
|
|
1037
|
+
element: createElementTypeChecker(),
|
|
1038
|
+
instanceOf: createInstanceTypeChecker,
|
|
1039
|
+
node: createNodeChecker(),
|
|
1040
|
+
objectOf: createObjectOfTypeChecker,
|
|
1041
|
+
oneOf: createEnumTypeChecker,
|
|
1042
|
+
oneOfType: createUnionTypeChecker,
|
|
1043
|
+
shape: createShapeTypeChecker
|
|
1044
|
+
};
|
|
1045
|
+
|
|
1046
|
+
/**
|
|
1047
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
1048
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1049
|
+
*/
|
|
1050
|
+
/*eslint-disable no-self-compare*/
|
|
1051
|
+
function is(x, y) {
|
|
1052
|
+
// SameValue algorithm
|
|
1053
|
+
if (x === y) {
|
|
1054
|
+
// Steps 1-5, 7-10
|
|
1055
|
+
// Steps 6.b-6.e: +0 != -0
|
|
1056
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
1057
|
+
} else {
|
|
1058
|
+
// Step 6.a: NaN == NaN
|
|
1059
|
+
return x !== x && y !== y;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
/*eslint-enable no-self-compare*/
|
|
1063
|
+
|
|
1064
|
+
/**
|
|
1065
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
1066
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
1067
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
1068
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
1069
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
1070
|
+
*/
|
|
1071
|
+
function PropTypeError(message) {
|
|
1072
|
+
this.message = message;
|
|
1073
|
+
this.stack = '';
|
|
1074
|
+
}
|
|
1075
|
+
// Make `instanceof Error` still work for returned errors.
|
|
1076
|
+
PropTypeError.prototype = Error.prototype;
|
|
1077
|
+
|
|
1078
|
+
function createChainableTypeChecker(validate) {
|
|
1079
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
1080
|
+
componentName = componentName || ANONYMOUS;
|
|
1081
|
+
propFullName = propFullName || propName;
|
|
1082
|
+
|
|
1083
|
+
if (secret !== ReactPropTypesSecret) {
|
|
1084
|
+
if (throwOnDirectAccess) {
|
|
1085
|
+
// New behavior only for users of `prop-types` package
|
|
1086
|
+
invariant(
|
|
1087
|
+
false,
|
|
1088
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
1089
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
1090
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
1091
|
+
);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
if (props[propName] == null) {
|
|
1095
|
+
if (isRequired) {
|
|
1096
|
+
if (props[propName] === null) {
|
|
1097
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
1098
|
+
}
|
|
1099
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
1100
|
+
}
|
|
1101
|
+
return null;
|
|
1102
|
+
} else {
|
|
1103
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
1108
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
1109
|
+
|
|
1110
|
+
return chainedCheckType;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
1114
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
1115
|
+
var propValue = props[propName];
|
|
1116
|
+
var propType = getPropType(propValue);
|
|
1117
|
+
if (propType !== expectedType) {
|
|
1118
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
1119
|
+
// check, but we can offer a more precise error message here rather than
|
|
1120
|
+
// 'of type `object`'.
|
|
1121
|
+
var preciseType = getPreciseType(propValue);
|
|
1122
|
+
|
|
1123
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
|
1124
|
+
}
|
|
1125
|
+
return null;
|
|
1126
|
+
}
|
|
1127
|
+
return createChainableTypeChecker(validate);
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
function createAnyTypeChecker() {
|
|
1131
|
+
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
1135
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1136
|
+
if (typeof typeChecker !== 'function') {
|
|
1137
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
1138
|
+
}
|
|
1139
|
+
var propValue = props[propName];
|
|
1140
|
+
if (!Array.isArray(propValue)) {
|
|
1141
|
+
var propType = getPropType(propValue);
|
|
1142
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
1143
|
+
}
|
|
1144
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
1145
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
|
|
1146
|
+
if (error instanceof Error) {
|
|
1147
|
+
return error;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return null;
|
|
1151
|
+
}
|
|
1152
|
+
return createChainableTypeChecker(validate);
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
function createElementTypeChecker() {
|
|
1156
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1157
|
+
var propValue = props[propName];
|
|
1158
|
+
if (!isValidElement(propValue)) {
|
|
1159
|
+
var propType = getPropType(propValue);
|
|
1160
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
1161
|
+
}
|
|
1162
|
+
return null;
|
|
1163
|
+
}
|
|
1164
|
+
return createChainableTypeChecker(validate);
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
1168
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1169
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
1170
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
1171
|
+
var actualClassName = getClassName(props[propName]);
|
|
1172
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
1173
|
+
}
|
|
1174
|
+
return null;
|
|
1175
|
+
}
|
|
1176
|
+
return createChainableTypeChecker(validate);
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
function createEnumTypeChecker(expectedValues) {
|
|
1180
|
+
if (!Array.isArray(expectedValues)) {
|
|
1181
|
+
return emptyFunction.thatReturnsNull;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1185
|
+
var propValue = props[propName];
|
|
1186
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
1187
|
+
if (is(propValue, expectedValues[i])) {
|
|
1188
|
+
return null;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
var valuesString = JSON.stringify(expectedValues);
|
|
1193
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
1194
|
+
}
|
|
1195
|
+
return createChainableTypeChecker(validate);
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
1199
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1200
|
+
if (typeof typeChecker !== 'function') {
|
|
1201
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
1202
|
+
}
|
|
1203
|
+
var propValue = props[propName];
|
|
1204
|
+
var propType = getPropType(propValue);
|
|
1205
|
+
if (propType !== 'object') {
|
|
1206
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
1207
|
+
}
|
|
1208
|
+
for (var key in propValue) {
|
|
1209
|
+
if (propValue.hasOwnProperty(key)) {
|
|
1210
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1211
|
+
if (error instanceof Error) {
|
|
1212
|
+
return error;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return null;
|
|
1217
|
+
}
|
|
1218
|
+
return createChainableTypeChecker(validate);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
1222
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
1223
|
+
return emptyFunction.thatReturnsNull;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1227
|
+
var checker = arrayOfTypeCheckers[i];
|
|
1228
|
+
if (typeof checker !== 'function') {
|
|
1229
|
+
warning(
|
|
1230
|
+
false,
|
|
1231
|
+
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
|
|
1232
|
+
'received %s at index %s.',
|
|
1233
|
+
getPostfixForTypeWarning(checker),
|
|
1234
|
+
i
|
|
1235
|
+
);
|
|
1236
|
+
return emptyFunction.thatReturnsNull;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1241
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1242
|
+
var checker = arrayOfTypeCheckers[i];
|
|
1243
|
+
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
|
|
1244
|
+
return null;
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
|
1249
|
+
}
|
|
1250
|
+
return createChainableTypeChecker(validate);
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
function createNodeChecker() {
|
|
1254
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1255
|
+
if (!isNode(props[propName])) {
|
|
1256
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1257
|
+
}
|
|
1258
|
+
return null;
|
|
1259
|
+
}
|
|
1260
|
+
return createChainableTypeChecker(validate);
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
1264
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
1265
|
+
var propValue = props[propName];
|
|
1266
|
+
var propType = getPropType(propValue);
|
|
1267
|
+
if (propType !== 'object') {
|
|
1268
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1269
|
+
}
|
|
1270
|
+
for (var key in shapeTypes) {
|
|
1271
|
+
var checker = shapeTypes[key];
|
|
1272
|
+
if (!checker) {
|
|
1273
|
+
continue;
|
|
1274
|
+
}
|
|
1275
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
|
|
1276
|
+
if (error) {
|
|
1277
|
+
return error;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
return null;
|
|
1281
|
+
}
|
|
1282
|
+
return createChainableTypeChecker(validate);
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
function isNode(propValue) {
|
|
1286
|
+
switch (typeof propValue) {
|
|
1287
|
+
case 'number':
|
|
1288
|
+
case 'string':
|
|
1289
|
+
case 'undefined':
|
|
1290
|
+
return true;
|
|
1291
|
+
case 'boolean':
|
|
1292
|
+
return !propValue;
|
|
1293
|
+
case 'object':
|
|
1294
|
+
if (Array.isArray(propValue)) {
|
|
1295
|
+
return propValue.every(isNode);
|
|
1296
|
+
}
|
|
1297
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
1298
|
+
return true;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
1302
|
+
if (iteratorFn) {
|
|
1303
|
+
var iterator = iteratorFn.call(propValue);
|
|
1304
|
+
var step;
|
|
1305
|
+
if (iteratorFn !== propValue.entries) {
|
|
1306
|
+
while (!(step = iterator.next()).done) {
|
|
1307
|
+
if (!isNode(step.value)) {
|
|
1308
|
+
return false;
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
} else {
|
|
1312
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1313
|
+
while (!(step = iterator.next()).done) {
|
|
1314
|
+
var entry = step.value;
|
|
1315
|
+
if (entry) {
|
|
1316
|
+
if (!isNode(entry[1])) {
|
|
1317
|
+
return false;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
} else {
|
|
1323
|
+
return false;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
return true;
|
|
1327
|
+
default:
|
|
1328
|
+
return false;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
function isSymbol(propType, propValue) {
|
|
1333
|
+
// Native Symbol.
|
|
1334
|
+
if (propType === 'symbol') {
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1339
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1340
|
+
return true;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1344
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
|
|
1348
|
+
return false;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1352
|
+
function getPropType(propValue) {
|
|
1353
|
+
var propType = typeof propValue;
|
|
1354
|
+
if (Array.isArray(propValue)) {
|
|
1355
|
+
return 'array';
|
|
1356
|
+
}
|
|
1357
|
+
if (propValue instanceof RegExp) {
|
|
1358
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1359
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1360
|
+
// passes PropTypes.object.
|
|
1361
|
+
return 'object';
|
|
1362
|
+
}
|
|
1363
|
+
if (isSymbol(propType, propValue)) {
|
|
1364
|
+
return 'symbol';
|
|
1365
|
+
}
|
|
1366
|
+
return propType;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1370
|
+
// See `createPrimitiveTypeChecker`.
|
|
1371
|
+
function getPreciseType(propValue) {
|
|
1372
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1373
|
+
return '' + propValue;
|
|
1374
|
+
}
|
|
1375
|
+
var propType = getPropType(propValue);
|
|
1376
|
+
if (propType === 'object') {
|
|
1377
|
+
if (propValue instanceof Date) {
|
|
1378
|
+
return 'date';
|
|
1379
|
+
} else if (propValue instanceof RegExp) {
|
|
1380
|
+
return 'regexp';
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
return propType;
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1387
|
+
// For example, "undefined" or "of type array"
|
|
1388
|
+
function getPostfixForTypeWarning(value) {
|
|
1389
|
+
var type = getPreciseType(value);
|
|
1390
|
+
switch (type) {
|
|
1391
|
+
case 'array':
|
|
1392
|
+
case 'object':
|
|
1393
|
+
return 'an ' + type;
|
|
1394
|
+
case 'boolean':
|
|
1395
|
+
case 'date':
|
|
1396
|
+
case 'regexp':
|
|
1397
|
+
return 'a ' + type;
|
|
1398
|
+
default:
|
|
1399
|
+
return type;
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
// Returns class name of the object, if any.
|
|
1404
|
+
function getClassName(propValue) {
|
|
1405
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1406
|
+
return ANONYMOUS;
|
|
1407
|
+
}
|
|
1408
|
+
return propValue.constructor.name;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
1412
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
1413
|
+
|
|
1414
|
+
return ReactPropTypes;
|
|
1415
|
+
};
|
|
1416
|
+
|
|
1417
|
+
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)));
|
|
1418
|
+
|
|
1419
|
+
/***/ })
|
|
1420
|
+
/******/ ]);
|
|
1421
|
+
});
|
|
1422
|
+
|
|
1423
|
+
} (dist, dist.exports));
|
|
1424
|
+
|
|
1425
|
+
var distExports = dist.exports;
|
|
1426
|
+
|
|
1427
|
+
var fetch = function fetch() {
|
|
1428
|
+
return axios.get("".concat(BASE_URL, "/permissions"));
|
|
1429
|
+
};
|
|
1430
|
+
var permissionsApi = {
|
|
1431
|
+
fetch: fetch
|
|
1432
|
+
};
|
|
1433
|
+
|
|
1434
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1435
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1436
|
+
var useFetchPermissions = function useFetchPermissions() {
|
|
1437
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1438
|
+
return useQuery(_objectSpread$1({
|
|
1439
|
+
queryKey: [QUERY_KEYS.PERMISSIONS],
|
|
1440
|
+
queryFn: permissionsApi.fetch,
|
|
1441
|
+
select: function select(response) {
|
|
1442
|
+
return response === null || response === void 0 ? void 0 : response.permissions;
|
|
1443
|
+
}
|
|
1444
|
+
}, options));
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1447
|
+
var css = ":root{--ntm-roles-table-default-scroll:15px;--ntm-roles-table-cell-height:48px;--ntm-roles-sidebar-width:480px;--ntm-roles-table-header-height:72px}.ntm-scrollbar__inner{height:200px;width:100%}.ntm-scrollbar__outer{height:150px;left:0;overflow:hidden;position:absolute;top:0;visibility:hidden;width:200px}.ntm-empty-state{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.ntm-roles-pane__body{margin-bottom:1.5rem;width:100%}.ntm-roles-pane__body-wrapper>*+*{margin-top:1rem}.ntm-roles-pane__body>*+*{margin-top:1.5rem}.ntm-roles-pane__footer{display:flex;gap:.5rem}.ntm-roles-permission__heading{color:rgb(var(--neeto-ui-gray-500));text-transform:uppercase}.ntm-roles-permission__card{background-color:rgb(var(--neeto-ui-white));display:flex;flex-direction:column;gap:.75rem;padding:.4rem 0;position:relative}.ntm-roles-permission__card:after{background-color:rgb(var(--neeto-ui-gray-300));content:\"\";height:1px;left:-15px;position:absolute;top:14px;width:10px}.ntm-roles-permission__card--description{flex-grow:1}.ntm-roles-permission__card--checkbox{padding:0 .5rem}.ntm-roles-permission__card .neeto-ui-checkbox__wrapper .neeto-ui-checkbox__container{align-items:flex-start}.ntm-roles-permission__card .neeto-ui-checkbox__wrapper .neeto-ui-checkbox__container .neeto-ui-checkbox[type=checkbox]:disabled+.neeto-ui-label{cursor:not-allowed;opacity:.5}.ntm-roles-permission__sub-blocks{position:relative}.ntm-roles-permission__sub-blocks:before{background-color:rgb(var(--neeto-ui-gray-300));content:\"\";height:calc(100% - 14px);left:8px;position:absolute;top:0;width:1px}.ntm-roles-permission__sub-blocks:empty{display:none}.ntm-roles-permission-category-card{border:1px solid rgb(var(--neeto-ui-gray-400));border-radius:var(--neeto-ui-rounded);padding:10px 20px}.ntm-roles-permission-category-card>.ntm-roles-permission__card:after{display:none}.ntm-roles-table__wrapper{height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - 24px);padding:0 40px;width:100%}@media screen and (max-width:1024px){.ntm-roles-table__wrapper{--neeto-molecules-main-header-with-breadcrumbs-height:216px}}@media screen and (max-width:768px){.ntm-roles-table__wrapper{--neeto-molecules-main-header-with-breadcrumbs-height:186px;overflow:hidden;padding:0 20px}}.ntm-roles-table__container{display:flex;height:100%}@media screen and (max-width:768px){.ntm-roles-table__container{height:auto;overflow-y:auto}}.ntm-roles-table__sidebar{border-top:thin solid rgb(var(--neeto-ui-gray-200));height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - 28px);min-width:480px;min-width:var(--ntm-roles-sidebar-width);width:480px;width:var(--ntm-roles-sidebar-width)}@media screen and (max-width:768px){.ntm-roles-table__sidebar{height:100%}}.ntm-roles-table-sidebar__search{height:72px;height:var(--ntm-roles-table-header-height);padding:20px 24px}.ntm-roles-table-sidebar__list,.ntm-roles-table-sidebar__search{border-bottom:thin solid rgb(var(--neeto-ui-gray-200));border-left:thin solid rgb(var(--neeto-ui-gray-200));border-right:thin solid rgb(var(--neeto-ui-gray-200))}.ntm-roles-table-sidebar__list{max-height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - 115px);max-height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - var(--ntm-roles-table-header-height) - var(--ntm-roles-table-default-scroll) - 28px);overflow:auto;white-space:nowrap}.ntm-roles-table-sidebar__list-item{display:flex;flex-direction:column;justify-content:center;min-height:48px;min-height:var(--ntm-roles-table-cell-height);overflow-wrap:break-word;position:relative;white-space:normal}.ntm-roles-table-sidebar__list-item:after{background-color:rgb(var(--neeto-ui-gray-300));content:\"\";height:1px;left:-18px;position:absolute;top:23px;width:14px}.ntm-roles-table-sidebar__list-item.ntm-roles-table-sidebar__list-item--highlighted{background-color:rgb(var(--neeto-ui-gray-100));border-top:thin solid rgb(var(--neeto-ui-gray-200));flex-direction:row;justify-content:space-between;padding:11px 24px}.ntm-roles-table__columns{border-top:thin solid rgb(var(--neeto-ui-gray-200));flex-grow:1;overflow:hidden}@media screen and (max-width:768px){.ntm-roles-table__columns{overflow:visible;overflow:initial}}.ntm-roles-table__cell{align-items:center;border-right:thin solid rgb(var(--neeto-ui-gray-200));display:flex;height:48px;height:var(--ntm-roles-table-cell-height);justify-content:center;min-height:48px;min-height:var(--ntm-roles-table-cell-height);min-width:200px;padding:12px 8px;width:100%}.ntm-roles-table-cell__checkbox-wrapper{height:1rem;margin:auto;position:absolute;width:1rem;z-index:10}.ntm-roles-table-cell__checkbox{z-index:10}.ntm-roles-table__header{align-items:center;display:flex;overflow-x:auto}.ntm-roles-table__header .ntm-roles-table__cell{border-bottom:thin solid rgb(var(--neeto-ui-gray-200));height:72px;height:var(--ntm-roles-table-header-height)}@media screen and (max-width:768px){.ntm-roles-table__header{overflow:visible;overflow:initial}}.ntm-roles-table-header-cell__container{align-items:center;display:flex;justify-content:space-between;overflow:hidden;width:100%}.ntm-roles-table-header__dropdown{flex-shrink:0;margin:3px}.ntm-roles-table-header__role-name{overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;width:100%}.ntm-roles-table__rows{max-height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - 115px);max-height:calc(100vh - var(--neeto-molecules-main-header-with-breadcrumbs-height) - var(--ntm-roles-table-header-height) - var(--ntm-roles-table-default-scroll) - 28px);overflow-y:auto;scrollbar-width:none;width:100%}.ntm-roles-table__rows::-webkit-scrollbar{height:0;width:0}.ntm-roles-table__rows::-webkit-scrollbar-thumb{background:rgb(var(--neeto-ui-gray-300));border-radius:50px}.ntm-roles-table__rows::-webkit-scrollbar-thumb:hover{border-radius:50px}.ntm-roles-table__rows::-webkit-scrollbar-track{background:rgb(var(--neeto-ui-gray-300))}.ntm-roles-table__rows div:last-child .ntm-roles-table__row:last-child .ntm-roles-table__cell{border-bottom:thin solid rgb(var(--neeto-ui-gray-200))}.ntm-roles-table__row{align-items:center;display:flex}.ntm-roles-table__row .ntm-roles-table__cell{overflow:hidden;position:relative}.ntm-roles-table__row .ntm-roles-table__cell p{min-width:340px;opacity:0;width:340px}.ntm-roles-table__row.ntm-roles-table__row--highlighted .ntm-roles-table__cell{background-color:rgb(var(--neeto-ui-gray-100))}.ntm-roles-table__row .ntm-roles-table__cell{border-top:thin solid rgb(var(--neeto-ui-gray-200))}.ntm-roles-table-sidebar__drop-down-button{color:rgb(var(--neeto-ui-gray-600));cursor:pointer}.ntm-roles-modal__body>*+*{margin-top:1rem}.ntm-roles-modal__footer{display:flex;gap:.5rem}.ntm-roles-help-url-wrapper{align-items:center;display:flex;justify-content:center;padding:1rem 0;width:100%}.ntm-roles-table-sidebar__list-item-spacing-handler>.ntm-roles-table-sidebar__list-item:after,.ntm-roles-table-sidebar__list-item-spacing-handler>.ntm-roles-table-sidebar__list-item:before{display:none}.ntm-roles-table-sidebar__sub-blocks{position:relative}.ntm-roles-table-sidebar__sub-blocks:before{background-color:rgb(var(--neeto-ui-gray-300));content:\"\";height:calc(100% - 24px);left:6px;position:absolute;top:0;width:1px}.ntm-roles-table-sidebar__sub-blocks:empty{display:none}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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YW5zcGFyZW50XG4pIHtcbiAgc2Nyb2xsYmFyLXdpZHRoOiBub25lO1xuXG4gICY6Oi13ZWJraXQtc2Nyb2xsYmFyIHtcbiAgICB3aWR0aDogJHNpemU7XG4gICAgaGVpZ2h0OiAkc2l6ZTtcbiAgfVxuXG4gICY6Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1iIHtcbiAgICBiYWNrZ3JvdW5kOiAkZm9yZWdyb3VuZC1jb2xvcjtcbiAgICBib3JkZXItcmFkaXVzOiA1MHB4O1xuICB9XG5cbiAgJjo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWI6aG92ZXIge1xuICAgIGJvcmRlci1yYWRpdXM6IDUwcHg7XG4gIH1cblxuICAmOjotd2Via2l0LXNjcm9sbGJhci10cmFjayB7XG4gICAgYmFja2dyb3VuZDogJGJhY2tncm91bmQtY29sb3I7XG4gIH1cbn1cbiJdfQ== */";
|
|
1448
|
+
n(css,{});
|
|
1449
|
+
|
|
1450
|
+
var renderSearchProps = function renderSearchProps() {
|
|
1451
|
+
return {
|
|
1452
|
+
"data-cy": "ntm-search-roles-input",
|
|
1453
|
+
placeholder: t("neetoTeamMembers.placeholders.searchRole", PLURAL)
|
|
1454
|
+
};
|
|
1455
|
+
};
|
|
1456
|
+
var renderBreadcrumbs = function renderBreadcrumbs(breadcrumbs) {
|
|
1457
|
+
return breadcrumbs !== null && breadcrumbs !== void 0 ? breadcrumbs : [{
|
|
1458
|
+
text: taxonomies.member.plural,
|
|
1459
|
+
link: "/members"
|
|
1460
|
+
}];
|
|
1461
|
+
};
|
|
1462
|
+
|
|
1463
|
+
var AddRoleButton = function AddRoleButton(_ref) {
|
|
1464
|
+
var config = _ref.config,
|
|
1465
|
+
onClick = _ref.onClick;
|
|
1466
|
+
var _useTranslation = useTranslation(),
|
|
1467
|
+
t = _useTranslation.t;
|
|
1468
|
+
var isCreatePermissionGranted = config.permissions.create;
|
|
1469
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
1470
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToAddRole"),
|
|
1471
|
+
disabled: isCreatePermissionGranted,
|
|
1472
|
+
position: "bottom",
|
|
1473
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1474
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1475
|
+
"data-cy": "ntm-add-role-button",
|
|
1476
|
+
disabled: !isCreatePermissionGranted,
|
|
1477
|
+
label: t("neetoTeamMembers.labels.addNewRole"),
|
|
1478
|
+
onClick: onClick
|
|
1479
|
+
})
|
|
1480
|
+
})
|
|
1481
|
+
});
|
|
1482
|
+
};
|
|
1483
|
+
|
|
1484
|
+
var Header = function Header(_ref) {
|
|
1485
|
+
var _config$header;
|
|
1486
|
+
var config = _ref.config,
|
|
1487
|
+
handleReset = _ref.handleReset,
|
|
1488
|
+
handleSubmit = _ref.handleSubmit,
|
|
1489
|
+
_ref$isDirty = _ref.isDirty,
|
|
1490
|
+
isDirty = _ref$isDirty === void 0 ? false : _ref$isDirty,
|
|
1491
|
+
setIsNewRolePaneOpen = _ref.setIsNewRolePaneOpen,
|
|
1492
|
+
roles = _ref.roles;
|
|
1493
|
+
var _useTranslation = useTranslation(),
|
|
1494
|
+
t = _useTranslation.t;
|
|
1495
|
+
var isUpdatePermissionGranted = config.permissions.update;
|
|
1496
|
+
return /*#__PURE__*/jsx(NeetoHeader, {
|
|
1497
|
+
breadcrumbs: renderBreadcrumbs(config === null || config === void 0 || (_config$header = config.header) === null || _config$header === void 0 ? void 0 : _config$header.breadcrumbs),
|
|
1498
|
+
className: "ntm-roles-header",
|
|
1499
|
+
searchProps: isNotEmpty(roles) ? renderSearchProps() : null,
|
|
1500
|
+
actionBlock: isDirty ? /*#__PURE__*/jsxs(Fragment, {
|
|
1501
|
+
children: [/*#__PURE__*/jsx(Tooltip, {
|
|
1502
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToEditRoles"),
|
|
1503
|
+
disabled: isUpdatePermissionGranted,
|
|
1504
|
+
position: "bottom",
|
|
1505
|
+
children: /*#__PURE__*/jsx("span", {
|
|
1506
|
+
children: /*#__PURE__*/jsx(Button, {
|
|
1507
|
+
"data-cy": "ntm-role-submission-button",
|
|
1508
|
+
disabled: !isUpdatePermissionGranted,
|
|
1509
|
+
label: t("neetoTeamMembers.buttons.saveChanges"),
|
|
1510
|
+
type: "submit",
|
|
1511
|
+
onClick: handleSubmit
|
|
1512
|
+
})
|
|
1513
|
+
})
|
|
1514
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
1515
|
+
"data-cy": "ntm-role-reset-button",
|
|
1516
|
+
label: t("neetoTeamMembers.buttons.reset"),
|
|
1517
|
+
style: "text",
|
|
1518
|
+
type: "reset",
|
|
1519
|
+
onClick: handleReset
|
|
1520
|
+
})]
|
|
1521
|
+
}) : /*#__PURE__*/jsx(AddRoleButton, {
|
|
1522
|
+
config: config,
|
|
1523
|
+
onClick: function onClick() {
|
|
1524
|
+
return setIsNewRolePaneOpen(true);
|
|
1525
|
+
}
|
|
1526
|
+
}),
|
|
1527
|
+
title: /*#__PURE__*/jsxs("span", {
|
|
1528
|
+
className: "neeto-ui-flex neeto-ui-items-center neeto-ui-gap-6",
|
|
1529
|
+
children: [t("neetoTeamMembers.common.role", PLURAL), (config === null || config === void 0 ? void 0 : config.helpUrl) && /*#__PURE__*/jsx(Button, {
|
|
1530
|
+
className: "neeto-ui-mt-1",
|
|
1531
|
+
"data-cy": "ntm-roles-permission-more-info-button",
|
|
1532
|
+
href: config === null || config === void 0 ? void 0 : config.helpUrl,
|
|
1533
|
+
icon: ExternalLink,
|
|
1534
|
+
label: t("neetoTeamMembers.helpers.moreInfoAboutPermissions"),
|
|
1535
|
+
style: "link",
|
|
1536
|
+
target: "_blank"
|
|
1537
|
+
})]
|
|
1538
|
+
})
|
|
1539
|
+
});
|
|
1540
|
+
};
|
|
1541
|
+
|
|
1542
|
+
var ROLE_NAME_MAX_LENGTH = 40;
|
|
1543
|
+
var ROLE_DESCRIPTION_MAX_LENGTH = 255;
|
|
1544
|
+
var ADD_ROLE_FORM_VALIDATION_SCHEMA = object({
|
|
1545
|
+
name: string().trim().max(ROLE_NAME_MAX_LENGTH,
|
|
1546
|
+
// @ts-ignore
|
|
1547
|
+
t("neetoTeamMembers.validations.nameLimitExceeded", {
|
|
1548
|
+
limit: ROLE_NAME_MAX_LENGTH
|
|
1549
|
+
}))
|
|
1550
|
+
// @ts-ignore
|
|
1551
|
+
.required(t("neetoTeamMembers.validations.enterRoleName")),
|
|
1552
|
+
description: string().trim().max(ROLE_DESCRIPTION_MAX_LENGTH,
|
|
1553
|
+
// @ts-ignore
|
|
1554
|
+
t("neetoTeamMembers.validations.descriptionLimitExceeded", {
|
|
1555
|
+
limit: ROLE_DESCRIPTION_MAX_LENGTH
|
|
1556
|
+
}))
|
|
1557
|
+
});
|
|
1558
|
+
var ADD_ROLE_FORM_INITIAL_VALUES = {
|
|
1559
|
+
name: "",
|
|
1560
|
+
description: "",
|
|
1561
|
+
permissionIds: []
|
|
1562
|
+
};
|
|
1563
|
+
var ROLE_FORMIK_PROPS = {
|
|
1564
|
+
validationSchema: ADD_ROLE_FORM_VALIDATION_SCHEMA
|
|
1565
|
+
};
|
|
1566
|
+
|
|
1567
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1568
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1569
|
+
var ManageRoles = function ManageRoles(_ref) {
|
|
1570
|
+
var config = _ref.config,
|
|
1571
|
+
_ref$isOpen = _ref.isOpen,
|
|
1572
|
+
isOpen = _ref$isOpen === void 0 ? false : _ref$isOpen,
|
|
1573
|
+
onClose = _ref.onClose,
|
|
1574
|
+
_ref$permissions = _ref.permissions,
|
|
1575
|
+
permissions = _ref$permissions === void 0 ? [] : _ref$permissions,
|
|
1576
|
+
_ref$selectedRole = _ref.selectedRole,
|
|
1577
|
+
selectedRole = _ref$selectedRole === void 0 ? {} : _ref$selectedRole;
|
|
1578
|
+
var _useTranslation = useTranslation(),
|
|
1579
|
+
t = _useTranslation.t;
|
|
1580
|
+
var formReference = useRef(null);
|
|
1581
|
+
var inputReference = useRef(null);
|
|
1582
|
+
var _useCreateRole = useCreateRole({
|
|
1583
|
+
onSuccess: onClose
|
|
1584
|
+
}),
|
|
1585
|
+
createRole = _useCreateRole.mutate,
|
|
1586
|
+
isCreatingRole = _useCreateRole.isPending;
|
|
1587
|
+
var _useUpdateRole = useUpdateRole({
|
|
1588
|
+
onSuccess: onClose
|
|
1589
|
+
}),
|
|
1590
|
+
updateRole = _useUpdateRole.mutate,
|
|
1591
|
+
isUpdatingRole = _useUpdateRole.isPending;
|
|
1592
|
+
var isEdit = isPresent(selectedRole);
|
|
1593
|
+
var isSubmitting = isCreatingRole || isUpdatingRole;
|
|
1594
|
+
var handleSubmit = function handleSubmit(formValues) {
|
|
1595
|
+
var payload = {
|
|
1596
|
+
organizationRole: _objectSpread(_objectSpread({}, formValues), {}, {
|
|
1597
|
+
name: formValues.name.trim(),
|
|
1598
|
+
description: formValues.description.trim()
|
|
1599
|
+
})
|
|
1600
|
+
};
|
|
1601
|
+
isEdit ? updateRole({
|
|
1602
|
+
payload: payload,
|
|
1603
|
+
id: selectedRole.id
|
|
1604
|
+
}) : createRole(payload);
|
|
1605
|
+
};
|
|
1606
|
+
var initialValues = isEdit ? selectedRole : ADD_ROLE_FORM_INITIAL_VALUES;
|
|
1607
|
+
var formikProps = _objectSpread(_objectSpread({}, ROLE_FORMIK_PROPS), {}, {
|
|
1608
|
+
initialValues: initialValues,
|
|
1609
|
+
onSubmit: handleSubmit
|
|
1610
|
+
});
|
|
1611
|
+
var isReadOnly = selectedRole.kind === "system";
|
|
1612
|
+
var isDisabled = ADMIN_ROLES.includes(selectedRole.name) && isReadOnly;
|
|
1613
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
1614
|
+
isOpen: isOpen,
|
|
1615
|
+
onClose: onClose,
|
|
1616
|
+
initialFocusRef: inputReference,
|
|
1617
|
+
children: [/*#__PURE__*/jsx(Pane.Header, {
|
|
1618
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
1619
|
+
"data-cy": "ntm-add-role-title",
|
|
1620
|
+
style: "h2",
|
|
1621
|
+
children: isEdit ? t("neetoTeamMembers.labels.editRole") : t("neetoTeamMembers.labels.addNewRole")
|
|
1622
|
+
})
|
|
1623
|
+
}), /*#__PURE__*/jsx(Form, {
|
|
1624
|
+
formikProps: formikProps,
|
|
1625
|
+
ref: formReference,
|
|
1626
|
+
children: function children(_ref2) {
|
|
1627
|
+
var _config$permissionRel;
|
|
1628
|
+
var dirty = _ref2.dirty;
|
|
1629
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
1630
|
+
children: [/*#__PURE__*/jsx(ScrollToErrorField, {
|
|
1631
|
+
formRef: formReference
|
|
1632
|
+
}), /*#__PURE__*/jsx(Pane.Body, {
|
|
1633
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1634
|
+
className: "ntm-roles-pane__body",
|
|
1635
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
1636
|
+
className: "ntm-roles-pane__body-wrapper",
|
|
1637
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
1638
|
+
required: true,
|
|
1639
|
+
unlimitedChars: true,
|
|
1640
|
+
"data-cy": "ntm-add-role-name-text-field",
|
|
1641
|
+
label: t("neetoTeamMembers.common.name"),
|
|
1642
|
+
maxLength: ROLE_NAME_MAX_LENGTH,
|
|
1643
|
+
name: "name",
|
|
1644
|
+
placeholder: t("neetoTeamMembers.placeholders.enterName"),
|
|
1645
|
+
readOnly: isReadOnly,
|
|
1646
|
+
ref: inputReference
|
|
1647
|
+
}), /*#__PURE__*/jsx(Textarea, {
|
|
1648
|
+
unlimitedChars: true,
|
|
1649
|
+
"data-cy": "ntm-add-role-description-text-field",
|
|
1650
|
+
label: t("neetoTeamMembers.common.description"),
|
|
1651
|
+
maxLength: ROLE_DESCRIPTION_MAX_LENGTH,
|
|
1652
|
+
name: "description",
|
|
1653
|
+
readOnly: isDisabled,
|
|
1654
|
+
placeholder: t("neetoTeamMembers.placeholders.enterDescription")
|
|
1655
|
+
})]
|
|
1656
|
+
}), /*#__PURE__*/jsx(Permissions, {
|
|
1657
|
+
isDisabled: isDisabled,
|
|
1658
|
+
permissions: permissions,
|
|
1659
|
+
permissionRelationConfig: (_config$permissionRel = config === null || config === void 0 ? void 0 : config.permissionRelation) !== null && _config$permissionRel !== void 0 ? _config$permissionRel : {}
|
|
1660
|
+
})]
|
|
1661
|
+
})
|
|
1662
|
+
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
1663
|
+
children: /*#__PURE__*/jsx(ActionBlock, {
|
|
1664
|
+
isSubmitting: isSubmitting,
|
|
1665
|
+
className: "ntm-roles-pane__footer",
|
|
1666
|
+
cancelButtonProps: {
|
|
1667
|
+
"data-cy": "ntm-add-role-cancel-button",
|
|
1668
|
+
onClick: onClose
|
|
1669
|
+
},
|
|
1670
|
+
submitButtonProps: {
|
|
1671
|
+
"data-cy": "ntm-add-role-submit-button",
|
|
1672
|
+
disabled: isSubmitting || isDisabled || !dirty
|
|
1673
|
+
}
|
|
1674
|
+
})
|
|
1675
|
+
})]
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
})]
|
|
1679
|
+
});
|
|
1680
|
+
};
|
|
1681
|
+
|
|
1682
|
+
var DEFAULT_MANAGE_ROLE_VALUES = {
|
|
1683
|
+
isDelete: false,
|
|
1684
|
+
isEdit: false,
|
|
1685
|
+
selectedRole: {}
|
|
1686
|
+
};
|
|
1687
|
+
var MENU_ITEMS = {
|
|
1688
|
+
EDIT: "edit",
|
|
1689
|
+
DELETE: "delete"
|
|
1690
|
+
};
|
|
1691
|
+
|
|
1692
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
1693
|
+
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); }
|
|
1694
|
+
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; }
|
|
1695
|
+
var deepClone = function deepClone(object) {
|
|
1696
|
+
if (!object || true === object) {
|
|
1697
|
+
//this also handles boolean as true and false
|
|
1698
|
+
return object;
|
|
1699
|
+
}
|
|
1700
|
+
var objectType = _typeof(object);
|
|
1701
|
+
if ("number" === objectType || "string" === objectType) {
|
|
1702
|
+
// add your immutables here
|
|
1703
|
+
return object;
|
|
1704
|
+
}
|
|
1705
|
+
var result = null;
|
|
1706
|
+
if (Array.isArray(object)) {
|
|
1707
|
+
result = [];
|
|
1708
|
+
} else if (!object.constructor) {
|
|
1709
|
+
result = {};
|
|
1710
|
+
} else {
|
|
1711
|
+
result = new object.constructor();
|
|
1712
|
+
}
|
|
1713
|
+
if (object instanceof Map) {
|
|
1714
|
+
var _iterator = _createForOfIteratorHelper(object.keys()),
|
|
1715
|
+
_step;
|
|
1716
|
+
try {
|
|
1717
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
1718
|
+
var key = _step.value;
|
|
1719
|
+
result.set(key, deepClone(object.get(key)));
|
|
1720
|
+
}
|
|
1721
|
+
} catch (err) {
|
|
1722
|
+
_iterator.e(err);
|
|
1723
|
+
} finally {
|
|
1724
|
+
_iterator.f();
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
Object.keys(object).forEach(function (key) {
|
|
1728
|
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
|
1729
|
+
result[key] = deepClone(object[key]);
|
|
1730
|
+
}
|
|
1731
|
+
});
|
|
1732
|
+
return result;
|
|
1733
|
+
};
|
|
1734
|
+
var renderRolesTooltipContent = function renderRolesTooltipContent(roleName) {
|
|
1735
|
+
return Object.is(roleName, "Admin") ? t("neetoTeamMembers.tooltips.adminMustHaveAccess") : t("neetoTeamMembers.tooltips.noPermissionToEditRoles");
|
|
1736
|
+
};
|
|
1737
|
+
var removeDuplicates = function removeDuplicates(array) {
|
|
1738
|
+
return _toConsumableArray(new Set(array));
|
|
1739
|
+
};
|
|
1740
|
+
var updatePermissionVisibility = function updatePermissionVisibility(categoryName, permissions) {
|
|
1741
|
+
var category = permissions.get(categoryName);
|
|
1742
|
+
var isPermissionVisible = category.get("isPermissionVisible");
|
|
1743
|
+
category.set("isPermissionVisible", !isPermissionVisible);
|
|
1744
|
+
return new Map(permissions.set(categoryName, category));
|
|
1745
|
+
};
|
|
1746
|
+
var filterPermissionsBySearch = function filterPermissionsBySearch(searchTerm, permissionGroups) {
|
|
1747
|
+
var newValue = deepClone(permissionGroups);
|
|
1748
|
+
newValue.forEach(function (value) {
|
|
1749
|
+
var permissions = value.get("permissions");
|
|
1750
|
+
var filteredPermissions = permissions.filter(function (permission) {
|
|
1751
|
+
var _permission$descripti;
|
|
1752
|
+
return permission === null || permission === void 0 || (_permission$descripti = permission.description) === null || _permission$descripti === void 0 || (_permission$descripti = _permission$descripti.toLowerCase()) === null || _permission$descripti === void 0 || (_permission$descripti = _permission$descripti.trim()) === null || _permission$descripti === void 0 ? void 0 : _permission$descripti.includes(searchTerm.toLowerCase().trim());
|
|
1753
|
+
});
|
|
1754
|
+
value.set("permissions", filteredPermissions);
|
|
1755
|
+
});
|
|
1756
|
+
return newValue;
|
|
1757
|
+
};
|
|
1758
|
+
var getMenuItems = function getMenuItems(_ref) {
|
|
1759
|
+
var isDeletePermissionGranted = _ref.isDeletePermissionGranted,
|
|
1760
|
+
isUpdatePermissionGranted = _ref.isUpdatePermissionGranted,
|
|
1761
|
+
role = _ref.role,
|
|
1762
|
+
setManageRole = _ref.setManageRole,
|
|
1763
|
+
isSystemRole = _ref.isSystemRole;
|
|
1764
|
+
return [{
|
|
1765
|
+
key: MENU_ITEMS.EDIT,
|
|
1766
|
+
className: "ntm-dropdown__button",
|
|
1767
|
+
"data-cy": "ntm-roles-table-edit-role-button",
|
|
1768
|
+
isDisabled: not(isUpdatePermissionGranted),
|
|
1769
|
+
size: "small",
|
|
1770
|
+
tooltipProps: {
|
|
1771
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToEditRoles"),
|
|
1772
|
+
disabled: isUpdatePermissionGranted,
|
|
1773
|
+
position: "left"
|
|
1774
|
+
},
|
|
1775
|
+
label: t("neetoTeamMembers.common.edit"),
|
|
1776
|
+
onClick: function onClick() {
|
|
1777
|
+
return setManageRole({
|
|
1778
|
+
isEdit: true,
|
|
1779
|
+
selectedRole: role
|
|
1780
|
+
});
|
|
1781
|
+
}
|
|
1782
|
+
}, {
|
|
1783
|
+
key: MENU_ITEMS.DELETE,
|
|
1784
|
+
className: "ntm-dropdown__button",
|
|
1785
|
+
"data-cy": "ntm-roles-table-delete-role-button",
|
|
1786
|
+
isDisabled: not(isDeletePermissionGranted),
|
|
1787
|
+
size: "small",
|
|
1788
|
+
isVisible: not(isSystemRole),
|
|
1789
|
+
tooltipProps: {
|
|
1790
|
+
content: t("neetoTeamMembers.tooltips.noPermissionToRemoveRoles"),
|
|
1791
|
+
disabled: isDeletePermissionGranted,
|
|
1792
|
+
position: "left"
|
|
1793
|
+
},
|
|
1794
|
+
label: t("neetoTeamMembers.common.delete"),
|
|
1795
|
+
onClick: function onClick() {
|
|
1796
|
+
return setManageRole({
|
|
1797
|
+
isDelete: true,
|
|
1798
|
+
selectedRole: role
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
}];
|
|
1802
|
+
};
|
|
1803
|
+
var getRowClientHeight = function getRowClientHeight(permission) {
|
|
1804
|
+
var sidebarItems = Array.from(document.querySelectorAll(".ntm-roles-table-sidebar__list-item:not(.ntm-roles-table-sidebar__list-item--highlighted)"));
|
|
1805
|
+
var sidebarItem = _findBy({
|
|
1806
|
+
dataset: {
|
|
1807
|
+
name: permission === null || permission === void 0 ? void 0 : permission.description
|
|
1808
|
+
}
|
|
1809
|
+
}, sidebarItems);
|
|
1810
|
+
return sidebarItem === null || sidebarItem === void 0 ? void 0 : sidebarItem.clientHeight;
|
|
1811
|
+
};
|
|
1812
|
+
|
|
1813
|
+
var Row = function Row(_ref) {
|
|
1814
|
+
var _ref$allPermissionsOf = _ref.allPermissionsOfCategory,
|
|
1815
|
+
allPermissionsOfCategory = _ref$allPermissionsOf === void 0 ? null : _ref$allPermissionsOf,
|
|
1816
|
+
config = _ref.config,
|
|
1817
|
+
_ref$permission = _ref.permission,
|
|
1818
|
+
permission = _ref$permission === void 0 ? null : _ref$permission,
|
|
1819
|
+
roles = _ref.roles,
|
|
1820
|
+
setModifiedRoles = _ref.setModifiedRoles;
|
|
1821
|
+
var isUpdatePermissionGranted = config.permissions.update;
|
|
1822
|
+
var permissions = (allPermissionsOfCategory === null || allPermissionsOfCategory === void 0 ? void 0 : allPermissionsOfCategory.get("permissions")) || [];
|
|
1823
|
+
var allPermissionIdsOfCategory = map(prop("id"), permissions);
|
|
1824
|
+
var handleSubmit = function handleSubmit(role, checked) {
|
|
1825
|
+
var permissionIds = isNotEmpty(allPermissionIdsOfCategory) ? allPermissionIdsOfCategory : [permission === null || permission === void 0 ? void 0 : permission.id];
|
|
1826
|
+
var modifiedRole = modify("permissionIds", function () {
|
|
1827
|
+
return checked ? removeDuplicates([].concat(_toConsumableArray(role.permissionIds), _toConsumableArray(permissionIds))) : role.permissionIds.filter(function (id) {
|
|
1828
|
+
return !permissionIds.includes(id);
|
|
1829
|
+
});
|
|
1830
|
+
}, role);
|
|
1831
|
+
setModifiedRoles(replaceById(role.id, modifiedRole));
|
|
1832
|
+
};
|
|
1833
|
+
var isCheckboxChecked = function isCheckboxChecked(role) {
|
|
1834
|
+
return !allPermissionsOfCategory ? includes(permission === null || permission === void 0 ? void 0 : permission.id, role.permissionIds) : allPermissionIdsOfCategory.every(includes(__, role.permissionIds));
|
|
1835
|
+
};
|
|
1836
|
+
return /*#__PURE__*/jsx("div", {
|
|
1837
|
+
className: classnames("ntm-roles-table__row", {
|
|
1838
|
+
"ntm-roles-table__row--highlighted": !!allPermissionsOfCategory
|
|
1839
|
+
}),
|
|
1840
|
+
children: roles.map(function (role) {
|
|
1841
|
+
return /*#__PURE__*/jsx("div", {
|
|
1842
|
+
className: "ntm-roles-table__cell",
|
|
1843
|
+
style: {
|
|
1844
|
+
height: getRowClientHeight(permission)
|
|
1845
|
+
},
|
|
1846
|
+
children: /*#__PURE__*/jsx(Tooltip, {
|
|
1847
|
+
content: renderRolesTooltipContent(role.name),
|
|
1848
|
+
position: "top",
|
|
1849
|
+
disabled: isUpdatePermissionGranted && !identical(role.name, "Admin"),
|
|
1850
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1851
|
+
className: "ntm-roles-table-cell__checkbox-wrapper",
|
|
1852
|
+
children: /*#__PURE__*/jsx(Checkbox, {
|
|
1853
|
+
disabled: true,
|
|
1854
|
+
checked: isCheckboxChecked(role),
|
|
1855
|
+
className: "ntm-roles-table-cell__checkbox",
|
|
1856
|
+
"data-cy": "ntm-roles-table-permission-checkbox",
|
|
1857
|
+
onChange: function onChange(_ref2) {
|
|
1858
|
+
var checked = _ref2.target.checked;
|
|
1859
|
+
return handleSubmit(role, checked);
|
|
1860
|
+
}
|
|
1861
|
+
})
|
|
1862
|
+
})
|
|
1863
|
+
})
|
|
1864
|
+
}, role.id);
|
|
1865
|
+
})
|
|
1866
|
+
});
|
|
1867
|
+
};
|
|
1868
|
+
|
|
1869
|
+
var TableHeader = function TableHeader(_ref) {
|
|
1870
|
+
var config = _ref.config,
|
|
1871
|
+
roles = _ref.roles,
|
|
1872
|
+
setManageRole = _ref.setManageRole,
|
|
1873
|
+
setIsScrollPresent = _ref.setIsScrollPresent;
|
|
1874
|
+
var isUpdatePermissionGranted = config.permissions.update;
|
|
1875
|
+
var isDeletePermissionGranted = config.permissions["delete"];
|
|
1876
|
+
var scrollSyncElement = useRef(null);
|
|
1877
|
+
var getOverflowStatus = useCallback(function () {
|
|
1878
|
+
if (!scrollSyncElement.current) return;
|
|
1879
|
+
var headerElement = scrollSyncElement.current.node;
|
|
1880
|
+
var isScrollBarPresent = isOverflown(headerElement);
|
|
1881
|
+
setIsScrollPresent(isScrollBarPresent);
|
|
1882
|
+
}, [setIsScrollPresent]);
|
|
1883
|
+
useEffect(function () {
|
|
1884
|
+
addEventListener("resize", getOverflowStatus);
|
|
1885
|
+
return function () {
|
|
1886
|
+
return removeEventListener("resize", getOverflowStatus);
|
|
1887
|
+
};
|
|
1888
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1889
|
+
}, []);
|
|
1890
|
+
useEffect(getOverflowStatus, [getOverflowStatus, scrollSyncElement, roles]);
|
|
1891
|
+
return /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
1892
|
+
group: "horizontal",
|
|
1893
|
+
ref: scrollSyncElement,
|
|
1894
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1895
|
+
className: "ntm-roles-table__header",
|
|
1896
|
+
"data-cy": "ntm-roles-table-header",
|
|
1897
|
+
children: roles === null || roles === void 0 ? void 0 : roles.map(function (role, index) {
|
|
1898
|
+
var isSystemRole = identical("system", role.kind);
|
|
1899
|
+
var isAdminRole = ADMIN_ROLES.includes(role.name) && isSystemRole;
|
|
1900
|
+
return /*#__PURE__*/jsx("div", {
|
|
1901
|
+
className: "ntm-roles-table__cell",
|
|
1902
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
1903
|
+
className: "ntm-roles-table-header-cell__container",
|
|
1904
|
+
"data-cy": "ntm-roles-table-role-header",
|
|
1905
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
1906
|
+
className: "ntm-roles-table-header__role-name",
|
|
1907
|
+
"data-cy": "ntm-roles-table-header-role-title",
|
|
1908
|
+
lineHeight: "normal",
|
|
1909
|
+
style: "h4",
|
|
1910
|
+
weight: "semibold",
|
|
1911
|
+
children: role.name
|
|
1912
|
+
}), !isAdminRole && /*#__PURE__*/jsx(MoreDropdown, {
|
|
1913
|
+
dropdownProps: {
|
|
1914
|
+
autoWidth: true
|
|
1915
|
+
},
|
|
1916
|
+
dropdownButtonProps: {
|
|
1917
|
+
className: "ntm-roles-table-header__dropdown",
|
|
1918
|
+
"data-cy": "ntm-roles-table-header-role-dropdown-button"
|
|
1919
|
+
},
|
|
1920
|
+
menuItems: getMenuItems({
|
|
1921
|
+
isDeletePermissionGranted: isDeletePermissionGranted,
|
|
1922
|
+
isUpdatePermissionGranted: isUpdatePermissionGranted,
|
|
1923
|
+
role: role,
|
|
1924
|
+
setManageRole: setManageRole,
|
|
1925
|
+
isSystemRole: isSystemRole
|
|
1926
|
+
})
|
|
1927
|
+
})]
|
|
1928
|
+
})
|
|
1929
|
+
}, "ntm-roles-".concat(index));
|
|
1930
|
+
})
|
|
1931
|
+
})
|
|
1932
|
+
});
|
|
1933
|
+
};
|
|
1934
|
+
var TableHeader$1 = /*#__PURE__*/memo(TableHeader);
|
|
1935
|
+
|
|
1936
|
+
var Delete = function Delete(_ref) {
|
|
1937
|
+
var isOpen = _ref.isOpen,
|
|
1938
|
+
onClose = _ref.onClose,
|
|
1939
|
+
selectedRole = _ref.selectedRole,
|
|
1940
|
+
roles = _ref.roles;
|
|
1941
|
+
var _useTranslation = useTranslation(),
|
|
1942
|
+
t = _useTranslation.t;
|
|
1943
|
+
var _useDestroyRole = useDestroyRole({
|
|
1944
|
+
onSuccess: onClose
|
|
1945
|
+
}),
|
|
1946
|
+
deleteRole = _useDestroyRole.mutate,
|
|
1947
|
+
isDeleting = _useDestroyRole.isPending;
|
|
1948
|
+
var handleDelete = function handleDelete() {
|
|
1949
|
+
var _roles$find;
|
|
1950
|
+
var id = selectedRole.id;
|
|
1951
|
+
var payload = {
|
|
1952
|
+
newRoleId: (_roles$find = roles.find(function (role) {
|
|
1953
|
+
return role.id !== id;
|
|
1954
|
+
})) === null || _roles$find === void 0 ? void 0 : _roles$find.id
|
|
1955
|
+
};
|
|
1956
|
+
deleteRole({
|
|
1957
|
+
id: id,
|
|
1958
|
+
payload: payload
|
|
1959
|
+
});
|
|
1960
|
+
};
|
|
1961
|
+
return /*#__PURE__*/jsx(Alert, {
|
|
1962
|
+
isOpen: isOpen,
|
|
1963
|
+
onClose: onClose,
|
|
1964
|
+
cancelButtonLabel: t("neetoTeamMembers.buttons.cancel"),
|
|
1965
|
+
isSubmitting: isDeleting,
|
|
1966
|
+
submitButtonLabel: t("neetoTeamMembers.buttons.delete"),
|
|
1967
|
+
title: t("neetoTeamMembers.labels.deleteRole"),
|
|
1968
|
+
message: /*#__PURE__*/jsx(Trans, {
|
|
1969
|
+
i18nKey: "neetoTeamMembers.alerts.messages.deletingRole",
|
|
1970
|
+
values: {
|
|
1971
|
+
name: selectedRole === null || selectedRole === void 0 ? void 0 : selectedRole.name
|
|
1972
|
+
}
|
|
1973
|
+
}),
|
|
1974
|
+
onSubmit: handleDelete
|
|
1975
|
+
});
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
var Columns = function Columns(_ref) {
|
|
1979
|
+
var config = _ref.config,
|
|
1980
|
+
filteredGroupPermissions = _ref.filteredGroupPermissions,
|
|
1981
|
+
filteredRoles = _ref.filteredRoles,
|
|
1982
|
+
permissions = _ref.permissions,
|
|
1983
|
+
roles = _ref.roles,
|
|
1984
|
+
setModifiedRoles = _ref.setModifiedRoles,
|
|
1985
|
+
setIsScrollPresent = _ref.setIsScrollPresent;
|
|
1986
|
+
var _useState = useState(DEFAULT_MANAGE_ROLE_VALUES),
|
|
1987
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1988
|
+
manageRole = _useState2[0],
|
|
1989
|
+
setManageRole = _useState2[1];
|
|
1990
|
+
var categories = Array.from(filteredGroupPermissions === null || filteredGroupPermissions === void 0 ? void 0 : filteredGroupPermissions.keys());
|
|
1991
|
+
var onClose = function onClose() {
|
|
1992
|
+
return setManageRole(DEFAULT_MANAGE_ROLE_VALUES);
|
|
1993
|
+
};
|
|
1994
|
+
return /*#__PURE__*/jsxs("div", {
|
|
1995
|
+
className: "ntm-roles-table__columns",
|
|
1996
|
+
children: [/*#__PURE__*/jsx(TableHeader$1, {
|
|
1997
|
+
config: config,
|
|
1998
|
+
roles: filteredRoles,
|
|
1999
|
+
setIsScrollPresent: setIsScrollPresent,
|
|
2000
|
+
setManageRole: setManageRole
|
|
2001
|
+
}), /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
2002
|
+
group: ["horizontal", "vertical"],
|
|
2003
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2004
|
+
className: "ntm-roles-table__rows",
|
|
2005
|
+
children: categories.map(function (category, index) {
|
|
2006
|
+
var groupedPermissions = filteredGroupPermissions.get(category);
|
|
2007
|
+
var isPermissionVisible = groupedPermissions.get("isPermissionVisible");
|
|
2008
|
+
var permissions = groupedPermissions.get("permissions");
|
|
2009
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2010
|
+
children: [/*#__PURE__*/jsx(Row, {
|
|
2011
|
+
allPermissionsOfCategory: groupedPermissions,
|
|
2012
|
+
config: config,
|
|
2013
|
+
roles: filteredRoles,
|
|
2014
|
+
setModifiedRoles: setModifiedRoles
|
|
2015
|
+
}), isPermissionVisible && permissions.map(function (permission) {
|
|
2016
|
+
return /*#__PURE__*/jsx(Row, {
|
|
2017
|
+
config: config,
|
|
2018
|
+
permission: permission,
|
|
2019
|
+
roles: filteredRoles,
|
|
2020
|
+
setModifiedRoles: setModifiedRoles
|
|
2021
|
+
}, permission.id);
|
|
2022
|
+
})]
|
|
2023
|
+
}, index);
|
|
2024
|
+
})
|
|
2025
|
+
})
|
|
2026
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
2027
|
+
config: config,
|
|
2028
|
+
isOpen: manageRole.isEdit,
|
|
2029
|
+
permissions: permissions,
|
|
2030
|
+
selectedRole: manageRole.selectedRole,
|
|
2031
|
+
onClose: onClose
|
|
2032
|
+
}), /*#__PURE__*/jsx(Delete, {
|
|
2033
|
+
isOpen: manageRole.isDelete,
|
|
2034
|
+
roles: roles,
|
|
2035
|
+
selectedRole: manageRole.selectedRole,
|
|
2036
|
+
onClose: onClose
|
|
2037
|
+
})]
|
|
2038
|
+
});
|
|
2039
|
+
};
|
|
2040
|
+
|
|
2041
|
+
var ToggleDropdown = function ToggleDropdown(_ref) {
|
|
2042
|
+
var isVisible = _ref.isVisible;
|
|
2043
|
+
return isVisible ? /*#__PURE__*/jsx(Up, {
|
|
2044
|
+
className: "ntm-roles-table-sidebar__drop-down-button",
|
|
2045
|
+
"data-cy": "ntm-permission-category-hide-button",
|
|
2046
|
+
size: 16,
|
|
2047
|
+
strokeWidth: 2
|
|
2048
|
+
}) : /*#__PURE__*/jsx(Down, {
|
|
2049
|
+
className: "ntm-roles-table-sidebar__drop-down-button",
|
|
2050
|
+
"data-cy": "ntm-permission-category-show-button",
|
|
2051
|
+
size: 16,
|
|
2052
|
+
strokeWidth: 2
|
|
2053
|
+
});
|
|
2054
|
+
};
|
|
2055
|
+
|
|
2056
|
+
var renderDescription = function renderDescription(permissions, filteredPermissions) {
|
|
2057
|
+
return permissions === null || permissions === void 0 ? void 0 : permissions.map(function (_ref) {
|
|
2058
|
+
var id = _ref.id,
|
|
2059
|
+
description = _ref.description,
|
|
2060
|
+
children = _ref.children;
|
|
2061
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
2062
|
+
children: [filteredPermissions.includes(id) && /*#__PURE__*/jsx("div", {
|
|
2063
|
+
className: "ntm-roles-table-sidebar__list-item",
|
|
2064
|
+
"data-name": description,
|
|
2065
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
2066
|
+
"data-cy": "ntm-permission-category-description",
|
|
2067
|
+
lineHeight: "normal",
|
|
2068
|
+
style: "body2",
|
|
2069
|
+
children: description
|
|
2070
|
+
})
|
|
2071
|
+
}, id), /*#__PURE__*/jsx("div", {
|
|
2072
|
+
className: "neeto-ui-relative neeto-ui-pl-6 ntm-roles-table-sidebar__sub-blocks",
|
|
2073
|
+
children: renderDescription(children, filteredPermissions)
|
|
2074
|
+
})]
|
|
2075
|
+
}, id);
|
|
2076
|
+
});
|
|
2077
|
+
};
|
|
2078
|
+
var getSearchWrapperStyle = function getSearchWrapperStyle() {
|
|
2079
|
+
var scrollBarWidth = getScrollBarWidth();
|
|
2080
|
+
document.documentElement.style.setProperty("--ntm-roles-table-default-scroll", "".concat(scrollBarWidth, "px"));
|
|
2081
|
+
return {
|
|
2082
|
+
marginBottom: "".concat(scrollBarWidth, "px")
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
var Sidebar = function Sidebar(_ref) {
|
|
2087
|
+
var searchTerm = _ref.searchTerm,
|
|
2088
|
+
setSearchTerm = _ref.setSearchTerm,
|
|
2089
|
+
filteredGroupPermissions = _ref.filteredGroupPermissions,
|
|
2090
|
+
toggleDropdown = _ref.toggleDropdown,
|
|
2091
|
+
isScrollPresent = _ref.isScrollPresent,
|
|
2092
|
+
_ref$permissions = _ref.permissions,
|
|
2093
|
+
permissions = _ref$permissions === void 0 ? [] : _ref$permissions,
|
|
2094
|
+
_ref$permissionRelati = _ref.permissionRelationConfig,
|
|
2095
|
+
permissionRelationConfig = _ref$permissionRelati === void 0 ? {} : _ref$permissionRelati;
|
|
2096
|
+
var _useTranslation = useTranslation(),
|
|
2097
|
+
t = _useTranslation.t;
|
|
2098
|
+
var categories = Array.from(filteredGroupPermissions.keys());
|
|
2099
|
+
var searchWrapperStyle = isScrollPresent ? getSearchWrapperStyle() : {};
|
|
2100
|
+
var permissionsNameMap = groupBy(prop("name"))(permissions);
|
|
2101
|
+
var groupedPermissionsWithChildren = useMemo(function () {
|
|
2102
|
+
var childrenRemovedFromRoot = getChildrenRemovedFromRoot({
|
|
2103
|
+
permissions: permissions,
|
|
2104
|
+
permissionsNameMap: permissionsNameMap,
|
|
2105
|
+
permissionRelationConfig: permissionRelationConfig
|
|
2106
|
+
});
|
|
2107
|
+
return groupBy(prop("category"))(childrenRemovedFromRoot);
|
|
2108
|
+
}, [permissions]);
|
|
2109
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2110
|
+
className: "ntm-roles-table__sidebar",
|
|
2111
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
2112
|
+
className: "ntm-roles-table-sidebar__search",
|
|
2113
|
+
style: searchWrapperStyle,
|
|
2114
|
+
children: /*#__PURE__*/jsx(Input$1, {
|
|
2115
|
+
"data-cy": "ntm-search-permissions-input",
|
|
2116
|
+
prefix: /*#__PURE__*/jsx(Search, {}),
|
|
2117
|
+
type: "search",
|
|
2118
|
+
value: searchTerm,
|
|
2119
|
+
placeholder: t("neetoTeamMembers.placeholders.searchPermission", PLURAL),
|
|
2120
|
+
onChange: function onChange(_ref2) {
|
|
2121
|
+
var value = _ref2.target.value;
|
|
2122
|
+
return setSearchTerm(value);
|
|
2123
|
+
}
|
|
2124
|
+
})
|
|
2125
|
+
}), /*#__PURE__*/jsx(distExports.ScrollSyncPane, {
|
|
2126
|
+
group: "vertical",
|
|
2127
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2128
|
+
className: "ntm-roles-table-sidebar__list",
|
|
2129
|
+
children: categories.map(function (category, index) {
|
|
2130
|
+
var groupedPermissions = filteredGroupPermissions.get(category);
|
|
2131
|
+
var isPermissionVisible = groupedPermissions.get("isPermissionVisible");
|
|
2132
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2133
|
+
className: "ntm-roles-table-sidebar__list-item-cell",
|
|
2134
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
2135
|
+
className: "ntm-roles-table-sidebar__list-item ntm-roles-table-sidebar__list-item--highlighted cursor-pointer",
|
|
2136
|
+
onClick: function onClick() {
|
|
2137
|
+
return toggleDropdown(category);
|
|
2138
|
+
},
|
|
2139
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
2140
|
+
"data-cy": "ntm-permission-category-title",
|
|
2141
|
+
lineHeight: "normal",
|
|
2142
|
+
style: "h4",
|
|
2143
|
+
weight: "semibold",
|
|
2144
|
+
children: category
|
|
2145
|
+
}), /*#__PURE__*/jsx(ToggleDropdown, {
|
|
2146
|
+
isVisible: isPermissionVisible
|
|
2147
|
+
})]
|
|
2148
|
+
}), isPermissionVisible && /*#__PURE__*/jsx("div", {
|
|
2149
|
+
className: "ntm-roles-table-sidebar__list-item-spacing-handler ml-[12px] px-[24px]",
|
|
2150
|
+
children: renderDescription(groupedPermissionsWithChildren[category], pluck("id", filteredGroupPermissions.get(category).get("permissions") || []))
|
|
2151
|
+
})]
|
|
2152
|
+
}, index);
|
|
2153
|
+
})
|
|
2154
|
+
})
|
|
2155
|
+
})]
|
|
2156
|
+
});
|
|
2157
|
+
};
|
|
2158
|
+
|
|
2159
|
+
var Table = function Table(_ref) {
|
|
2160
|
+
var _config$permissionRel;
|
|
2161
|
+
var config = _ref.config,
|
|
2162
|
+
filteredRoles = _ref.filteredRoles,
|
|
2163
|
+
roles = _ref.roles,
|
|
2164
|
+
permissionGroups = _ref.permissionGroups,
|
|
2165
|
+
permissions = _ref.permissions,
|
|
2166
|
+
setModifiedRoles = _ref.setModifiedRoles,
|
|
2167
|
+
setIsNewRolePaneOpen = _ref.setIsNewRolePaneOpen;
|
|
2168
|
+
var _useTranslation = useTranslation(),
|
|
2169
|
+
t = _useTranslation.t;
|
|
2170
|
+
var isCreatePermissionGranted = config.permissions.create;
|
|
2171
|
+
var _useState = useState(""),
|
|
2172
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2173
|
+
searchTerm = _useState2[0],
|
|
2174
|
+
setSearchTerm = _useState2[1];
|
|
2175
|
+
var _useState3 = useState(permissionGroups),
|
|
2176
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2177
|
+
filteredGroupPermissions = _useState4[0],
|
|
2178
|
+
setFilteredGroupPermissions = _useState4[1];
|
|
2179
|
+
var _useState5 = useState(false),
|
|
2180
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2181
|
+
isScrollPresent = _useState6[0],
|
|
2182
|
+
setIsScrollPresent = _useState6[1];
|
|
2183
|
+
var _useState7 = useState(undefined),
|
|
2184
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
2185
|
+
selectedRole = _useState8[0],
|
|
2186
|
+
setSelectedRole = _useState8[1];
|
|
2187
|
+
var _useState9 = useState(false),
|
|
2188
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
2189
|
+
isDeleteAlertOpen = _useState10[0],
|
|
2190
|
+
setIsDeleteAlertOpen = _useState10[1];
|
|
2191
|
+
var _useState11 = useState(false),
|
|
2192
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
2193
|
+
isEditPaneOpen = _useState12[0],
|
|
2194
|
+
setIsEditPaneOpen = _useState12[1];
|
|
2195
|
+
var toggleDropdown = function toggleDropdown(category) {
|
|
2196
|
+
var permissions = updatePermissionVisibility(category, filteredGroupPermissions);
|
|
2197
|
+
setFilteredGroupPermissions(permissions);
|
|
2198
|
+
};
|
|
2199
|
+
useEffect(function () {
|
|
2200
|
+
var newValue = filterPermissionsBySearch(searchTerm, permissionGroups);
|
|
2201
|
+
setFilteredGroupPermissions(newValue);
|
|
2202
|
+
}, [permissionGroups, searchTerm]);
|
|
2203
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2204
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
2205
|
+
className: "ntm-roles-table__wrapper",
|
|
2206
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2207
|
+
className: "ntm-roles-table__container",
|
|
2208
|
+
children: isEmpty(filteredRoles) ? /*#__PURE__*/jsx("div", {
|
|
2209
|
+
className: "ntm-empty-state",
|
|
2210
|
+
children: /*#__PURE__*/jsx(NoData, {
|
|
2211
|
+
title: t("neetoTeamMembers.labels.roleNotFound", PLURAL),
|
|
2212
|
+
primaryButtonProps: {
|
|
2213
|
+
"data-cy": "ntm-add-role-button",
|
|
2214
|
+
disabled: !isCreatePermissionGranted,
|
|
2215
|
+
label: t("neetoTeamMembers.labels.addNewRole"),
|
|
2216
|
+
onClick: function onClick() {
|
|
2217
|
+
return setIsNewRolePaneOpen(true);
|
|
2218
|
+
}
|
|
2219
|
+
}
|
|
2220
|
+
})
|
|
2221
|
+
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
2222
|
+
children: [/*#__PURE__*/jsx(Sidebar, {
|
|
2223
|
+
filteredGroupPermissions: filteredGroupPermissions,
|
|
2224
|
+
isScrollPresent: isScrollPresent,
|
|
2225
|
+
permissions: permissions,
|
|
2226
|
+
searchTerm: searchTerm,
|
|
2227
|
+
setSearchTerm: setSearchTerm,
|
|
2228
|
+
toggleDropdown: toggleDropdown,
|
|
2229
|
+
permissionRelationConfig: (_config$permissionRel = config === null || config === void 0 ? void 0 : config.permissionRelation) !== null && _config$permissionRel !== void 0 ? _config$permissionRel : {}
|
|
2230
|
+
}), /*#__PURE__*/jsx(Columns, {
|
|
2231
|
+
config: config,
|
|
2232
|
+
filteredGroupPermissions: filteredGroupPermissions,
|
|
2233
|
+
filteredRoles: filteredRoles,
|
|
2234
|
+
permissions: permissions,
|
|
2235
|
+
roles: roles,
|
|
2236
|
+
setIsScrollPresent: setIsScrollPresent,
|
|
2237
|
+
setModifiedRoles: setModifiedRoles
|
|
2238
|
+
})]
|
|
2239
|
+
})
|
|
2240
|
+
})
|
|
2241
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
2242
|
+
config: config,
|
|
2243
|
+
permissions: permissions,
|
|
2244
|
+
selectedRole: selectedRole,
|
|
2245
|
+
isOpen: isEditPaneOpen,
|
|
2246
|
+
onClose: function onClose() {
|
|
2247
|
+
setSelectedRole(undefined);
|
|
2248
|
+
setIsEditPaneOpen(false);
|
|
2249
|
+
}
|
|
2250
|
+
}), /*#__PURE__*/jsx(Delete, {
|
|
2251
|
+
roles: roles,
|
|
2252
|
+
selectedRole: selectedRole,
|
|
2253
|
+
isOpen: isDeleteAlertOpen,
|
|
2254
|
+
onClose: function onClose() {
|
|
2255
|
+
setSelectedRole(undefined);
|
|
2256
|
+
setIsDeleteAlertOpen(false);
|
|
2257
|
+
}
|
|
2258
|
+
})]
|
|
2259
|
+
});
|
|
2260
|
+
};
|
|
2261
|
+
|
|
2262
|
+
var Roles = function Roles(_ref) {
|
|
2263
|
+
var config = _ref.config;
|
|
2264
|
+
var isViewPermissionGranted = config.permissions.view;
|
|
2265
|
+
var isUpdatePermissionGranted = config.permissions.update;
|
|
2266
|
+
var _useState = useState([]),
|
|
2267
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
2268
|
+
modifiedRoles = _useState2[0],
|
|
2269
|
+
setModifiedRoles = _useState2[1];
|
|
2270
|
+
var _useState3 = useState(false),
|
|
2271
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
2272
|
+
isNewRolePaneOpen = _useState4[0],
|
|
2273
|
+
setIsNewRolePaneOpen = _useState4[1];
|
|
2274
|
+
var _useFetchRoles = useFetchRoles({
|
|
2275
|
+
enabled: isViewPermissionGranted
|
|
2276
|
+
}),
|
|
2277
|
+
_useFetchRoles$data = _useFetchRoles.data,
|
|
2278
|
+
roles = _useFetchRoles$data === void 0 ? [] : _useFetchRoles$data,
|
|
2279
|
+
isRolesLoading = _useFetchRoles.isLoading,
|
|
2280
|
+
status = _useFetchRoles.status;
|
|
2281
|
+
var _useQueryParams = useQueryParams(),
|
|
2282
|
+
_useQueryParams$searc = _useQueryParams.searchTerm,
|
|
2283
|
+
searchTerm = _useQueryParams$searc === void 0 ? "" : _useQueryParams$searc;
|
|
2284
|
+
var _useFetchPermissions = useFetchPermissions({
|
|
2285
|
+
enabled: isViewPermissionGranted
|
|
2286
|
+
}),
|
|
2287
|
+
permissionData = _useFetchPermissions.data,
|
|
2288
|
+
isPermissionsLoading = _useFetchPermissions.isLoading;
|
|
2289
|
+
var _useBulkUpdateRoles = useBulkUpdateRoles({
|
|
2290
|
+
enabled: isUpdatePermissionGranted
|
|
2291
|
+
}),
|
|
2292
|
+
bulkUpdate = _useBulkUpdateRoles.mutate;
|
|
2293
|
+
var permissions = sortPermissionsBySequence(permissionData);
|
|
2294
|
+
var permissionGroups = getPermissionGroups(permissions);
|
|
2295
|
+
var filteredRoles = filter(function (_ref2) {
|
|
2296
|
+
var name = _ref2.name;
|
|
2297
|
+
return includes(searchTerm.toLowerCase().trim(), name.toLowerCase().trim());
|
|
2298
|
+
}, isNotEmpty(modifiedRoles) ? modifiedRoles : roles);
|
|
2299
|
+
var handleSubmit = function handleSubmit() {
|
|
2300
|
+
var updatedRoles = getModifiedPermissions(roles, modifiedRoles);
|
|
2301
|
+
bulkUpdate({
|
|
2302
|
+
organizationRoles: {
|
|
2303
|
+
updatedRoles: updatedRoles
|
|
2304
|
+
}
|
|
2305
|
+
});
|
|
2306
|
+
};
|
|
2307
|
+
var handleReset = function handleReset() {
|
|
2308
|
+
return setModifiedRoles(roles);
|
|
2309
|
+
};
|
|
2310
|
+
useEffect(function () {
|
|
2311
|
+
if (status !== "success") return;
|
|
2312
|
+
setModifiedRoles(roles);
|
|
2313
|
+
}, [roles, status]);
|
|
2314
|
+
if (isRolesLoading || isPermissionsLoading) {
|
|
2315
|
+
return /*#__PURE__*/jsx("div", {
|
|
2316
|
+
className: "ntm-members-page-loader",
|
|
2317
|
+
children: /*#__PURE__*/jsx(PageLoader, {})
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
2321
|
+
children: [/*#__PURE__*/jsx(distExports.ScrollSync, {
|
|
2322
|
+
children: /*#__PURE__*/jsxs(Container, {
|
|
2323
|
+
isHeaderFixed: true,
|
|
2324
|
+
children: [/*#__PURE__*/jsx(Header, {
|
|
2325
|
+
config: config,
|
|
2326
|
+
handleReset: handleReset,
|
|
2327
|
+
handleSubmit: handleSubmit,
|
|
2328
|
+
roles: roles,
|
|
2329
|
+
setIsNewRolePaneOpen: setIsNewRolePaneOpen
|
|
2330
|
+
}), /*#__PURE__*/jsx(Table, {
|
|
2331
|
+
config: config,
|
|
2332
|
+
filteredRoles: filteredRoles,
|
|
2333
|
+
permissionGroups: permissionGroups,
|
|
2334
|
+
permissions: permissions,
|
|
2335
|
+
roles: roles,
|
|
2336
|
+
setIsNewRolePaneOpen: setIsNewRolePaneOpen,
|
|
2337
|
+
setModifiedRoles: setModifiedRoles
|
|
2338
|
+
})]
|
|
2339
|
+
})
|
|
2340
|
+
}), /*#__PURE__*/jsx(ManageRoles, {
|
|
2341
|
+
config: config,
|
|
2342
|
+
permissions: permissions,
|
|
2343
|
+
isOpen: isNewRolePaneOpen,
|
|
2344
|
+
onClose: function onClose() {
|
|
2345
|
+
return setIsNewRolePaneOpen(false);
|
|
2346
|
+
}
|
|
2347
|
+
})]
|
|
2348
|
+
});
|
|
2349
|
+
};
|
|
2350
|
+
var index = withTitle(withReactQuery(Roles), i18next.t("neetoTeamMembers.common.role", PLURAL));
|
|
2351
|
+
|
|
2352
|
+
export { index as default };
|
|
2353
|
+
//# sourceMappingURL=Roles.js.map
|