@bigbinary/neeto-team-members-frontend 2.4.4 → 2.4.6
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 +2 -2
- package/dist/index.cjs.js +1177 -225
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1176 -227
- package/dist/index.esm.js.map +1 -1
- package/package.json +26 -25
- package/types.d.ts +30 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
1
|
+
import React, { createContext, useContext, createElement, isValidElement, cloneElement, useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
+
import { complement, isEmpty, modifyPath, prepend, assocPath, findIndex, propEq, dissocPath, groupBy, is, prop, keys, map, identical, modify, includes, fromPairs, toPairs, filter, isNil, curry, __, trim, toLower, identity, without, append, clamp, mergeLeft, pluck, head, reverse, assoc } from 'ramda';
|
|
2
3
|
import ReactDOM from 'react-dom';
|
|
3
4
|
import axios from 'axios';
|
|
4
5
|
import { Toastr, Tooltip, Button, Typography, Checkbox, Pane, Dropdown, Alert, Input as Input$1, PageLoader, Label, Avatar, Tag, Table as Table$1 } from '@bigbinary/neetoui';
|
|
5
|
-
import { modifyPath, prepend, assocPath, findIndex, propEq, dissocPath, groupBy, is, prop, keys, map, identical, modify, includes, fromPairs, toPairs, filter, isEmpty, isNil, curry, complement, __, trim, toLower, identity, without, append, clamp, mergeLeft, pluck, head, reverse, assoc } from 'ramda';
|
|
6
6
|
import { Header as Header$2, Container, MenuBar, SubHeader as SubHeader$1 } from '@bigbinary/neetoui/layouts';
|
|
7
7
|
import { useFormikContext, Formik, Form } from 'formik';
|
|
8
8
|
import { Input, Textarea, EmailInput, Radio } from '@bigbinary/neetoui/formik';
|
|
@@ -140,9 +140,9 @@ function _toArray(arr) {
|
|
|
140
140
|
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
function ownKeys$
|
|
143
|
+
function ownKeys$b(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
144
144
|
|
|
145
|
-
function _objectSpread$
|
|
145
|
+
function _objectSpread$b(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$b(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$b(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
146
146
|
|
|
147
147
|
var consoleLogger = {
|
|
148
148
|
type: 'logger',
|
|
@@ -229,7 +229,7 @@ var Logger = function () {
|
|
|
229
229
|
}, {
|
|
230
230
|
key: "create",
|
|
231
231
|
value: function create(moduleName) {
|
|
232
|
-
return new Logger(this.logger, _objectSpread$
|
|
232
|
+
return new Logger(this.logger, _objectSpread$b(_objectSpread$b({}, {
|
|
233
233
|
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
|
|
234
234
|
}), this.options));
|
|
235
235
|
}
|
|
@@ -1145,7 +1145,7 @@ var Translator = function (_EventEmitter) {
|
|
|
1145
1145
|
return Translator;
|
|
1146
1146
|
}(EventEmitter);
|
|
1147
1147
|
|
|
1148
|
-
function capitalize(string) {
|
|
1148
|
+
function capitalize$1(string) {
|
|
1149
1149
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
1150
1150
|
}
|
|
1151
1151
|
|
|
@@ -1189,13 +1189,13 @@ var LanguageUtil = function () {
|
|
|
1189
1189
|
} else if (p.length === 2) {
|
|
1190
1190
|
p[0] = p[0].toLowerCase();
|
|
1191
1191
|
p[1] = p[1].toUpperCase();
|
|
1192
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
1192
|
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize$1(p[1].toLowerCase());
|
|
1193
1193
|
} else if (p.length === 3) {
|
|
1194
1194
|
p[0] = p[0].toLowerCase();
|
|
1195
1195
|
if (p[1].length === 2) p[1] = p[1].toUpperCase();
|
|
1196
1196
|
if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
|
|
1197
|
-
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
|
1198
|
-
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
|
1197
|
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize$1(p[1].toLowerCase());
|
|
1198
|
+
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize$1(p[2].toLowerCase());
|
|
1199
1199
|
}
|
|
1200
1200
|
|
|
1201
1201
|
return p.join('-');
|
|
@@ -3001,103 +3001,80 @@ function defaults(obj) {
|
|
|
3001
3001
|
|
|
3002
3002
|
// eslint-disable-next-line no-control-regex
|
|
3003
3003
|
var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;
|
|
3004
|
-
|
|
3005
3004
|
var serializeCookie = function serializeCookie(name, val, options) {
|
|
3006
3005
|
var opt = options || {};
|
|
3007
3006
|
opt.path = opt.path || '/';
|
|
3008
3007
|
var value = encodeURIComponent(val);
|
|
3009
3008
|
var str = "".concat(name, "=").concat(value);
|
|
3010
|
-
|
|
3011
3009
|
if (opt.maxAge > 0) {
|
|
3012
3010
|
var maxAge = opt.maxAge - 0;
|
|
3013
3011
|
if (Number.isNaN(maxAge)) throw new Error('maxAge should be a Number');
|
|
3014
3012
|
str += "; Max-Age=".concat(Math.floor(maxAge));
|
|
3015
3013
|
}
|
|
3016
|
-
|
|
3017
3014
|
if (opt.domain) {
|
|
3018
3015
|
if (!fieldContentRegExp.test(opt.domain)) {
|
|
3019
3016
|
throw new TypeError('option domain is invalid');
|
|
3020
3017
|
}
|
|
3021
|
-
|
|
3022
3018
|
str += "; Domain=".concat(opt.domain);
|
|
3023
3019
|
}
|
|
3024
|
-
|
|
3025
3020
|
if (opt.path) {
|
|
3026
3021
|
if (!fieldContentRegExp.test(opt.path)) {
|
|
3027
3022
|
throw new TypeError('option path is invalid');
|
|
3028
3023
|
}
|
|
3029
|
-
|
|
3030
3024
|
str += "; Path=".concat(opt.path);
|
|
3031
3025
|
}
|
|
3032
|
-
|
|
3033
3026
|
if (opt.expires) {
|
|
3034
3027
|
if (typeof opt.expires.toUTCString !== 'function') {
|
|
3035
3028
|
throw new TypeError('option expires is invalid');
|
|
3036
3029
|
}
|
|
3037
|
-
|
|
3038
3030
|
str += "; Expires=".concat(opt.expires.toUTCString());
|
|
3039
3031
|
}
|
|
3040
|
-
|
|
3041
3032
|
if (opt.httpOnly) str += '; HttpOnly';
|
|
3042
3033
|
if (opt.secure) str += '; Secure';
|
|
3043
|
-
|
|
3044
3034
|
if (opt.sameSite) {
|
|
3045
3035
|
var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;
|
|
3046
|
-
|
|
3047
3036
|
switch (sameSite) {
|
|
3048
3037
|
case true:
|
|
3049
3038
|
str += '; SameSite=Strict';
|
|
3050
3039
|
break;
|
|
3051
|
-
|
|
3052
3040
|
case 'lax':
|
|
3053
3041
|
str += '; SameSite=Lax';
|
|
3054
3042
|
break;
|
|
3055
|
-
|
|
3056
3043
|
case 'strict':
|
|
3057
3044
|
str += '; SameSite=Strict';
|
|
3058
3045
|
break;
|
|
3059
|
-
|
|
3060
3046
|
case 'none':
|
|
3061
3047
|
str += '; SameSite=None';
|
|
3062
3048
|
break;
|
|
3063
|
-
|
|
3064
3049
|
default:
|
|
3065
3050
|
throw new TypeError('option sameSite is invalid');
|
|
3066
3051
|
}
|
|
3067
3052
|
}
|
|
3068
|
-
|
|
3069
3053
|
return str;
|
|
3070
3054
|
};
|
|
3071
|
-
|
|
3072
3055
|
var cookie = {
|
|
3073
3056
|
create: function create(name, value, minutes, domain) {
|
|
3074
3057
|
var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
|
3075
3058
|
path: '/',
|
|
3076
3059
|
sameSite: 'strict'
|
|
3077
3060
|
};
|
|
3078
|
-
|
|
3079
3061
|
if (minutes) {
|
|
3080
3062
|
cookieOptions.expires = new Date();
|
|
3081
3063
|
cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);
|
|
3082
3064
|
}
|
|
3083
|
-
|
|
3084
3065
|
if (domain) cookieOptions.domain = domain;
|
|
3085
3066
|
document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);
|
|
3086
3067
|
},
|
|
3087
3068
|
read: function read(name) {
|
|
3088
3069
|
var nameEQ = "".concat(name, "=");
|
|
3089
3070
|
var ca = document.cookie.split(';');
|
|
3090
|
-
|
|
3091
3071
|
for (var i = 0; i < ca.length; i++) {
|
|
3092
3072
|
var c = ca[i];
|
|
3093
|
-
|
|
3094
3073
|
while (c.charAt(0) === ' ') {
|
|
3095
3074
|
c = c.substring(1, c.length);
|
|
3096
3075
|
}
|
|
3097
|
-
|
|
3098
3076
|
if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
|
|
3099
3077
|
}
|
|
3100
|
-
|
|
3101
3078
|
return null;
|
|
3102
3079
|
},
|
|
3103
3080
|
remove: function remove(name) {
|
|
@@ -3108,12 +3085,10 @@ var cookie$1 = {
|
|
|
3108
3085
|
name: 'cookie',
|
|
3109
3086
|
lookup: function lookup(options) {
|
|
3110
3087
|
var found;
|
|
3111
|
-
|
|
3112
3088
|
if (options.lookupCookie && typeof document !== 'undefined') {
|
|
3113
3089
|
var c = cookie.read(options.lookupCookie);
|
|
3114
3090
|
if (c) found = c;
|
|
3115
3091
|
}
|
|
3116
|
-
|
|
3117
3092
|
return found;
|
|
3118
3093
|
},
|
|
3119
3094
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -3127,39 +3102,30 @@ var querystring = {
|
|
|
3127
3102
|
name: 'querystring',
|
|
3128
3103
|
lookup: function lookup(options) {
|
|
3129
3104
|
var found;
|
|
3130
|
-
|
|
3131
3105
|
if (typeof window !== 'undefined') {
|
|
3132
3106
|
var search = window.location.search;
|
|
3133
|
-
|
|
3134
3107
|
if (!window.location.search && window.location.hash && window.location.hash.indexOf('?') > -1) {
|
|
3135
3108
|
search = window.location.hash.substring(window.location.hash.indexOf('?'));
|
|
3136
3109
|
}
|
|
3137
|
-
|
|
3138
3110
|
var query = search.substring(1);
|
|
3139
3111
|
var params = query.split('&');
|
|
3140
|
-
|
|
3141
3112
|
for (var i = 0; i < params.length; i++) {
|
|
3142
3113
|
var pos = params[i].indexOf('=');
|
|
3143
|
-
|
|
3144
3114
|
if (pos > 0) {
|
|
3145
3115
|
var key = params[i].substring(0, pos);
|
|
3146
|
-
|
|
3147
3116
|
if (key === options.lookupQuerystring) {
|
|
3148
3117
|
found = params[i].substring(pos + 1);
|
|
3149
3118
|
}
|
|
3150
3119
|
}
|
|
3151
3120
|
}
|
|
3152
3121
|
}
|
|
3153
|
-
|
|
3154
3122
|
return found;
|
|
3155
3123
|
}
|
|
3156
3124
|
};
|
|
3157
3125
|
|
|
3158
3126
|
var hasLocalStorageSupport = null;
|
|
3159
|
-
|
|
3160
3127
|
var localStorageAvailable = function localStorageAvailable() {
|
|
3161
3128
|
if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;
|
|
3162
|
-
|
|
3163
3129
|
try {
|
|
3164
3130
|
hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;
|
|
3165
3131
|
var testKey = 'i18next.translate.boo';
|
|
@@ -3168,20 +3134,16 @@ var localStorageAvailable = function localStorageAvailable() {
|
|
|
3168
3134
|
} catch (e) {
|
|
3169
3135
|
hasLocalStorageSupport = false;
|
|
3170
3136
|
}
|
|
3171
|
-
|
|
3172
3137
|
return hasLocalStorageSupport;
|
|
3173
3138
|
};
|
|
3174
|
-
|
|
3175
3139
|
var localStorage$1 = {
|
|
3176
3140
|
name: 'localStorage',
|
|
3177
3141
|
lookup: function lookup(options) {
|
|
3178
3142
|
var found;
|
|
3179
|
-
|
|
3180
3143
|
if (options.lookupLocalStorage && localStorageAvailable()) {
|
|
3181
3144
|
var lng = window.localStorage.getItem(options.lookupLocalStorage);
|
|
3182
3145
|
if (lng) found = lng;
|
|
3183
3146
|
}
|
|
3184
|
-
|
|
3185
3147
|
return found;
|
|
3186
3148
|
},
|
|
3187
3149
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -3192,10 +3154,8 @@ var localStorage$1 = {
|
|
|
3192
3154
|
};
|
|
3193
3155
|
|
|
3194
3156
|
var hasSessionStorageSupport = null;
|
|
3195
|
-
|
|
3196
3157
|
var sessionStorageAvailable = function sessionStorageAvailable() {
|
|
3197
3158
|
if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;
|
|
3198
|
-
|
|
3199
3159
|
try {
|
|
3200
3160
|
hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;
|
|
3201
3161
|
var testKey = 'i18next.translate.boo';
|
|
@@ -3204,20 +3164,16 @@ var sessionStorageAvailable = function sessionStorageAvailable() {
|
|
|
3204
3164
|
} catch (e) {
|
|
3205
3165
|
hasSessionStorageSupport = false;
|
|
3206
3166
|
}
|
|
3207
|
-
|
|
3208
3167
|
return hasSessionStorageSupport;
|
|
3209
3168
|
};
|
|
3210
|
-
|
|
3211
3169
|
var sessionStorage = {
|
|
3212
3170
|
name: 'sessionStorage',
|
|
3213
3171
|
lookup: function lookup(options) {
|
|
3214
3172
|
var found;
|
|
3215
|
-
|
|
3216
3173
|
if (options.lookupSessionStorage && sessionStorageAvailable()) {
|
|
3217
3174
|
var lng = window.sessionStorage.getItem(options.lookupSessionStorage);
|
|
3218
3175
|
if (lng) found = lng;
|
|
3219
3176
|
}
|
|
3220
|
-
|
|
3221
3177
|
return found;
|
|
3222
3178
|
},
|
|
3223
3179
|
cacheUserLanguage: function cacheUserLanguage(lng, options) {
|
|
@@ -3231,7 +3187,6 @@ var navigator$1 = {
|
|
|
3231
3187
|
name: 'navigator',
|
|
3232
3188
|
lookup: function lookup(options) {
|
|
3233
3189
|
var found = [];
|
|
3234
|
-
|
|
3235
3190
|
if (typeof navigator !== 'undefined') {
|
|
3236
3191
|
if (navigator.languages) {
|
|
3237
3192
|
// chrome only; not an array, so can't use .push.apply instead of iterating
|
|
@@ -3239,16 +3194,13 @@ var navigator$1 = {
|
|
|
3239
3194
|
found.push(navigator.languages[i]);
|
|
3240
3195
|
}
|
|
3241
3196
|
}
|
|
3242
|
-
|
|
3243
3197
|
if (navigator.userLanguage) {
|
|
3244
3198
|
found.push(navigator.userLanguage);
|
|
3245
3199
|
}
|
|
3246
|
-
|
|
3247
3200
|
if (navigator.language) {
|
|
3248
3201
|
found.push(navigator.language);
|
|
3249
3202
|
}
|
|
3250
3203
|
}
|
|
3251
|
-
|
|
3252
3204
|
return found.length > 0 ? found : undefined;
|
|
3253
3205
|
}
|
|
3254
3206
|
};
|
|
@@ -3258,11 +3210,9 @@ var htmlTag = {
|
|
|
3258
3210
|
lookup: function lookup(options) {
|
|
3259
3211
|
var found;
|
|
3260
3212
|
var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);
|
|
3261
|
-
|
|
3262
3213
|
if (htmlTag && typeof htmlTag.getAttribute === 'function') {
|
|
3263
3214
|
found = htmlTag.getAttribute('lang');
|
|
3264
3215
|
}
|
|
3265
|
-
|
|
3266
3216
|
return found;
|
|
3267
3217
|
}
|
|
3268
3218
|
};
|
|
@@ -3271,23 +3221,19 @@ var path = {
|
|
|
3271
3221
|
name: 'path',
|
|
3272
3222
|
lookup: function lookup(options) {
|
|
3273
3223
|
var found;
|
|
3274
|
-
|
|
3275
3224
|
if (typeof window !== 'undefined') {
|
|
3276
3225
|
var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g);
|
|
3277
|
-
|
|
3278
3226
|
if (language instanceof Array) {
|
|
3279
3227
|
if (typeof options.lookupFromPathIndex === 'number') {
|
|
3280
3228
|
if (typeof language[options.lookupFromPathIndex] !== 'string') {
|
|
3281
3229
|
return undefined;
|
|
3282
3230
|
}
|
|
3283
|
-
|
|
3284
3231
|
found = language[options.lookupFromPathIndex].replace('/', '');
|
|
3285
3232
|
} else {
|
|
3286
3233
|
found = language[0].replace('/', '');
|
|
3287
3234
|
}
|
|
3288
3235
|
}
|
|
3289
3236
|
}
|
|
3290
|
-
|
|
3291
3237
|
return found;
|
|
3292
3238
|
}
|
|
3293
3239
|
};
|
|
@@ -3296,14 +3242,15 @@ var subdomain = {
|
|
|
3296
3242
|
name: 'subdomain',
|
|
3297
3243
|
lookup: function lookup(options) {
|
|
3298
3244
|
// If given get the subdomain index else 1
|
|
3299
|
-
var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
|
|
3245
|
+
var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === 'number' ? options.lookupFromSubdomainIndex + 1 : 1;
|
|
3246
|
+
// get all matches if window.location. is existing
|
|
3300
3247
|
// first item of match is the match itself and the second is the first group macht which sould be the first subdomain match
|
|
3301
3248
|
// is the hostname no public domain get the or option of localhost
|
|
3249
|
+
var language = typeof window !== 'undefined' && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);
|
|
3302
3250
|
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3251
|
+
// if there is no match (null) return undefined
|
|
3252
|
+
if (!language) return undefined;
|
|
3253
|
+
// return the given group match
|
|
3307
3254
|
return language[lookupFromSubdomainIndex];
|
|
3308
3255
|
}
|
|
3309
3256
|
};
|
|
@@ -3317,31 +3264,28 @@ function getDefaults$1() {
|
|
|
3317
3264
|
lookupSessionStorage: 'i18nextLng',
|
|
3318
3265
|
// cache user language
|
|
3319
3266
|
caches: ['localStorage'],
|
|
3320
|
-
excludeCacheFor: ['cimode']
|
|
3267
|
+
excludeCacheFor: ['cimode']
|
|
3268
|
+
// cookieMinutes: 10,
|
|
3321
3269
|
// cookieDomain: 'myDomain'
|
|
3322
|
-
|
|
3323
3270
|
};
|
|
3324
3271
|
}
|
|
3325
|
-
|
|
3326
3272
|
var Browser = /*#__PURE__*/function () {
|
|
3327
3273
|
function Browser(services) {
|
|
3328
3274
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3329
|
-
|
|
3330
3275
|
_classCallCheck(this, Browser);
|
|
3331
|
-
|
|
3332
3276
|
this.type = 'languageDetector';
|
|
3333
3277
|
this.detectors = {};
|
|
3334
3278
|
this.init(services, options);
|
|
3335
3279
|
}
|
|
3336
|
-
|
|
3337
3280
|
_createClass(Browser, [{
|
|
3338
3281
|
key: "init",
|
|
3339
3282
|
value: function init(services) {
|
|
3340
3283
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3341
3284
|
var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3342
3285
|
this.services = services;
|
|
3343
|
-
this.options = defaults(options, this.options || {}, getDefaults$1());
|
|
3286
|
+
this.options = defaults(options, this.options || {}, getDefaults$1());
|
|
3344
3287
|
|
|
3288
|
+
// backwards compatibility
|
|
3345
3289
|
if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;
|
|
3346
3290
|
this.i18nOptions = i18nOptions;
|
|
3347
3291
|
this.addDetector(cookie$1);
|
|
@@ -3362,26 +3306,22 @@ var Browser = /*#__PURE__*/function () {
|
|
|
3362
3306
|
key: "detect",
|
|
3363
3307
|
value: function detect(detectionOrder) {
|
|
3364
3308
|
var _this = this;
|
|
3365
|
-
|
|
3366
3309
|
if (!detectionOrder) detectionOrder = this.options.order;
|
|
3367
3310
|
var detected = [];
|
|
3368
3311
|
detectionOrder.forEach(function (detectorName) {
|
|
3369
3312
|
if (_this.detectors[detectorName]) {
|
|
3370
3313
|
var lookup = _this.detectors[detectorName].lookup(_this.options);
|
|
3371
|
-
|
|
3372
3314
|
if (lookup && typeof lookup === 'string') lookup = [lookup];
|
|
3373
3315
|
if (lookup) detected = detected.concat(lookup);
|
|
3374
3316
|
}
|
|
3375
3317
|
});
|
|
3376
3318
|
if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0
|
|
3377
|
-
|
|
3378
3319
|
return detected.length > 0 ? detected[0] : null; // a little backward compatibility
|
|
3379
3320
|
}
|
|
3380
3321
|
}, {
|
|
3381
3322
|
key: "cacheUserLanguage",
|
|
3382
3323
|
value: function cacheUserLanguage(lng, caches) {
|
|
3383
3324
|
var _this2 = this;
|
|
3384
|
-
|
|
3385
3325
|
if (!caches) caches = this.options.caches;
|
|
3386
3326
|
if (!caches) return;
|
|
3387
3327
|
if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;
|
|
@@ -3390,10 +3330,8 @@ var Browser = /*#__PURE__*/function () {
|
|
|
3390
3330
|
});
|
|
3391
3331
|
}
|
|
3392
3332
|
}]);
|
|
3393
|
-
|
|
3394
3333
|
return Browser;
|
|
3395
3334
|
}();
|
|
3396
|
-
|
|
3397
3335
|
Browser.type = 'languageDetector';
|
|
3398
3336
|
|
|
3399
3337
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -3427,6 +3365,30 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
3427
3365
|
|
|
3428
3366
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3429
3367
|
|
|
3368
|
+
/**
|
|
3369
|
+
* This file automatically generated from `pre-publish.js`.
|
|
3370
|
+
* Do not manually edit.
|
|
3371
|
+
*/
|
|
3372
|
+
|
|
3373
|
+
var voidElements = {
|
|
3374
|
+
"area": true,
|
|
3375
|
+
"base": true,
|
|
3376
|
+
"br": true,
|
|
3377
|
+
"col": true,
|
|
3378
|
+
"embed": true,
|
|
3379
|
+
"hr": true,
|
|
3380
|
+
"img": true,
|
|
3381
|
+
"input": true,
|
|
3382
|
+
"link": true,
|
|
3383
|
+
"meta": true,
|
|
3384
|
+
"param": true,
|
|
3385
|
+
"source": true,
|
|
3386
|
+
"track": true,
|
|
3387
|
+
"wbr": true
|
|
3388
|
+
};
|
|
3389
|
+
|
|
3390
|
+
var t$1=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function n$1(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],(voidElements[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return {type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(t$1),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--;}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,i=/^\s*$/,s=Object.create(null);function a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var c={parse:function(e,t){t||(t={}),t.components||(t.components=s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)});}return e.replace(r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1;}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=n$1(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=n$1(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g});}}),c},stringify:function(e){return e.reduce(function(e,t){return e+a("",t)},"")}};
|
|
3391
|
+
|
|
3430
3392
|
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
3431
3393
|
var htmlEntities = {
|
|
3432
3394
|
'&': '&',
|
|
@@ -3459,9 +3421,9 @@ var unescape = function unescape(text) {
|
|
|
3459
3421
|
return text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
3460
3422
|
};
|
|
3461
3423
|
|
|
3462
|
-
function ownKeys$
|
|
3424
|
+
function ownKeys$a(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3463
3425
|
|
|
3464
|
-
function _objectSpread$
|
|
3426
|
+
function _objectSpread$a(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$a(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$a(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3465
3427
|
var defaultOptions = {
|
|
3466
3428
|
bindI18n: 'languageChanged',
|
|
3467
3429
|
bindI18nStore: '',
|
|
@@ -3476,7 +3438,7 @@ var i18nInstance;
|
|
|
3476
3438
|
var I18nContext = createContext();
|
|
3477
3439
|
function setDefaults() {
|
|
3478
3440
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3479
|
-
defaultOptions = _objectSpread$
|
|
3441
|
+
defaultOptions = _objectSpread$a(_objectSpread$a({}, defaultOptions), options);
|
|
3480
3442
|
}
|
|
3481
3443
|
function getDefaults() {
|
|
3482
3444
|
return defaultOptions;
|
|
@@ -3600,6 +3562,274 @@ function hasLoadedNamespace(ns, i18n) {
|
|
|
3600
3562
|
});
|
|
3601
3563
|
}
|
|
3602
3564
|
|
|
3565
|
+
var _excluded$2 = ["format"],
|
|
3566
|
+
_excluded2$2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
|
|
3567
|
+
|
|
3568
|
+
function ownKeys$9(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3569
|
+
|
|
3570
|
+
function _objectSpread$9(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$9(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$9(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3571
|
+
|
|
3572
|
+
function hasChildren(node, checkLength) {
|
|
3573
|
+
if (!node) return false;
|
|
3574
|
+
var base = node.props ? node.props.children : node.children;
|
|
3575
|
+
if (checkLength) return base.length > 0;
|
|
3576
|
+
return !!base;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
function getChildren(node) {
|
|
3580
|
+
if (!node) return [];
|
|
3581
|
+
return node.props ? node.props.children : node.children;
|
|
3582
|
+
}
|
|
3583
|
+
|
|
3584
|
+
function hasValidReactChildren(children) {
|
|
3585
|
+
if (Object.prototype.toString.call(children) !== '[object Array]') return false;
|
|
3586
|
+
return children.every(function (child) {
|
|
3587
|
+
return isValidElement(child);
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
function getAsArray(data) {
|
|
3592
|
+
return Array.isArray(data) ? data : [data];
|
|
3593
|
+
}
|
|
3594
|
+
|
|
3595
|
+
function mergeProps(source, target) {
|
|
3596
|
+
var newTarget = _objectSpread$9({}, target);
|
|
3597
|
+
|
|
3598
|
+
newTarget.props = Object.assign(source.props, target.props);
|
|
3599
|
+
return newTarget;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
function nodesToString(children, i18nOptions) {
|
|
3603
|
+
if (!children) return '';
|
|
3604
|
+
var stringNode = '';
|
|
3605
|
+
var childrenArray = getAsArray(children);
|
|
3606
|
+
var keepArray = i18nOptions.transSupportBasicHtmlNodes && i18nOptions.transKeepBasicHtmlNodesFor ? i18nOptions.transKeepBasicHtmlNodesFor : [];
|
|
3607
|
+
childrenArray.forEach(function (child, childIndex) {
|
|
3608
|
+
if (typeof child === 'string') {
|
|
3609
|
+
stringNode += "".concat(child);
|
|
3610
|
+
} else if (isValidElement(child)) {
|
|
3611
|
+
var childPropsCount = Object.keys(child.props).length;
|
|
3612
|
+
var shouldKeepChild = keepArray.indexOf(child.type) > -1;
|
|
3613
|
+
var childChildren = child.props.children;
|
|
3614
|
+
|
|
3615
|
+
if (!childChildren && shouldKeepChild && childPropsCount === 0) {
|
|
3616
|
+
stringNode += "<".concat(child.type, "/>");
|
|
3617
|
+
} else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
|
|
3618
|
+
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
|
|
3619
|
+
} else if (child.props.i18nIsDynamicList) {
|
|
3620
|
+
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
|
|
3621
|
+
} else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
|
|
3622
|
+
stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
|
|
3623
|
+
} else {
|
|
3624
|
+
var content = nodesToString(childChildren, i18nOptions);
|
|
3625
|
+
stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
|
|
3626
|
+
}
|
|
3627
|
+
} else if (child === null) {
|
|
3628
|
+
warn("Trans: the passed in value is invalid - seems you passed in a null child.");
|
|
3629
|
+
} else if (_typeof(child) === 'object') {
|
|
3630
|
+
var format = child.format,
|
|
3631
|
+
clone = _objectWithoutProperties(child, _excluded$2);
|
|
3632
|
+
|
|
3633
|
+
var keys = Object.keys(clone);
|
|
3634
|
+
|
|
3635
|
+
if (keys.length === 1) {
|
|
3636
|
+
var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
|
|
3637
|
+
stringNode += "{{".concat(value, "}}");
|
|
3638
|
+
} else {
|
|
3639
|
+
warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
|
|
3640
|
+
}
|
|
3641
|
+
} else {
|
|
3642
|
+
warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
|
|
3643
|
+
}
|
|
3644
|
+
});
|
|
3645
|
+
return stringNode;
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3648
|
+
function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
|
|
3649
|
+
if (targetString === '') return [];
|
|
3650
|
+
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
|
|
3651
|
+
var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
|
|
3652
|
+
if (!children && !emptyChildrenButNeedsHandling) return [targetString];
|
|
3653
|
+
var data = {};
|
|
3654
|
+
|
|
3655
|
+
function getData(childs) {
|
|
3656
|
+
var childrenArray = getAsArray(childs);
|
|
3657
|
+
childrenArray.forEach(function (child) {
|
|
3658
|
+
if (typeof child === 'string') return;
|
|
3659
|
+
if (hasChildren(child)) getData(getChildren(child));else if (_typeof(child) === 'object' && !isValidElement(child)) Object.assign(data, child);
|
|
3660
|
+
});
|
|
3661
|
+
}
|
|
3662
|
+
|
|
3663
|
+
getData(children);
|
|
3664
|
+
var ast = c.parse("<0>".concat(targetString, "</0>"));
|
|
3665
|
+
|
|
3666
|
+
var opts = _objectSpread$9(_objectSpread$9({}, data), combinedTOpts);
|
|
3667
|
+
|
|
3668
|
+
function renderInner(child, node, rootReactNode) {
|
|
3669
|
+
var childs = getChildren(child);
|
|
3670
|
+
var mappedChildren = mapAST(childs, node.children, rootReactNode);
|
|
3671
|
+
return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
|
|
3672
|
+
}
|
|
3673
|
+
|
|
3674
|
+
function pushTranslatedJSX(child, inner, mem, i, isVoid) {
|
|
3675
|
+
if (child.dummy) child.children = inner;
|
|
3676
|
+
mem.push(cloneElement(child, _objectSpread$9(_objectSpread$9({}, child.props), {}, {
|
|
3677
|
+
key: i
|
|
3678
|
+
}), isVoid ? undefined : inner));
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
function mapAST(reactNode, astNode, rootReactNode) {
|
|
3682
|
+
var reactNodes = getAsArray(reactNode);
|
|
3683
|
+
var astNodes = getAsArray(astNode);
|
|
3684
|
+
return astNodes.reduce(function (mem, node, i) {
|
|
3685
|
+
var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
|
|
3686
|
+
|
|
3687
|
+
if (node.type === 'tag') {
|
|
3688
|
+
var tmp = reactNodes[parseInt(node.name, 10)];
|
|
3689
|
+
if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
|
|
3690
|
+
if (!tmp) tmp = {};
|
|
3691
|
+
var child = Object.keys(node.attrs).length !== 0 ? mergeProps({
|
|
3692
|
+
props: node.attrs
|
|
3693
|
+
}, tmp) : tmp;
|
|
3694
|
+
var isElement = isValidElement(child);
|
|
3695
|
+
var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
|
|
3696
|
+
var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && _typeof(child) === 'object' && child.dummy && !isElement;
|
|
3697
|
+
var isKnownComponent = _typeof(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
|
|
3698
|
+
|
|
3699
|
+
if (typeof child === 'string') {
|
|
3700
|
+
var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
|
|
3701
|
+
mem.push(value);
|
|
3702
|
+
} else if (hasChildren(child) || isValidTranslationWithChildren) {
|
|
3703
|
+
var inner = renderInner(child, node, rootReactNode);
|
|
3704
|
+
pushTranslatedJSX(child, inner, mem, i);
|
|
3705
|
+
} else if (isEmptyTransWithHTML) {
|
|
3706
|
+
var _inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
3707
|
+
|
|
3708
|
+
mem.push(cloneElement(child, _objectSpread$9(_objectSpread$9({}, child.props), {}, {
|
|
3709
|
+
key: i
|
|
3710
|
+
}), _inner));
|
|
3711
|
+
} else if (Number.isNaN(parseFloat(node.name))) {
|
|
3712
|
+
if (isKnownComponent) {
|
|
3713
|
+
var _inner2 = renderInner(child, node, rootReactNode);
|
|
3714
|
+
|
|
3715
|
+
pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
|
|
3716
|
+
} else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
|
|
3717
|
+
if (node.voidElement) {
|
|
3718
|
+
mem.push(createElement(node.name, {
|
|
3719
|
+
key: "".concat(node.name, "-").concat(i)
|
|
3720
|
+
}));
|
|
3721
|
+
} else {
|
|
3722
|
+
var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
|
|
3723
|
+
|
|
3724
|
+
mem.push(createElement(node.name, {
|
|
3725
|
+
key: "".concat(node.name, "-").concat(i)
|
|
3726
|
+
}, _inner3));
|
|
3727
|
+
}
|
|
3728
|
+
} else if (node.voidElement) {
|
|
3729
|
+
mem.push("<".concat(node.name, " />"));
|
|
3730
|
+
} else {
|
|
3731
|
+
var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
|
|
3732
|
+
|
|
3733
|
+
mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
|
|
3734
|
+
}
|
|
3735
|
+
} else if (_typeof(child) === 'object' && !isElement) {
|
|
3736
|
+
var content = node.children[0] ? translationContent : null;
|
|
3737
|
+
if (content) mem.push(content);
|
|
3738
|
+
} else if (node.children.length === 1 && translationContent) {
|
|
3739
|
+
mem.push(cloneElement(child, _objectSpread$9(_objectSpread$9({}, child.props), {}, {
|
|
3740
|
+
key: i
|
|
3741
|
+
}), translationContent));
|
|
3742
|
+
} else {
|
|
3743
|
+
mem.push(cloneElement(child, _objectSpread$9(_objectSpread$9({}, child.props), {}, {
|
|
3744
|
+
key: i
|
|
3745
|
+
})));
|
|
3746
|
+
}
|
|
3747
|
+
} else if (node.type === 'text') {
|
|
3748
|
+
var wrapTextNodes = i18nOptions.transWrapTextNodes;
|
|
3749
|
+
|
|
3750
|
+
var _content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
|
3751
|
+
|
|
3752
|
+
if (wrapTextNodes) {
|
|
3753
|
+
mem.push(createElement(wrapTextNodes, {
|
|
3754
|
+
key: "".concat(node.name, "-").concat(i)
|
|
3755
|
+
}, _content));
|
|
3756
|
+
} else {
|
|
3757
|
+
mem.push(_content);
|
|
3758
|
+
}
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
return mem;
|
|
3762
|
+
}, []);
|
|
3763
|
+
}
|
|
3764
|
+
|
|
3765
|
+
var result = mapAST([{
|
|
3766
|
+
dummy: true,
|
|
3767
|
+
children: children || []
|
|
3768
|
+
}], ast, getAsArray(children || []));
|
|
3769
|
+
return getChildren(result[0]);
|
|
3770
|
+
}
|
|
3771
|
+
|
|
3772
|
+
function Trans(_ref) {
|
|
3773
|
+
var children = _ref.children,
|
|
3774
|
+
count = _ref.count,
|
|
3775
|
+
parent = _ref.parent,
|
|
3776
|
+
i18nKey = _ref.i18nKey,
|
|
3777
|
+
context = _ref.context,
|
|
3778
|
+
_ref$tOptions = _ref.tOptions,
|
|
3779
|
+
tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
|
|
3780
|
+
values = _ref.values,
|
|
3781
|
+
defaults = _ref.defaults,
|
|
3782
|
+
components = _ref.components,
|
|
3783
|
+
ns = _ref.ns,
|
|
3784
|
+
i18nFromProps = _ref.i18n,
|
|
3785
|
+
tFromProps = _ref.t,
|
|
3786
|
+
shouldUnescape = _ref.shouldUnescape,
|
|
3787
|
+
additionalProps = _objectWithoutProperties(_ref, _excluded2$2);
|
|
3788
|
+
|
|
3789
|
+
var _ref2 = useContext(I18nContext) || {},
|
|
3790
|
+
i18nFromContext = _ref2.i18n,
|
|
3791
|
+
defaultNSFromContext = _ref2.defaultNS;
|
|
3792
|
+
|
|
3793
|
+
var i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
3794
|
+
|
|
3795
|
+
if (!i18n) {
|
|
3796
|
+
warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
|
|
3797
|
+
return children;
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
var t = tFromProps || i18n.t.bind(i18n) || function (k) {
|
|
3801
|
+
return k;
|
|
3802
|
+
};
|
|
3803
|
+
|
|
3804
|
+
if (context) tOptions.context = context;
|
|
3805
|
+
|
|
3806
|
+
var reactI18nextOptions = _objectSpread$9(_objectSpread$9({}, getDefaults()), i18n.options && i18n.options.react);
|
|
3807
|
+
|
|
3808
|
+
var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
3809
|
+
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
3810
|
+
var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
|
3811
|
+
var hashTransKey = reactI18nextOptions.hashTransKey;
|
|
3812
|
+
var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
|
|
3813
|
+
var interpolationOverride = values ? tOptions.interpolation : {
|
|
3814
|
+
interpolation: _objectSpread$9(_objectSpread$9({}, tOptions.interpolation), {}, {
|
|
3815
|
+
prefix: '#$?',
|
|
3816
|
+
suffix: '?$#'
|
|
3817
|
+
})
|
|
3818
|
+
};
|
|
3819
|
+
|
|
3820
|
+
var combinedTOpts = _objectSpread$9(_objectSpread$9(_objectSpread$9(_objectSpread$9({}, tOptions), {}, {
|
|
3821
|
+
count: count
|
|
3822
|
+
}, values), interpolationOverride), {}, {
|
|
3823
|
+
defaultValue: defaultValue,
|
|
3824
|
+
ns: namespaces
|
|
3825
|
+
});
|
|
3826
|
+
|
|
3827
|
+
var translation = key ? t(key, combinedTOpts) : defaultValue;
|
|
3828
|
+
var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
|
|
3829
|
+
var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
|
|
3830
|
+
return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
|
|
3831
|
+
}
|
|
3832
|
+
|
|
3603
3833
|
function _iterableToArrayLimit(arr, i) {
|
|
3604
3834
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
3605
3835
|
if (_i == null) return;
|
|
@@ -3629,9 +3859,9 @@ function _slicedToArray(arr, i) {
|
|
|
3629
3859
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3630
3860
|
}
|
|
3631
3861
|
|
|
3632
|
-
function ownKeys$
|
|
3862
|
+
function ownKeys$8(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
3633
3863
|
|
|
3634
|
-
function _objectSpread$
|
|
3864
|
+
function _objectSpread$8(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$8(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$8(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3635
3865
|
|
|
3636
3866
|
var usePrevious = function usePrevious(value, ignore) {
|
|
3637
3867
|
var ref = useRef();
|
|
@@ -3668,7 +3898,7 @@ function useTranslation(ns) {
|
|
|
3668
3898
|
|
|
3669
3899
|
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
3670
3900
|
|
|
3671
|
-
var i18nOptions = _objectSpread$
|
|
3901
|
+
var i18nOptions = _objectSpread$8(_objectSpread$8(_objectSpread$8({}, getDefaults()), i18n.options.react), props);
|
|
3672
3902
|
|
|
3673
3903
|
var useSuspense = i18nOptions.useSuspense,
|
|
3674
3904
|
keyPrefix = i18nOptions.keyPrefix;
|
|
@@ -3750,6 +3980,7 @@ var alerts$1 = {
|
|
|
3750
3980
|
};
|
|
3751
3981
|
var buttons$1 = {
|
|
3752
3982
|
cancel: "Cancel",
|
|
3983
|
+
changeRole: "Change role",
|
|
3753
3984
|
proceed: "Proceed",
|
|
3754
3985
|
saveChanges: "Save changes"
|
|
3755
3986
|
};
|
|
@@ -3790,7 +4021,10 @@ var common$1 = {
|
|
|
3790
4021
|
};
|
|
3791
4022
|
var helpers$1 = {
|
|
3792
4023
|
configPermissions: "Configure permissions for the modules.",
|
|
3793
|
-
enterMultipleEmails: "Please press space, tab or enter key after entering an email address."
|
|
4024
|
+
enterMultipleEmails: "Please press space, tab or enter key after entering an email address.",
|
|
4025
|
+
noRolesFound: "No roles found.",
|
|
4026
|
+
searchRoles: "Search roles",
|
|
4027
|
+
selectedMembersCount: "{{count}} {{metaName}} selected from {{totalCount}}"
|
|
3794
4028
|
};
|
|
3795
4029
|
var metaNames$1 = {
|
|
3796
4030
|
agent_one: "Agent",
|
|
@@ -3841,6 +4075,7 @@ var alerts = {
|
|
|
3841
4075
|
};
|
|
3842
4076
|
var buttons = {
|
|
3843
4077
|
cancel: "Annuler",
|
|
4078
|
+
changeRole: "Changer de rôle",
|
|
3844
4079
|
proceed: "Procéder",
|
|
3845
4080
|
saveChanges: "Sauvegarder les modifications"
|
|
3846
4081
|
};
|
|
@@ -3881,7 +4116,11 @@ var common = {
|
|
|
3881
4116
|
};
|
|
3882
4117
|
var helpers = {
|
|
3883
4118
|
configPermissions: "Configurez les autorisations pour les modules.",
|
|
3884
|
-
enterMultipleEmails: "Veuillez appuyer sur espace, tabulation ou entrée après avoir saisi une adresse e-mail."
|
|
4119
|
+
enterMultipleEmails: "Veuillez appuyer sur espace, tabulation ou entrée après avoir saisi une adresse e-mail.",
|
|
4120
|
+
noRolesFound: "Aucun rôle trouvé.",
|
|
4121
|
+
searchRoles: "Rechercher des rôles",
|
|
4122
|
+
selectedMembersCount_one: "{{count}} {{metaName}} sélectionné parmi {{totalCount}}",
|
|
4123
|
+
selectedMembersCount_other: "{{count}} {{metaName}} sélectionnés parmi {{totalCount}}"
|
|
3885
4124
|
};
|
|
3886
4125
|
var metaNames = {
|
|
3887
4126
|
member_one: "Membre",
|
|
@@ -3979,6 +4218,9 @@ const slugify = string => string.toString().toLowerCase().replace(/\s+/g, "-") /
|
|
|
3979
4218
|
.replace(/^-+/, "") // Trim - from start of text
|
|
3980
4219
|
.replace(/-+$/, ""); // Trim - from end of text
|
|
3981
4220
|
|
|
4221
|
+
const capitalize = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
4222
|
+
const isNotEmpty$1 = complement(isEmpty);
|
|
4223
|
+
|
|
3982
4224
|
const SINGULAR = {
|
|
3983
4225
|
count: 1
|
|
3984
4226
|
};
|
|
@@ -7206,11 +7448,11 @@ const QUERY_KEYS = {
|
|
|
7206
7448
|
PERMISSIONS: "neeto-team-members-permissions"
|
|
7207
7449
|
};
|
|
7208
7450
|
|
|
7209
|
-
function ownKeys$
|
|
7210
|
-
function _objectSpread$
|
|
7451
|
+
function ownKeys$7(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7452
|
+
function _objectSpread$7(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$7(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7211
7453
|
const useFetchPermissions = function () {
|
|
7212
7454
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7213
|
-
return useQuery(QUERY_KEYS.PERMISSIONS, permissionsApi.fetch, _objectSpread$
|
|
7455
|
+
return useQuery(QUERY_KEYS.PERMISSIONS, permissionsApi.fetch, _objectSpread$7({
|
|
7214
7456
|
staleTime: DEFAULT_STALE_TIME,
|
|
7215
7457
|
select: response => response.permissions || response.data.permissions
|
|
7216
7458
|
}, options));
|
|
@@ -7231,12 +7473,12 @@ const organizationRolesApi = {
|
|
|
7231
7473
|
|
|
7232
7474
|
const _excluded$1 = ["onSuccess"],
|
|
7233
7475
|
_excluded2$1 = ["onSuccess"],
|
|
7234
|
-
_excluded3 = ["onSuccess"];
|
|
7235
|
-
function ownKeys$
|
|
7236
|
-
function _objectSpread$
|
|
7476
|
+
_excluded3$1 = ["onSuccess"];
|
|
7477
|
+
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7478
|
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7237
7479
|
const useFetchRoles = function () {
|
|
7238
7480
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7239
|
-
return useQuery(QUERY_KEYS.ROLES, organizationRolesApi.fetch, _objectSpread$
|
|
7481
|
+
return useQuery(QUERY_KEYS.ROLES, organizationRolesApi.fetch, _objectSpread$6({
|
|
7240
7482
|
staleTime: DEFAULT_STALE_TIME,
|
|
7241
7483
|
select: response => response.organizationRoles || response.data.organizationRoles
|
|
7242
7484
|
}, options));
|
|
@@ -7244,7 +7486,7 @@ const useFetchRoles = function () {
|
|
|
7244
7486
|
const useCreateRole = _ref => {
|
|
7245
7487
|
let onSuccess = _ref.onSuccess,
|
|
7246
7488
|
options = _objectWithoutProperties(_ref, _excluded$1);
|
|
7247
|
-
return useMutation(organizationRolesApi.create, _objectSpread$
|
|
7489
|
+
return useMutation(organizationRolesApi.create, _objectSpread$6({
|
|
7248
7490
|
onSuccess: response => {
|
|
7249
7491
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
7250
7492
|
if (!!cachedData.data && !!cachedData.data.organizationRoles) {
|
|
@@ -7264,7 +7506,7 @@ const useUpdateRole = _ref2 => {
|
|
|
7264
7506
|
let id = _ref3.id,
|
|
7265
7507
|
payload = _ref3.payload;
|
|
7266
7508
|
return organizationRolesApi.update(id, payload);
|
|
7267
|
-
}, _objectSpread$
|
|
7509
|
+
}, _objectSpread$6({
|
|
7268
7510
|
onSuccess: response => {
|
|
7269
7511
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
7270
7512
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
@@ -7281,12 +7523,12 @@ const useUpdateRole = _ref2 => {
|
|
|
7281
7523
|
const useDestroyRole = _ref4 => {
|
|
7282
7524
|
let _ref4$onSuccess = _ref4.onSuccess,
|
|
7283
7525
|
onSuccess = _ref4$onSuccess === void 0 ? noop$1 : _ref4$onSuccess,
|
|
7284
|
-
options = _objectWithoutProperties(_ref4, _excluded3);
|
|
7526
|
+
options = _objectWithoutProperties(_ref4, _excluded3$1);
|
|
7285
7527
|
return useMutation(_ref5 => {
|
|
7286
7528
|
let id = _ref5.id,
|
|
7287
7529
|
payload = _ref5.payload;
|
|
7288
7530
|
return organizationRolesApi.destroy(id, payload);
|
|
7289
|
-
}, _objectSpread$
|
|
7531
|
+
}, _objectSpread$6({
|
|
7290
7532
|
onSuccess: response => {
|
|
7291
7533
|
queryClient.setQueriesData(QUERY_KEYS.ROLES, cachedData => {
|
|
7292
7534
|
if (!!cachedData.data && !!cachedData.data.organizationRoles) {
|
|
@@ -8856,8 +9098,8 @@ const Permissions = _ref => {
|
|
|
8856
9098
|
}))));
|
|
8857
9099
|
};
|
|
8858
9100
|
|
|
8859
|
-
function ownKeys$
|
|
8860
|
-
function _objectSpread$
|
|
9101
|
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9102
|
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$5(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8861
9103
|
const New = _ref => {
|
|
8862
9104
|
let isOpen = _ref.isOpen,
|
|
8863
9105
|
onClose = _ref.onClose,
|
|
@@ -8871,7 +9113,7 @@ const New = _ref => {
|
|
|
8871
9113
|
createRole = _useCreateRole.mutate,
|
|
8872
9114
|
isSubmitting = _useCreateRole.isLoading;
|
|
8873
9115
|
const handleFormSubmit = formValues => {
|
|
8874
|
-
const modifiedFormValues = _objectSpread$
|
|
9116
|
+
const modifiedFormValues = _objectSpread$5(_objectSpread$5({}, formValues), {}, {
|
|
8875
9117
|
description: formValues.description.trim()
|
|
8876
9118
|
});
|
|
8877
9119
|
createRole({
|
|
@@ -9230,8 +9472,8 @@ const Delete = _ref => {
|
|
|
9230
9472
|
});
|
|
9231
9473
|
};
|
|
9232
9474
|
|
|
9233
|
-
function ownKeys$
|
|
9234
|
-
function _objectSpread$
|
|
9475
|
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9476
|
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$4(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9235
9477
|
const Edit = _ref => {
|
|
9236
9478
|
let isOpen = _ref.isOpen,
|
|
9237
9479
|
onClose = _ref.onClose,
|
|
@@ -9250,7 +9492,7 @@ const Edit = _ref => {
|
|
|
9250
9492
|
};
|
|
9251
9493
|
const handleFormSubmit = formValues => {
|
|
9252
9494
|
const payload = {
|
|
9253
|
-
organizationRole: _objectSpread$
|
|
9495
|
+
organizationRole: _objectSpread$4(_objectSpread$4(_objectSpread$4({}, selectedRole), formValues), {}, {
|
|
9254
9496
|
description: formValues.description.trim()
|
|
9255
9497
|
})
|
|
9256
9498
|
};
|
|
@@ -9578,20 +9820,23 @@ const fetch = params => axios.get(`${BASE_URL}/teams`, {
|
|
|
9578
9820
|
});
|
|
9579
9821
|
const create = payload => axios.post(`${BASE_URL}/teams`, payload);
|
|
9580
9822
|
const update = (id, payload) => axios.put(`${BASE_URL}/teams/${id}`, payload);
|
|
9823
|
+
const bulkUpdate = payload => axios.patch(`${BASE_URL}/teams/bulk_update`, payload);
|
|
9581
9824
|
const teamsApi = {
|
|
9582
|
-
|
|
9825
|
+
bulkUpdate,
|
|
9583
9826
|
create,
|
|
9827
|
+
fetch,
|
|
9584
9828
|
update
|
|
9585
9829
|
};
|
|
9586
9830
|
|
|
9587
9831
|
const _excluded = ["onSuccess"],
|
|
9588
|
-
_excluded2 = ["onSuccess"]
|
|
9589
|
-
|
|
9590
|
-
function
|
|
9832
|
+
_excluded2 = ["onSuccess"],
|
|
9833
|
+
_excluded3 = ["onSuccess"];
|
|
9834
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9835
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9591
9836
|
const useFetchMembers = function () {
|
|
9592
9837
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9593
9838
|
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
9594
|
-
return useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$
|
|
9839
|
+
return useQuery([QUERY_KEYS.TEAMS, params], () => teamsApi.fetch(params), _objectSpread$3({
|
|
9595
9840
|
staleTime: DEFAULT_STALE_TIME,
|
|
9596
9841
|
select: response => response.data || response,
|
|
9597
9842
|
keepPreviousData: true
|
|
@@ -9600,7 +9845,7 @@ const useFetchMembers = function () {
|
|
|
9600
9845
|
const useCreateMember = _ref => {
|
|
9601
9846
|
let onSuccess = _ref.onSuccess,
|
|
9602
9847
|
options = _objectWithoutProperties(_ref, _excluded);
|
|
9603
|
-
return useMutation(teamsApi.create, _objectSpread$
|
|
9848
|
+
return useMutation(teamsApi.create, _objectSpread$3({
|
|
9604
9849
|
onSuccess: response => {
|
|
9605
9850
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
9606
9851
|
Toastr.success(response.ntmNotice || response.data.ntmNotice);
|
|
@@ -9615,7 +9860,18 @@ const useUpdateMember = _ref2 => {
|
|
|
9615
9860
|
let id = _ref3.id,
|
|
9616
9861
|
payload = _ref3.payload;
|
|
9617
9862
|
return teamsApi.update(id, payload);
|
|
9618
|
-
}, _objectSpread$
|
|
9863
|
+
}, _objectSpread$3({
|
|
9864
|
+
onSuccess: response => {
|
|
9865
|
+
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
9866
|
+
Toastr.success(response.ntmNotice || response.data.ntmNotice);
|
|
9867
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
|
9868
|
+
}
|
|
9869
|
+
}, options));
|
|
9870
|
+
};
|
|
9871
|
+
const useBulkUpdateMembers = _ref4 => {
|
|
9872
|
+
let onSuccess = _ref4.onSuccess,
|
|
9873
|
+
options = _objectWithoutProperties(_ref4, _excluded3);
|
|
9874
|
+
return useMutation(teamsApi.bulkUpdate, _objectSpread$3({
|
|
9619
9875
|
onSuccess: response => {
|
|
9620
9876
|
queryClient.invalidateQueries(QUERY_KEYS.TEAMS);
|
|
9621
9877
|
Toastr.success(response.ntmNotice || response.data.ntmNotice);
|
|
@@ -9639,8 +9895,7 @@ const useDebounce = function (value) {
|
|
|
9639
9895
|
|
|
9640
9896
|
const Header = _ref => {
|
|
9641
9897
|
var _permissions$create, _permissions$create2;
|
|
9642
|
-
let
|
|
9643
|
-
metaName = _ref$metaName === void 0 ? "" : _ref$metaName,
|
|
9898
|
+
let metaName = _ref.metaName,
|
|
9644
9899
|
_ref$onClick = _ref.onClick,
|
|
9645
9900
|
onClick = _ref$onClick === void 0 ? noop$1 : _ref$onClick,
|
|
9646
9901
|
permissions = _ref.permissions;
|
|
@@ -9652,7 +9907,7 @@ const Header = _ref => {
|
|
|
9652
9907
|
"data-cy": "ntm-add-member-button",
|
|
9653
9908
|
disabled: !((_permissions$create2 = permissions === null || permissions === void 0 ? void 0 : permissions.create) !== null && _permissions$create2 !== void 0 ? _permissions$create2 : hasPermission(MANAGE_MEMBER_PERMISSIONS)),
|
|
9654
9909
|
label: instance.t("common.add_", {
|
|
9655
|
-
what:
|
|
9910
|
+
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
9656
9911
|
}),
|
|
9657
9912
|
onClick: onClick
|
|
9658
9913
|
})));
|
|
@@ -9697,7 +9952,7 @@ const removeBy = curry((pattern, array) => array.filter(complement(matches(patte
|
|
|
9697
9952
|
const removeFixedColumns = (fixedColumns, columnData) => removeBy({
|
|
9698
9953
|
dataIndex: includes(__, fixedColumns)
|
|
9699
9954
|
}, columnData);
|
|
9700
|
-
const filterBySearchTerm = (searchTerm, columns) => filter(_ref3 => {
|
|
9955
|
+
const filterBySearchTerm$1 = (searchTerm, columns) => filter(_ref3 => {
|
|
9701
9956
|
let title = _ref3.title;
|
|
9702
9957
|
return includes(trim(toLower(searchTerm)), trim(toLower(title)));
|
|
9703
9958
|
}, columns);
|
|
@@ -9735,7 +9990,7 @@ const Columns = _ref => {
|
|
|
9735
9990
|
searchTerm = _useState2[0],
|
|
9736
9991
|
setSearchTerm = _useState2[1];
|
|
9737
9992
|
const columns = removeFixedColumns(fixedColumns, columnData);
|
|
9738
|
-
const filteredColumns = filterBySearchTerm(searchTerm, columns);
|
|
9993
|
+
const filteredColumns = filterBySearchTerm$1(searchTerm, columns);
|
|
9739
9994
|
const handleChange = _ref2 => {
|
|
9740
9995
|
let _ref2$target = _ref2.target,
|
|
9741
9996
|
dataIndex = _ref2$target.name,
|
|
@@ -9803,44 +10058,70 @@ const MANAGE_ROLES_BUTTON_LABEL = instance.t("common.manage_", {
|
|
|
9803
10058
|
what: instance.t("common.role", PLURAL).toLocaleLowerCase()
|
|
9804
10059
|
});
|
|
9805
10060
|
|
|
9806
|
-
const
|
|
9807
|
-
let
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9821
|
-
const
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
const
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9843
|
-
|
|
10061
|
+
const filterBySearchTerm = (searchTerm, roles) => filter(_ref => {
|
|
10062
|
+
let name = _ref.name;
|
|
10063
|
+
return includes(trim(toLower(searchTerm)), trim(toLower(name)));
|
|
10064
|
+
}, roles);
|
|
10065
|
+
const getActivateButtonVisible = selectedRows => selectedRows.active.some(active => active === false);
|
|
10066
|
+
const getDeactivatedButtonVisible = selectedRows => selectedRows.active.some(active => active === true);
|
|
10067
|
+
|
|
10068
|
+
const Menu$1 = Dropdown.Menu,
|
|
10069
|
+
MenuItem = Dropdown.MenuItem;
|
|
10070
|
+
const RolesDropdown = _ref => {
|
|
10071
|
+
let handleRoleChange = _ref.handleRoleChange,
|
|
10072
|
+
_ref$isSearchable = _ref.isSearchable,
|
|
10073
|
+
isSearchable = _ref$isSearchable === void 0 ? false : _ref$isSearchable,
|
|
10074
|
+
_ref$roles = _ref.roles,
|
|
10075
|
+
roles = _ref$roles === void 0 ? [] : _ref$roles;
|
|
10076
|
+
const _useState = useState(false),
|
|
10077
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10078
|
+
isDropdownOpen = _useState2[0],
|
|
10079
|
+
setIsDropdownOpen = _useState2[1];
|
|
10080
|
+
const _useState3 = useState(""),
|
|
10081
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10082
|
+
searchTerm = _useState4[0],
|
|
10083
|
+
setSearchTerm = _useState4[1];
|
|
10084
|
+
const filteredRoles = filterBySearchTerm(searchTerm, roles);
|
|
10085
|
+
const handleSearch = _ref2 => {
|
|
10086
|
+
let value = _ref2.target.value;
|
|
10087
|
+
return setSearchTerm(value);
|
|
10088
|
+
};
|
|
10089
|
+
const handleSelectRole = role => {
|
|
10090
|
+
handleRoleChange(role);
|
|
10091
|
+
setIsDropdownOpen(false);
|
|
10092
|
+
};
|
|
10093
|
+
const handleOnClose = () => {
|
|
10094
|
+
setSearchTerm("");
|
|
10095
|
+
setIsDropdownOpen(false);
|
|
10096
|
+
};
|
|
10097
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
10098
|
+
buttonSize: "small",
|
|
10099
|
+
buttonStyle: "secondary",
|
|
10100
|
+
closeOnSelect: false,
|
|
10101
|
+
"data-cy": "ntm-members-roles-update-dropdown",
|
|
10102
|
+
label: instance.t("buttons.changeRole"),
|
|
10103
|
+
isOpen: isDropdownOpen,
|
|
10104
|
+
onClick: () => setIsDropdownOpen(true),
|
|
10105
|
+
onClose: () => handleOnClose(),
|
|
10106
|
+
position: "bottom-end"
|
|
10107
|
+
}, /*#__PURE__*/React.createElement(Menu$1, null, /*#__PURE__*/React.createElement("div", null, isSearchable && /*#__PURE__*/React.createElement(Input$1, {
|
|
10108
|
+
className: "neeto-ui-px-3 neeto-ui-py-2",
|
|
10109
|
+
"data-cy": "ntm-members-roles-search-input",
|
|
10110
|
+
onChange: handleSearch,
|
|
10111
|
+
placeholder: instance.t("helpers.searchRoles"),
|
|
10112
|
+
prefix: /*#__PURE__*/React.createElement(Search, null),
|
|
10113
|
+
type: "search",
|
|
10114
|
+
value: searchTerm
|
|
10115
|
+
}), isNotEmpty$1(filteredRoles) ? filteredRoles.map(_ref3 => {
|
|
10116
|
+
let id = _ref3.id,
|
|
10117
|
+
name = _ref3.name;
|
|
10118
|
+
return /*#__PURE__*/React.createElement(MenuItem.Button, {
|
|
10119
|
+
key: id,
|
|
10120
|
+
onClick: () => handleSelectRole(name)
|
|
10121
|
+
}, name);
|
|
10122
|
+
}) : /*#__PURE__*/React.createElement("span", {
|
|
10123
|
+
className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-items-center neeto-ui-p-2"
|
|
10124
|
+
}, instance.t("helpers.noRolesFound")))));
|
|
9844
10125
|
};
|
|
9845
10126
|
|
|
9846
10127
|
var _URLSearchParams$get;
|
|
@@ -9883,9 +10164,617 @@ const DEFAULT_FILTER_VALUES = {
|
|
|
9883
10164
|
sort_by: "",
|
|
9884
10165
|
sort_direction: ""
|
|
9885
10166
|
};
|
|
10167
|
+
const DEFAULT_SELECTED_ROWS = {
|
|
10168
|
+
active: [],
|
|
10169
|
+
emails: [],
|
|
10170
|
+
keys: []
|
|
10171
|
+
};
|
|
9886
10172
|
|
|
9887
|
-
|
|
9888
|
-
|
|
10173
|
+
const Left = _ref => {
|
|
10174
|
+
var _selectedRows$keys, _selectedRows$keys2;
|
|
10175
|
+
let filteredCount = _ref.filteredCount,
|
|
10176
|
+
metaName = _ref.metaName,
|
|
10177
|
+
selectedRows = _ref.selectedRows,
|
|
10178
|
+
totalCount = _ref.totalCount;
|
|
10179
|
+
const hasSelectedRows = isNotEmpty$1(selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.keys);
|
|
10180
|
+
const pluralizedByFilterCount = metaName({
|
|
10181
|
+
count: filteredCount
|
|
10182
|
+
}).toLocaleLowerCase();
|
|
10183
|
+
const selectedMembersCountValues = {
|
|
10184
|
+
count: selectedRows === null || selectedRows === void 0 ? void 0 : (_selectedRows$keys = selectedRows.keys) === null || _selectedRows$keys === void 0 ? void 0 : _selectedRows$keys.length,
|
|
10185
|
+
metaName: metaName({
|
|
10186
|
+
count: selectedRows === null || selectedRows === void 0 ? void 0 : (_selectedRows$keys2 = selectedRows.keys) === null || _selectedRows$keys2 === void 0 ? void 0 : _selectedRows$keys2.length
|
|
10187
|
+
}).toLocaleLowerCase(),
|
|
10188
|
+
totalCount
|
|
10189
|
+
};
|
|
10190
|
+
return /*#__PURE__*/React.createElement(Typography, {
|
|
10191
|
+
"data-cy": "ntm-filtered-members-count",
|
|
10192
|
+
component: "h4",
|
|
10193
|
+
style: "h4"
|
|
10194
|
+
}, hasSelectedRows ? /*#__PURE__*/React.createElement(Trans, {
|
|
10195
|
+
i18nKey: "helpers.selectedMembersCount",
|
|
10196
|
+
values: selectedMembersCountValues
|
|
10197
|
+
}) : `${filteredCount} ${pluralizedByFilterCount}`);
|
|
10198
|
+
};
|
|
10199
|
+
const Right = _ref2 => {
|
|
10200
|
+
let columns = _ref2.columns,
|
|
10201
|
+
roles = _ref2.roles,
|
|
10202
|
+
rolesButtonProps = _ref2.rolesButtonProps,
|
|
10203
|
+
selectedRows = _ref2.selectedRows,
|
|
10204
|
+
setColumnData = _ref2.setColumnData,
|
|
10205
|
+
setSelectedRows = _ref2.setSelectedRows;
|
|
10206
|
+
const isRolesButtonVisible = !!rolesButtonProps;
|
|
10207
|
+
const _useBulkUpdateMembers = useBulkUpdateMembers({
|
|
10208
|
+
onSuccess: () => setSelectedRows(DEFAULT_SELECTED_ROWS)
|
|
10209
|
+
}),
|
|
10210
|
+
bulkUpdateMember = _useBulkUpdateMembers.mutate;
|
|
10211
|
+
const handleDeactivateMembers = () => bulkUpdateMember({
|
|
10212
|
+
users: {
|
|
10213
|
+
active: false,
|
|
10214
|
+
emails: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.emails
|
|
10215
|
+
}
|
|
10216
|
+
});
|
|
10217
|
+
const handleActivateMembers = () => bulkUpdateMember({
|
|
10218
|
+
users: {
|
|
10219
|
+
active: true,
|
|
10220
|
+
emails: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.emails
|
|
10221
|
+
}
|
|
10222
|
+
});
|
|
10223
|
+
const handleRoleChange = role => {
|
|
10224
|
+
bulkUpdateMember({
|
|
10225
|
+
users: {
|
|
10226
|
+
active: true,
|
|
10227
|
+
emails: selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows.emails,
|
|
10228
|
+
organization_role: role
|
|
10229
|
+
}
|
|
10230
|
+
});
|
|
10231
|
+
};
|
|
10232
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, getDeactivatedButtonVisible(selectedRows) && /*#__PURE__*/React.createElement(Button, {
|
|
10233
|
+
"data-cy": "ntm-deactivate-members-button",
|
|
10234
|
+
label: instance.t("common.deactivate"),
|
|
10235
|
+
size: "small",
|
|
10236
|
+
style: "secondary",
|
|
10237
|
+
onClick: () => handleDeactivateMembers()
|
|
10238
|
+
}), getActivateButtonVisible(selectedRows) && /*#__PURE__*/React.createElement(Button, {
|
|
10239
|
+
"data-cy": "ntm-activate-members-button",
|
|
10240
|
+
label: instance.t("common.activate"),
|
|
10241
|
+
size: "small",
|
|
10242
|
+
style: "secondary",
|
|
10243
|
+
onClick: () => handleActivateMembers()
|
|
10244
|
+
}), isNotEmpty$1(selectedRows.keys) && /*#__PURE__*/React.createElement(RolesDropdown, {
|
|
10245
|
+
handleRoleChange: handleRoleChange,
|
|
10246
|
+
roles: roles
|
|
10247
|
+
}), /*#__PURE__*/React.createElement(Columns, {
|
|
10248
|
+
columnData: columns,
|
|
10249
|
+
dropdownProps: COLUMNS_DROPDOWN_PROPS,
|
|
10250
|
+
fixedColumns: FIXED_COLUMNS,
|
|
10251
|
+
localStorageKey: "NTM_MEMBERS_TABLE_HIDDEN_COLUMNS",
|
|
10252
|
+
noColumnMessage: instance.t("columns.noColumnsFound"),
|
|
10253
|
+
onChange: setColumnData,
|
|
10254
|
+
searchProps: COLUMNS_SEARCH_PROPS
|
|
10255
|
+
}), isRolesButtonVisible ? /*#__PURE__*/React.createElement(Button, _extends({
|
|
10256
|
+
"data-cy": "ntm-manage-roles-button",
|
|
10257
|
+
label: MANAGE_ROLES_BUTTON_LABEL,
|
|
10258
|
+
size: "small",
|
|
10259
|
+
style: "secondary"
|
|
10260
|
+
}, rolesButtonProps)) : null);
|
|
10261
|
+
};
|
|
10262
|
+
const SubHeader = {
|
|
10263
|
+
Left,
|
|
10264
|
+
Right
|
|
10265
|
+
};
|
|
10266
|
+
|
|
10267
|
+
function commonjsRequire(path) {
|
|
10268
|
+
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
10269
|
+
}
|
|
10270
|
+
|
|
10271
|
+
var pluralize$1 = {exports: {}};
|
|
10272
|
+
|
|
10273
|
+
/* global define */
|
|
10274
|
+
|
|
10275
|
+
(function (module, exports) {
|
|
10276
|
+
(function (root, pluralize) {
|
|
10277
|
+
/* istanbul ignore else */
|
|
10278
|
+
if (typeof commonjsRequire === 'function' && 'object' === 'object' && 'object' === 'object') {
|
|
10279
|
+
// Node.
|
|
10280
|
+
module.exports = pluralize();
|
|
10281
|
+
} else {
|
|
10282
|
+
// Browser global.
|
|
10283
|
+
root.pluralize = pluralize();
|
|
10284
|
+
}
|
|
10285
|
+
})(commonjsGlobal, function () {
|
|
10286
|
+
// Rule storage - pluralize and singularize need to be run sequentially,
|
|
10287
|
+
// while other rules can be optimized using an object for instant lookups.
|
|
10288
|
+
var pluralRules = [];
|
|
10289
|
+
var singularRules = [];
|
|
10290
|
+
var uncountables = {};
|
|
10291
|
+
var irregularPlurals = {};
|
|
10292
|
+
var irregularSingles = {};
|
|
10293
|
+
|
|
10294
|
+
/**
|
|
10295
|
+
* Sanitize a pluralization rule to a usable regular expression.
|
|
10296
|
+
*
|
|
10297
|
+
* @param {(RegExp|string)} rule
|
|
10298
|
+
* @return {RegExp}
|
|
10299
|
+
*/
|
|
10300
|
+
function sanitizeRule (rule) {
|
|
10301
|
+
if (typeof rule === 'string') {
|
|
10302
|
+
return new RegExp('^' + rule + '$', 'i');
|
|
10303
|
+
}
|
|
10304
|
+
|
|
10305
|
+
return rule;
|
|
10306
|
+
}
|
|
10307
|
+
|
|
10308
|
+
/**
|
|
10309
|
+
* Pass in a word token to produce a function that can replicate the case on
|
|
10310
|
+
* another word.
|
|
10311
|
+
*
|
|
10312
|
+
* @param {string} word
|
|
10313
|
+
* @param {string} token
|
|
10314
|
+
* @return {Function}
|
|
10315
|
+
*/
|
|
10316
|
+
function restoreCase (word, token) {
|
|
10317
|
+
// Tokens are an exact match.
|
|
10318
|
+
if (word === token) return token;
|
|
10319
|
+
|
|
10320
|
+
// Lower cased words. E.g. "hello".
|
|
10321
|
+
if (word === word.toLowerCase()) return token.toLowerCase();
|
|
10322
|
+
|
|
10323
|
+
// Upper cased words. E.g. "WHISKY".
|
|
10324
|
+
if (word === word.toUpperCase()) return token.toUpperCase();
|
|
10325
|
+
|
|
10326
|
+
// Title cased words. E.g. "Title".
|
|
10327
|
+
if (word[0] === word[0].toUpperCase()) {
|
|
10328
|
+
return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
|
|
10329
|
+
}
|
|
10330
|
+
|
|
10331
|
+
// Lower cased words. E.g. "test".
|
|
10332
|
+
return token.toLowerCase();
|
|
10333
|
+
}
|
|
10334
|
+
|
|
10335
|
+
/**
|
|
10336
|
+
* Interpolate a regexp string.
|
|
10337
|
+
*
|
|
10338
|
+
* @param {string} str
|
|
10339
|
+
* @param {Array} args
|
|
10340
|
+
* @return {string}
|
|
10341
|
+
*/
|
|
10342
|
+
function interpolate (str, args) {
|
|
10343
|
+
return str.replace(/\$(\d{1,2})/g, function (match, index) {
|
|
10344
|
+
return args[index] || '';
|
|
10345
|
+
});
|
|
10346
|
+
}
|
|
10347
|
+
|
|
10348
|
+
/**
|
|
10349
|
+
* Replace a word using a rule.
|
|
10350
|
+
*
|
|
10351
|
+
* @param {string} word
|
|
10352
|
+
* @param {Array} rule
|
|
10353
|
+
* @return {string}
|
|
10354
|
+
*/
|
|
10355
|
+
function replace (word, rule) {
|
|
10356
|
+
return word.replace(rule[0], function (match, index) {
|
|
10357
|
+
var result = interpolate(rule[1], arguments);
|
|
10358
|
+
|
|
10359
|
+
if (match === '') {
|
|
10360
|
+
return restoreCase(word[index - 1], result);
|
|
10361
|
+
}
|
|
10362
|
+
|
|
10363
|
+
return restoreCase(match, result);
|
|
10364
|
+
});
|
|
10365
|
+
}
|
|
10366
|
+
|
|
10367
|
+
/**
|
|
10368
|
+
* Sanitize a word by passing in the word and sanitization rules.
|
|
10369
|
+
*
|
|
10370
|
+
* @param {string} token
|
|
10371
|
+
* @param {string} word
|
|
10372
|
+
* @param {Array} rules
|
|
10373
|
+
* @return {string}
|
|
10374
|
+
*/
|
|
10375
|
+
function sanitizeWord (token, word, rules) {
|
|
10376
|
+
// Empty string or doesn't need fixing.
|
|
10377
|
+
if (!token.length || uncountables.hasOwnProperty(token)) {
|
|
10378
|
+
return word;
|
|
10379
|
+
}
|
|
10380
|
+
|
|
10381
|
+
var len = rules.length;
|
|
10382
|
+
|
|
10383
|
+
// Iterate over the sanitization rules and use the first one to match.
|
|
10384
|
+
while (len--) {
|
|
10385
|
+
var rule = rules[len];
|
|
10386
|
+
|
|
10387
|
+
if (rule[0].test(word)) return replace(word, rule);
|
|
10388
|
+
}
|
|
10389
|
+
|
|
10390
|
+
return word;
|
|
10391
|
+
}
|
|
10392
|
+
|
|
10393
|
+
/**
|
|
10394
|
+
* Replace a word with the updated word.
|
|
10395
|
+
*
|
|
10396
|
+
* @param {Object} replaceMap
|
|
10397
|
+
* @param {Object} keepMap
|
|
10398
|
+
* @param {Array} rules
|
|
10399
|
+
* @return {Function}
|
|
10400
|
+
*/
|
|
10401
|
+
function replaceWord (replaceMap, keepMap, rules) {
|
|
10402
|
+
return function (word) {
|
|
10403
|
+
// Get the correct token and case restoration functions.
|
|
10404
|
+
var token = word.toLowerCase();
|
|
10405
|
+
|
|
10406
|
+
// Check against the keep object map.
|
|
10407
|
+
if (keepMap.hasOwnProperty(token)) {
|
|
10408
|
+
return restoreCase(word, token);
|
|
10409
|
+
}
|
|
10410
|
+
|
|
10411
|
+
// Check against the replacement map for a direct word replacement.
|
|
10412
|
+
if (replaceMap.hasOwnProperty(token)) {
|
|
10413
|
+
return restoreCase(word, replaceMap[token]);
|
|
10414
|
+
}
|
|
10415
|
+
|
|
10416
|
+
// Run all the rules against the word.
|
|
10417
|
+
return sanitizeWord(token, word, rules);
|
|
10418
|
+
};
|
|
10419
|
+
}
|
|
10420
|
+
|
|
10421
|
+
/**
|
|
10422
|
+
* Check if a word is part of the map.
|
|
10423
|
+
*/
|
|
10424
|
+
function checkWord (replaceMap, keepMap, rules, bool) {
|
|
10425
|
+
return function (word) {
|
|
10426
|
+
var token = word.toLowerCase();
|
|
10427
|
+
|
|
10428
|
+
if (keepMap.hasOwnProperty(token)) return true;
|
|
10429
|
+
if (replaceMap.hasOwnProperty(token)) return false;
|
|
10430
|
+
|
|
10431
|
+
return sanitizeWord(token, token, rules) === token;
|
|
10432
|
+
};
|
|
10433
|
+
}
|
|
10434
|
+
|
|
10435
|
+
/**
|
|
10436
|
+
* Pluralize or singularize a word based on the passed in count.
|
|
10437
|
+
*
|
|
10438
|
+
* @param {string} word The word to pluralize
|
|
10439
|
+
* @param {number} count How many of the word exist
|
|
10440
|
+
* @param {boolean} inclusive Whether to prefix with the number (e.g. 3 ducks)
|
|
10441
|
+
* @return {string}
|
|
10442
|
+
*/
|
|
10443
|
+
function pluralize (word, count, inclusive) {
|
|
10444
|
+
var pluralized = count === 1
|
|
10445
|
+
? pluralize.singular(word) : pluralize.plural(word);
|
|
10446
|
+
|
|
10447
|
+
return (inclusive ? count + ' ' : '') + pluralized;
|
|
10448
|
+
}
|
|
10449
|
+
|
|
10450
|
+
/**
|
|
10451
|
+
* Pluralize a word.
|
|
10452
|
+
*
|
|
10453
|
+
* @type {Function}
|
|
10454
|
+
*/
|
|
10455
|
+
pluralize.plural = replaceWord(
|
|
10456
|
+
irregularSingles, irregularPlurals, pluralRules
|
|
10457
|
+
);
|
|
10458
|
+
|
|
10459
|
+
/**
|
|
10460
|
+
* Check if a word is plural.
|
|
10461
|
+
*
|
|
10462
|
+
* @type {Function}
|
|
10463
|
+
*/
|
|
10464
|
+
pluralize.isPlural = checkWord(
|
|
10465
|
+
irregularSingles, irregularPlurals, pluralRules
|
|
10466
|
+
);
|
|
10467
|
+
|
|
10468
|
+
/**
|
|
10469
|
+
* Singularize a word.
|
|
10470
|
+
*
|
|
10471
|
+
* @type {Function}
|
|
10472
|
+
*/
|
|
10473
|
+
pluralize.singular = replaceWord(
|
|
10474
|
+
irregularPlurals, irregularSingles, singularRules
|
|
10475
|
+
);
|
|
10476
|
+
|
|
10477
|
+
/**
|
|
10478
|
+
* Check if a word is singular.
|
|
10479
|
+
*
|
|
10480
|
+
* @type {Function}
|
|
10481
|
+
*/
|
|
10482
|
+
pluralize.isSingular = checkWord(
|
|
10483
|
+
irregularPlurals, irregularSingles, singularRules
|
|
10484
|
+
);
|
|
10485
|
+
|
|
10486
|
+
/**
|
|
10487
|
+
* Add a pluralization rule to the collection.
|
|
10488
|
+
*
|
|
10489
|
+
* @param {(string|RegExp)} rule
|
|
10490
|
+
* @param {string} replacement
|
|
10491
|
+
*/
|
|
10492
|
+
pluralize.addPluralRule = function (rule, replacement) {
|
|
10493
|
+
pluralRules.push([sanitizeRule(rule), replacement]);
|
|
10494
|
+
};
|
|
10495
|
+
|
|
10496
|
+
/**
|
|
10497
|
+
* Add a singularization rule to the collection.
|
|
10498
|
+
*
|
|
10499
|
+
* @param {(string|RegExp)} rule
|
|
10500
|
+
* @param {string} replacement
|
|
10501
|
+
*/
|
|
10502
|
+
pluralize.addSingularRule = function (rule, replacement) {
|
|
10503
|
+
singularRules.push([sanitizeRule(rule), replacement]);
|
|
10504
|
+
};
|
|
10505
|
+
|
|
10506
|
+
/**
|
|
10507
|
+
* Add an uncountable word rule.
|
|
10508
|
+
*
|
|
10509
|
+
* @param {(string|RegExp)} word
|
|
10510
|
+
*/
|
|
10511
|
+
pluralize.addUncountableRule = function (word) {
|
|
10512
|
+
if (typeof word === 'string') {
|
|
10513
|
+
uncountables[word.toLowerCase()] = true;
|
|
10514
|
+
return;
|
|
10515
|
+
}
|
|
10516
|
+
|
|
10517
|
+
// Set singular and plural references for the word.
|
|
10518
|
+
pluralize.addPluralRule(word, '$0');
|
|
10519
|
+
pluralize.addSingularRule(word, '$0');
|
|
10520
|
+
};
|
|
10521
|
+
|
|
10522
|
+
/**
|
|
10523
|
+
* Add an irregular word definition.
|
|
10524
|
+
*
|
|
10525
|
+
* @param {string} single
|
|
10526
|
+
* @param {string} plural
|
|
10527
|
+
*/
|
|
10528
|
+
pluralize.addIrregularRule = function (single, plural) {
|
|
10529
|
+
plural = plural.toLowerCase();
|
|
10530
|
+
single = single.toLowerCase();
|
|
10531
|
+
|
|
10532
|
+
irregularSingles[single] = plural;
|
|
10533
|
+
irregularPlurals[plural] = single;
|
|
10534
|
+
};
|
|
10535
|
+
|
|
10536
|
+
/**
|
|
10537
|
+
* Irregular rules.
|
|
10538
|
+
*/
|
|
10539
|
+
[
|
|
10540
|
+
// Pronouns.
|
|
10541
|
+
['I', 'we'],
|
|
10542
|
+
['me', 'us'],
|
|
10543
|
+
['he', 'they'],
|
|
10544
|
+
['she', 'they'],
|
|
10545
|
+
['them', 'them'],
|
|
10546
|
+
['myself', 'ourselves'],
|
|
10547
|
+
['yourself', 'yourselves'],
|
|
10548
|
+
['itself', 'themselves'],
|
|
10549
|
+
['herself', 'themselves'],
|
|
10550
|
+
['himself', 'themselves'],
|
|
10551
|
+
['themself', 'themselves'],
|
|
10552
|
+
['is', 'are'],
|
|
10553
|
+
['was', 'were'],
|
|
10554
|
+
['has', 'have'],
|
|
10555
|
+
['this', 'these'],
|
|
10556
|
+
['that', 'those'],
|
|
10557
|
+
// Words ending in with a consonant and `o`.
|
|
10558
|
+
['echo', 'echoes'],
|
|
10559
|
+
['dingo', 'dingoes'],
|
|
10560
|
+
['volcano', 'volcanoes'],
|
|
10561
|
+
['tornado', 'tornadoes'],
|
|
10562
|
+
['torpedo', 'torpedoes'],
|
|
10563
|
+
// Ends with `us`.
|
|
10564
|
+
['genus', 'genera'],
|
|
10565
|
+
['viscus', 'viscera'],
|
|
10566
|
+
// Ends with `ma`.
|
|
10567
|
+
['stigma', 'stigmata'],
|
|
10568
|
+
['stoma', 'stomata'],
|
|
10569
|
+
['dogma', 'dogmata'],
|
|
10570
|
+
['lemma', 'lemmata'],
|
|
10571
|
+
['schema', 'schemata'],
|
|
10572
|
+
['anathema', 'anathemata'],
|
|
10573
|
+
// Other irregular rules.
|
|
10574
|
+
['ox', 'oxen'],
|
|
10575
|
+
['axe', 'axes'],
|
|
10576
|
+
['die', 'dice'],
|
|
10577
|
+
['yes', 'yeses'],
|
|
10578
|
+
['foot', 'feet'],
|
|
10579
|
+
['eave', 'eaves'],
|
|
10580
|
+
['goose', 'geese'],
|
|
10581
|
+
['tooth', 'teeth'],
|
|
10582
|
+
['quiz', 'quizzes'],
|
|
10583
|
+
['human', 'humans'],
|
|
10584
|
+
['proof', 'proofs'],
|
|
10585
|
+
['carve', 'carves'],
|
|
10586
|
+
['valve', 'valves'],
|
|
10587
|
+
['looey', 'looies'],
|
|
10588
|
+
['thief', 'thieves'],
|
|
10589
|
+
['groove', 'grooves'],
|
|
10590
|
+
['pickaxe', 'pickaxes'],
|
|
10591
|
+
['passerby', 'passersby']
|
|
10592
|
+
].forEach(function (rule) {
|
|
10593
|
+
return pluralize.addIrregularRule(rule[0], rule[1]);
|
|
10594
|
+
});
|
|
10595
|
+
|
|
10596
|
+
/**
|
|
10597
|
+
* Pluralization rules.
|
|
10598
|
+
*/
|
|
10599
|
+
[
|
|
10600
|
+
[/s?$/i, 's'],
|
|
10601
|
+
[/[^\u0000-\u007F]$/i, '$0'],
|
|
10602
|
+
[/([^aeiou]ese)$/i, '$1'],
|
|
10603
|
+
[/(ax|test)is$/i, '$1es'],
|
|
10604
|
+
[/(alias|[^aou]us|t[lm]as|gas|ris)$/i, '$1es'],
|
|
10605
|
+
[/(e[mn]u)s?$/i, '$1s'],
|
|
10606
|
+
[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, '$1'],
|
|
10607
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1i'],
|
|
10608
|
+
[/(alumn|alg|vertebr)(?:a|ae)$/i, '$1ae'],
|
|
10609
|
+
[/(seraph|cherub)(?:im)?$/i, '$1im'],
|
|
10610
|
+
[/(her|at|gr)o$/i, '$1oes'],
|
|
10611
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, '$1a'],
|
|
10612
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, '$1a'],
|
|
10613
|
+
[/sis$/i, 'ses'],
|
|
10614
|
+
[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, '$1$2ves'],
|
|
10615
|
+
[/([^aeiouy]|qu)y$/i, '$1ies'],
|
|
10616
|
+
[/([^ch][ieo][ln])ey$/i, '$1ies'],
|
|
10617
|
+
[/(x|ch|ss|sh|zz)$/i, '$1es'],
|
|
10618
|
+
[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, '$1ices'],
|
|
10619
|
+
[/\b((?:tit)?m|l)(?:ice|ouse)$/i, '$1ice'],
|
|
10620
|
+
[/(pe)(?:rson|ople)$/i, '$1ople'],
|
|
10621
|
+
[/(child)(?:ren)?$/i, '$1ren'],
|
|
10622
|
+
[/eaux$/i, '$0'],
|
|
10623
|
+
[/m[ae]n$/i, 'men'],
|
|
10624
|
+
['thou', 'you']
|
|
10625
|
+
].forEach(function (rule) {
|
|
10626
|
+
return pluralize.addPluralRule(rule[0], rule[1]);
|
|
10627
|
+
});
|
|
10628
|
+
|
|
10629
|
+
/**
|
|
10630
|
+
* Singularization rules.
|
|
10631
|
+
*/
|
|
10632
|
+
[
|
|
10633
|
+
[/s$/i, ''],
|
|
10634
|
+
[/(ss)$/i, '$1'],
|
|
10635
|
+
[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, '$1fe'],
|
|
10636
|
+
[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, '$1f'],
|
|
10637
|
+
[/ies$/i, 'y'],
|
|
10638
|
+
[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, '$1ie'],
|
|
10639
|
+
[/\b(mon|smil)ies$/i, '$1ey'],
|
|
10640
|
+
[/\b((?:tit)?m|l)ice$/i, '$1ouse'],
|
|
10641
|
+
[/(seraph|cherub)im$/i, '$1'],
|
|
10642
|
+
[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, '$1'],
|
|
10643
|
+
[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, '$1sis'],
|
|
10644
|
+
[/(movie|twelve|abuse|e[mn]u)s$/i, '$1'],
|
|
10645
|
+
[/(test)(?:is|es)$/i, '$1is'],
|
|
10646
|
+
[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, '$1us'],
|
|
10647
|
+
[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, '$1um'],
|
|
10648
|
+
[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, '$1on'],
|
|
10649
|
+
[/(alumn|alg|vertebr)ae$/i, '$1a'],
|
|
10650
|
+
[/(cod|mur|sil|vert|ind)ices$/i, '$1ex'],
|
|
10651
|
+
[/(matr|append)ices$/i, '$1ix'],
|
|
10652
|
+
[/(pe)(rson|ople)$/i, '$1rson'],
|
|
10653
|
+
[/(child)ren$/i, '$1'],
|
|
10654
|
+
[/(eau)x?$/i, '$1'],
|
|
10655
|
+
[/men$/i, 'man']
|
|
10656
|
+
].forEach(function (rule) {
|
|
10657
|
+
return pluralize.addSingularRule(rule[0], rule[1]);
|
|
10658
|
+
});
|
|
10659
|
+
|
|
10660
|
+
/**
|
|
10661
|
+
* Uncountable rules.
|
|
10662
|
+
*/
|
|
10663
|
+
[
|
|
10664
|
+
// Singular words with no plurals.
|
|
10665
|
+
'adulthood',
|
|
10666
|
+
'advice',
|
|
10667
|
+
'agenda',
|
|
10668
|
+
'aid',
|
|
10669
|
+
'aircraft',
|
|
10670
|
+
'alcohol',
|
|
10671
|
+
'ammo',
|
|
10672
|
+
'analytics',
|
|
10673
|
+
'anime',
|
|
10674
|
+
'athletics',
|
|
10675
|
+
'audio',
|
|
10676
|
+
'bison',
|
|
10677
|
+
'blood',
|
|
10678
|
+
'bream',
|
|
10679
|
+
'buffalo',
|
|
10680
|
+
'butter',
|
|
10681
|
+
'carp',
|
|
10682
|
+
'cash',
|
|
10683
|
+
'chassis',
|
|
10684
|
+
'chess',
|
|
10685
|
+
'clothing',
|
|
10686
|
+
'cod',
|
|
10687
|
+
'commerce',
|
|
10688
|
+
'cooperation',
|
|
10689
|
+
'corps',
|
|
10690
|
+
'debris',
|
|
10691
|
+
'diabetes',
|
|
10692
|
+
'digestion',
|
|
10693
|
+
'elk',
|
|
10694
|
+
'energy',
|
|
10695
|
+
'equipment',
|
|
10696
|
+
'excretion',
|
|
10697
|
+
'expertise',
|
|
10698
|
+
'firmware',
|
|
10699
|
+
'flounder',
|
|
10700
|
+
'fun',
|
|
10701
|
+
'gallows',
|
|
10702
|
+
'garbage',
|
|
10703
|
+
'graffiti',
|
|
10704
|
+
'hardware',
|
|
10705
|
+
'headquarters',
|
|
10706
|
+
'health',
|
|
10707
|
+
'herpes',
|
|
10708
|
+
'highjinks',
|
|
10709
|
+
'homework',
|
|
10710
|
+
'housework',
|
|
10711
|
+
'information',
|
|
10712
|
+
'jeans',
|
|
10713
|
+
'justice',
|
|
10714
|
+
'kudos',
|
|
10715
|
+
'labour',
|
|
10716
|
+
'literature',
|
|
10717
|
+
'machinery',
|
|
10718
|
+
'mackerel',
|
|
10719
|
+
'mail',
|
|
10720
|
+
'media',
|
|
10721
|
+
'mews',
|
|
10722
|
+
'moose',
|
|
10723
|
+
'music',
|
|
10724
|
+
'mud',
|
|
10725
|
+
'manga',
|
|
10726
|
+
'news',
|
|
10727
|
+
'only',
|
|
10728
|
+
'personnel',
|
|
10729
|
+
'pike',
|
|
10730
|
+
'plankton',
|
|
10731
|
+
'pliers',
|
|
10732
|
+
'police',
|
|
10733
|
+
'pollution',
|
|
10734
|
+
'premises',
|
|
10735
|
+
'rain',
|
|
10736
|
+
'research',
|
|
10737
|
+
'rice',
|
|
10738
|
+
'salmon',
|
|
10739
|
+
'scissors',
|
|
10740
|
+
'series',
|
|
10741
|
+
'sewage',
|
|
10742
|
+
'shambles',
|
|
10743
|
+
'shrimp',
|
|
10744
|
+
'software',
|
|
10745
|
+
'species',
|
|
10746
|
+
'staff',
|
|
10747
|
+
'swine',
|
|
10748
|
+
'tennis',
|
|
10749
|
+
'traffic',
|
|
10750
|
+
'transportation',
|
|
10751
|
+
'trout',
|
|
10752
|
+
'tuna',
|
|
10753
|
+
'wealth',
|
|
10754
|
+
'welfare',
|
|
10755
|
+
'whiting',
|
|
10756
|
+
'wildebeest',
|
|
10757
|
+
'wildlife',
|
|
10758
|
+
'you',
|
|
10759
|
+
/pok[eé]mon$/i,
|
|
10760
|
+
// Regexes.
|
|
10761
|
+
/[^aeiou]ese$/i, // "chinese", "japanese"
|
|
10762
|
+
/deer$/i, // "deer", "reindeer"
|
|
10763
|
+
/fish$/i, // "fish", "blowfish", "angelfish"
|
|
10764
|
+
/measles$/i,
|
|
10765
|
+
/o[iu]s$/i, // "carnivorous"
|
|
10766
|
+
/pox$/i, // "chickpox", "smallpox"
|
|
10767
|
+
/sheep$/i
|
|
10768
|
+
].forEach(pluralize.addUncountableRule);
|
|
10769
|
+
|
|
10770
|
+
return pluralize;
|
|
10771
|
+
});
|
|
10772
|
+
} (pluralize$1));
|
|
10773
|
+
|
|
10774
|
+
var pluralize = pluralize$1.exports;
|
|
10775
|
+
|
|
10776
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10777
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
9889
10778
|
const renderNameColumn = (_ref, diplayStatusTag) => {
|
|
9890
10779
|
let displayName = _ref.displayName,
|
|
9891
10780
|
imageUrl = _ref.profileImageUrl,
|
|
@@ -9958,19 +10847,19 @@ const getDefaultAlertTitle = _ref3 => {
|
|
|
9958
10847
|
let member = _ref3.member,
|
|
9959
10848
|
metaName = _ref3.metaName;
|
|
9960
10849
|
return member !== null && member !== void 0 && member.active ? instance.t("common.deactivate_", {
|
|
9961
|
-
what:
|
|
10850
|
+
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
9962
10851
|
}) : instance.t("common.activate_", {
|
|
9963
|
-
what:
|
|
10852
|
+
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
9964
10853
|
});
|
|
9965
10854
|
};
|
|
9966
10855
|
const getDefaultAlertMessage = _ref4 => {
|
|
9967
10856
|
let member = _ref4.member,
|
|
9968
10857
|
metaName = _ref4.metaName;
|
|
9969
10858
|
return member !== null && member !== void 0 && member.active ? instance.t("alerts.deactivating_", {
|
|
9970
|
-
what:
|
|
10859
|
+
what: metaName(SINGULAR).toLocaleLowerCase(),
|
|
9971
10860
|
person: member === null || member === void 0 ? void 0 : member.name
|
|
9972
10861
|
}) : instance.t("alerts.activating_", {
|
|
9973
|
-
what:
|
|
10862
|
+
what: metaName(SINGULAR).toLocaleLowerCase(),
|
|
9974
10863
|
person: member === null || member === void 0 ? void 0 : member.name
|
|
9975
10864
|
});
|
|
9976
10865
|
};
|
|
@@ -10007,7 +10896,7 @@ const getColumnData = _ref5 => {
|
|
|
10007
10896
|
}];
|
|
10008
10897
|
};
|
|
10009
10898
|
const renderHeaderTitle = (filterStatus, metaName) => instance.t(`common.${toLower(filterStatus)}_`, {
|
|
10010
|
-
what:
|
|
10899
|
+
what: metaName(PLURAL).toLocaleLowerCase()
|
|
10011
10900
|
});
|
|
10012
10901
|
const renderUpdateAlert = (field, props) => {
|
|
10013
10902
|
var _config$alert;
|
|
@@ -10023,7 +10912,7 @@ const renderUpdateAlert = (field, props) => {
|
|
|
10023
10912
|
}
|
|
10024
10913
|
return field === "title" ? getDefaultAlertTitle(props) : getDefaultAlertMessage(props);
|
|
10025
10914
|
};
|
|
10026
|
-
const getSearchParams = (page, filter) => new URLSearchParams(_objectSpread$
|
|
10915
|
+
const getSearchParams = (page, filter) => new URLSearchParams(_objectSpread$2(_objectSpread$2({}, page), {}, {
|
|
10027
10916
|
filter: filter.toLowerCase()
|
|
10028
10917
|
})).toString();
|
|
10029
10918
|
const handlePageChange = (setFilters, filter) => (page, results) => {
|
|
@@ -10038,11 +10927,21 @@ const renderPaginationProps = size => ({
|
|
|
10038
10927
|
pageSize: parseInt(size, DEFAULT_RADIX)
|
|
10039
10928
|
});
|
|
10040
10929
|
const getPerCategoryCount = (perCategoryCount, category) => isNil(perCategoryCount) ? MEMBER_FILTER[category].defaultCount : perCategoryCount[category === null || category === void 0 ? void 0 : category.toLowerCase()];
|
|
10930
|
+
const getMetaName = curry((metaName, count) => {
|
|
10931
|
+
const singularizedMetaName = pluralize(metaName.toLowerCase(), 1);
|
|
10932
|
+
const translationWord = `metaNames.${singularizedMetaName}`;
|
|
10933
|
+
return instance.exists(translationWord, count) ? instance.t(translationWord, count) : pluralize(capitalize(singularizedMetaName), count.count);
|
|
10934
|
+
});
|
|
10041
10935
|
|
|
10042
|
-
|
|
10043
|
-
|
|
10936
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10937
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10938
|
+
const MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA = {
|
|
10939
|
+
emails: yup.array().min(1, instance.t("validations.minOneEmail")).test("are-all-emails-valid", instance.t("validations.validEmail"), emails => emails.every(prop("valid"))).nullable()
|
|
10940
|
+
};
|
|
10941
|
+
const ROLES_RADIO_GROUP_VALIDATION_SCHEMA = {
|
|
10044
10942
|
role: yup.string().required(instance.t("validations.roleRequired"))
|
|
10045
|
-
}
|
|
10943
|
+
};
|
|
10944
|
+
const VALIDATION_SCHEMA$1 = yup.object().shape(_objectSpread$1(_objectSpread$1({}, MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA), ROLES_RADIO_GROUP_VALIDATION_SCHEMA));
|
|
10046
10945
|
const FILTER_INVALID_EMAILS = {
|
|
10047
10946
|
label: instance.t("validations.filterInvalidEmails")
|
|
10048
10947
|
};
|
|
@@ -10077,6 +10976,70 @@ const renderPayload = function (_ref) {
|
|
|
10077
10976
|
};
|
|
10078
10977
|
};
|
|
10079
10978
|
|
|
10979
|
+
const MultipleEmailInput = _ref => {
|
|
10980
|
+
var _head;
|
|
10981
|
+
let emails = _ref.emails,
|
|
10982
|
+
selectedMember = _ref.selectedMember;
|
|
10983
|
+
return selectedMember ? /*#__PURE__*/React.createElement(Input, {
|
|
10984
|
+
disabled: true,
|
|
10985
|
+
"data-cy": "ntm-manage-member-email-input",
|
|
10986
|
+
label: instance.t("common.email", SINGULAR),
|
|
10987
|
+
name: "emails",
|
|
10988
|
+
size: "medium",
|
|
10989
|
+
value: (_head = head(emails)) === null || _head === void 0 ? void 0 : _head.value
|
|
10990
|
+
}) : /*#__PURE__*/React.createElement(EmailInput, {
|
|
10991
|
+
counter: COUNTER_PROPS,
|
|
10992
|
+
"data-cy": "ntm-manage-member-email-input",
|
|
10993
|
+
filterInvalidEmails: FILTER_INVALID_EMAILS,
|
|
10994
|
+
helpText: instance.t("helpers.enterMultipleEmails"),
|
|
10995
|
+
label: `${instance.t("common.email", PLURAL)}*`,
|
|
10996
|
+
name: "emails",
|
|
10997
|
+
placeholder: instance.t("placeholders.email")
|
|
10998
|
+
});
|
|
10999
|
+
};
|
|
11000
|
+
MultipleEmailInput.defaultProps = {
|
|
11001
|
+
emails: [],
|
|
11002
|
+
selectedMember: null
|
|
11003
|
+
};
|
|
11004
|
+
|
|
11005
|
+
const RolesRadioGroup = _ref => {
|
|
11006
|
+
let role = _ref.role,
|
|
11007
|
+
roles = _ref.roles;
|
|
11008
|
+
return /*#__PURE__*/React.createElement(Radio, {
|
|
11009
|
+
stacked: true,
|
|
11010
|
+
className: "ntm-members-radio-group",
|
|
11011
|
+
"data-cy": "ntm-manage-member-roles-group",
|
|
11012
|
+
label: `${instance.t("common.role", SINGULAR)}*`,
|
|
11013
|
+
name: "role"
|
|
11014
|
+
}, roles.map(_ref2 => {
|
|
11015
|
+
let description = _ref2.description,
|
|
11016
|
+
id = _ref2.id,
|
|
11017
|
+
name = _ref2.name;
|
|
11018
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
11019
|
+
className: "ntm-members-pane-radio-item__wrapper",
|
|
11020
|
+
htmlFor: slugify(name),
|
|
11021
|
+
key: id
|
|
11022
|
+
}, /*#__PURE__*/React.createElement(Radio.Item, {
|
|
11023
|
+
className: "ntm-members-pane-radio-item__label",
|
|
11024
|
+
"data-cy": "ntm-manage-member-roles-button",
|
|
11025
|
+
defaultChecked: identical(name, role),
|
|
11026
|
+
id: slugify(name),
|
|
11027
|
+
label: name,
|
|
11028
|
+
name: "role",
|
|
11029
|
+
value: name
|
|
11030
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
11031
|
+
className: "neeto-ui-input__help-text",
|
|
11032
|
+
"data-cy": "ntm-manage-member-roles-description",
|
|
11033
|
+
style: "body3",
|
|
11034
|
+
weight: "normal"
|
|
11035
|
+
}, description));
|
|
11036
|
+
}));
|
|
11037
|
+
};
|
|
11038
|
+
RolesRadioGroup.defaultProps = {
|
|
11039
|
+
role: "",
|
|
11040
|
+
roles: []
|
|
11041
|
+
};
|
|
11042
|
+
|
|
10080
11043
|
const ManageMember = _ref => {
|
|
10081
11044
|
var _config$manageMember;
|
|
10082
11045
|
let config = _ref.config,
|
|
@@ -10133,16 +11096,16 @@ const ManageMember = _ref => {
|
|
|
10133
11096
|
style: "h2",
|
|
10134
11097
|
weight: "semibold"
|
|
10135
11098
|
}, selectedMember ? instance.t("common.edit_", {
|
|
10136
|
-
what:
|
|
11099
|
+
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
10137
11100
|
}) : instance.t("common.add_", {
|
|
10138
|
-
what:
|
|
11101
|
+
what: metaName(SINGULAR).toLocaleLowerCase()
|
|
10139
11102
|
}))), config !== null && config !== void 0 && (_config$manageMember = config.manageMember) !== null && _config$manageMember !== void 0 && _config$manageMember.component ? config.manageMember.component(manageMemberProps) : /*#__PURE__*/React.createElement(Formik, {
|
|
10140
11103
|
enableReinitialize: true,
|
|
10141
11104
|
initialValues: renderInitialValues(selectedMember, roles),
|
|
10142
11105
|
onSubmit: handleAddMember,
|
|
10143
11106
|
validateOnBlur: hasSubmitted,
|
|
10144
11107
|
validateOnChange: hasSubmitted,
|
|
10145
|
-
validationSchema: VALIDATION_SCHEMA
|
|
11108
|
+
validationSchema: VALIDATION_SCHEMA$1
|
|
10146
11109
|
}, _ref2 => {
|
|
10147
11110
|
let values = _ref2.values,
|
|
10148
11111
|
dirty = _ref2.dirty;
|
|
@@ -10154,51 +11117,13 @@ const ManageMember = _ref => {
|
|
|
10154
11117
|
formRef: formReference
|
|
10155
11118
|
}), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
|
|
10156
11119
|
className: "ntm-members-pane__body"
|
|
10157
|
-
},
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
}) : /*#__PURE__*/React.createElement(EmailInput, {
|
|
10165
|
-
counter: COUNTER_PROPS,
|
|
10166
|
-
"data-cy": "ntm-manage-member-email-input",
|
|
10167
|
-
disabled: selectedMember,
|
|
10168
|
-
filterInvalidEmails: FILTER_INVALID_EMAILS,
|
|
10169
|
-
helpText: instance.t("helpers.enterMultipleEmails"),
|
|
10170
|
-
label: `${instance.t("common.email", PLURAL)}*`,
|
|
10171
|
-
name: "emails",
|
|
10172
|
-
placeholder: instance.t("placeholders.email")
|
|
10173
|
-
}), /*#__PURE__*/React.createElement(Radio, {
|
|
10174
|
-
stacked: true,
|
|
10175
|
-
className: "ntm-members-radio-group",
|
|
10176
|
-
"data-cy": "ntm-manage-member-roles-group",
|
|
10177
|
-
label: `${instance.t("common.role", SINGULAR)}*`,
|
|
10178
|
-
name: "role"
|
|
10179
|
-
}, roles.map(_ref3 => {
|
|
10180
|
-
let description = _ref3.description,
|
|
10181
|
-
id = _ref3.id,
|
|
10182
|
-
name = _ref3.name;
|
|
10183
|
-
return /*#__PURE__*/React.createElement("label", {
|
|
10184
|
-
className: "ntm-members-pane-radio-item__wrapper",
|
|
10185
|
-
htmlFor: slugify(name),
|
|
10186
|
-
key: id
|
|
10187
|
-
}, /*#__PURE__*/React.createElement(Radio.Item, {
|
|
10188
|
-
className: "ntm-members-pane-radio-item__label",
|
|
10189
|
-
"data-cy": "ntm-manage-member-roles-button",
|
|
10190
|
-
defaultChecked: identical(name, role),
|
|
10191
|
-
id: slugify(name),
|
|
10192
|
-
label: name,
|
|
10193
|
-
name: "role",
|
|
10194
|
-
value: name
|
|
10195
|
-
}), /*#__PURE__*/React.createElement(Typography, {
|
|
10196
|
-
className: "neeto-ui-input__help-text",
|
|
10197
|
-
"data-cy": "ntm-manage-member-roles-description",
|
|
10198
|
-
style: "body3",
|
|
10199
|
-
weight: "normal"
|
|
10200
|
-
}, description));
|
|
10201
|
-
})))), /*#__PURE__*/React.createElement(Pane.Footer, {
|
|
11120
|
+
}, /*#__PURE__*/React.createElement(MultipleEmailInput, {
|
|
11121
|
+
emails: emails,
|
|
11122
|
+
selectedMember: selectedMember
|
|
11123
|
+
}), /*#__PURE__*/React.createElement(RolesRadioGroup, {
|
|
11124
|
+
role: role,
|
|
11125
|
+
roles: roles
|
|
11126
|
+
}))), /*#__PURE__*/React.createElement(Pane.Footer, {
|
|
10202
11127
|
className: "ntm-members-pane__footer"
|
|
10203
11128
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
10204
11129
|
"data-cy": "ntm-manage-member-submit-button",
|
|
@@ -10227,7 +11152,7 @@ const Menu = _ref => {
|
|
|
10227
11152
|
return /*#__PURE__*/React.createElement(MenuBar, {
|
|
10228
11153
|
"data-cy": "ntm-members-menubar-heading",
|
|
10229
11154
|
showMenu: isMenuOpen,
|
|
10230
|
-
title:
|
|
11155
|
+
title: metaName(PLURAL)
|
|
10231
11156
|
}, memberFilterKeys.map(filter => /*#__PURE__*/React.createElement(MenuBar.Block, {
|
|
10232
11157
|
active: memberFilterKeys.includes(memberFilter) && identical(filter, memberFilter),
|
|
10233
11158
|
count: getPerCategoryCount(filterCounts, filter),
|
|
@@ -10241,9 +11166,9 @@ const Menu = _ref => {
|
|
|
10241
11166
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10242
11167
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10243
11168
|
const TeamMembers = _ref => {
|
|
10244
|
-
var _config$permissions$v, _config$permissions, _config$permissions$v2, _config$permissions2;
|
|
10245
|
-
let
|
|
10246
|
-
|
|
11169
|
+
var _config$permissions$v, _config$permissions, _config$permissions$v2, _config$permissions2, _filters$category;
|
|
11170
|
+
let config = _ref.config;
|
|
11171
|
+
const metaName = getMetaName((config === null || config === void 0 ? void 0 : config.metaName) || "member");
|
|
10247
11172
|
const _useState = useState(DEFAULT_IS_OPEN_VALUES),
|
|
10248
11173
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10249
11174
|
isOpen = _useState2[0],
|
|
@@ -10261,6 +11186,10 @@ const TeamMembers = _ref => {
|
|
|
10261
11186
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
10262
11187
|
columnData = _useState8[0],
|
|
10263
11188
|
setColumnData = _useState8[1];
|
|
11189
|
+
const _useState9 = useState(DEFAULT_SELECTED_ROWS),
|
|
11190
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11191
|
+
selectedRows = _useState10[0],
|
|
11192
|
+
setSelectedRows = _useState10[1];
|
|
10264
11193
|
const _useFetchMembers = useFetchMembers(_objectSpread(_objectSpread({}, filters), {}, {
|
|
10265
11194
|
search: debouncedSearch.trim(),
|
|
10266
11195
|
category: filters.category.toLowerCase()
|
|
@@ -10284,6 +11213,7 @@ const TeamMembers = _ref => {
|
|
|
10284
11213
|
}),
|
|
10285
11214
|
updateMember = _useUpdateMember.mutate,
|
|
10286
11215
|
isUpdatingMember = _useUpdateMember.isLoading;
|
|
11216
|
+
const currentCategoryCount = team === null || team === void 0 ? void 0 : team.perCategoryCount[filters === null || filters === void 0 ? void 0 : (_filters$category = filters.category) === null || _filters$category === void 0 ? void 0 : _filters$category.toLowerCase()];
|
|
10287
11217
|
const searchProps = {
|
|
10288
11218
|
"data-cy": "ntm-search-members-input",
|
|
10289
11219
|
onChange: _ref3 => {
|
|
@@ -10294,7 +11224,7 @@ const TeamMembers = _ref => {
|
|
|
10294
11224
|
}));
|
|
10295
11225
|
},
|
|
10296
11226
|
placeholder: instance.t("common.search_", {
|
|
10297
|
-
what:
|
|
11227
|
+
what: metaName(PLURAL).toLocaleLowerCase()
|
|
10298
11228
|
}),
|
|
10299
11229
|
value: filters.search
|
|
10300
11230
|
};
|
|
@@ -10348,6 +11278,13 @@ const TeamMembers = _ref => {
|
|
|
10348
11278
|
sort_direction: sorter.order
|
|
10349
11279
|
}));
|
|
10350
11280
|
};
|
|
11281
|
+
const handleRowSelect = (keys, rowData) => {
|
|
11282
|
+
setSelectedRows({
|
|
11283
|
+
active: pluck("active", rowData),
|
|
11284
|
+
emails: pluck("email", rowData),
|
|
11285
|
+
keys
|
|
11286
|
+
});
|
|
11287
|
+
};
|
|
10351
11288
|
if (isRolesLoading || isMembersLoading) {
|
|
10352
11289
|
return /*#__PURE__*/React.createElement("div", {
|
|
10353
11290
|
className: "ntm-members-page-loader"
|
|
@@ -10376,18 +11313,24 @@ const TeamMembers = _ref => {
|
|
|
10376
11313
|
})
|
|
10377
11314
|
}), /*#__PURE__*/React.createElement(SubHeader$1, {
|
|
10378
11315
|
leftActionBlock: /*#__PURE__*/React.createElement(SubHeader.Left, {
|
|
11316
|
+
filteredCount: team === null || team === void 0 ? void 0 : team.membersCount,
|
|
10379
11317
|
metaName: metaName,
|
|
10380
|
-
|
|
11318
|
+
selectedRows: selectedRows,
|
|
11319
|
+
totalCount: currentCategoryCount
|
|
10381
11320
|
}),
|
|
10382
11321
|
rightActionBlock: /*#__PURE__*/React.createElement(SubHeader.Right, {
|
|
10383
11322
|
columns: columns,
|
|
11323
|
+
roles: roles,
|
|
10384
11324
|
rolesButtonProps: config.rolesButtonProps,
|
|
10385
|
-
|
|
11325
|
+
selectedRows: selectedRows,
|
|
11326
|
+
setColumnData: setColumnData,
|
|
11327
|
+
setSelectedRows: setSelectedRows
|
|
10386
11328
|
})
|
|
10387
11329
|
}), (team === null || team === void 0 ? void 0 : team.membersCount) !== 0 ? /*#__PURE__*/React.createElement("div", {
|
|
10388
11330
|
className: "ntm-members__table-wrapper"
|
|
10389
11331
|
}, /*#__PURE__*/React.createElement(Table$1, {
|
|
10390
11332
|
fixedHeight: true,
|
|
11333
|
+
rowSelection: true,
|
|
10391
11334
|
allowRowClick: false,
|
|
10392
11335
|
columnData: columnData,
|
|
10393
11336
|
currentPageNumber: parseInt(filters.page, DEFAULT_RADIX),
|
|
@@ -10395,14 +11338,15 @@ const TeamMembers = _ref => {
|
|
|
10395
11338
|
defaultPageSize: parseInt(filters.results, DEFAULT_RADIX),
|
|
10396
11339
|
handlePageChange: handlePageChange(setFilters, filters.category),
|
|
10397
11340
|
loading: isMembersFetching,
|
|
10398
|
-
onChange:
|
|
11341
|
+
onChange: handleTableChange,
|
|
11342
|
+
onRowSelect: handleRowSelect,
|
|
10399
11343
|
paginationProps: renderPaginationProps(filters.results),
|
|
10400
11344
|
rowData: team === null || team === void 0 ? void 0 : team.members,
|
|
10401
|
-
|
|
11345
|
+
selectedRowKeys: selectedRows.keys,
|
|
10402
11346
|
totalCount: team === null || team === void 0 ? void 0 : team.membersCount
|
|
10403
11347
|
})) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
10404
11348
|
title: instance.t("common.notFound_", {
|
|
10405
|
-
what:
|
|
11349
|
+
what: metaName(PLURAL).toLocaleLowerCase()
|
|
10406
11350
|
}),
|
|
10407
11351
|
actionBlock: /*#__PURE__*/React.createElement(Header, {
|
|
10408
11352
|
metaName: metaName,
|
|
@@ -10427,8 +11371,8 @@ const TeamMembers = _ref => {
|
|
|
10427
11371
|
})));
|
|
10428
11372
|
};
|
|
10429
11373
|
TeamMembers.defaultProps = {
|
|
10430
|
-
metaName: "metaNames.member",
|
|
10431
11374
|
config: {
|
|
11375
|
+
metaName: "member",
|
|
10432
11376
|
permissions: {
|
|
10433
11377
|
create: true,
|
|
10434
11378
|
update: true,
|
|
@@ -10438,10 +11382,15 @@ TeamMembers.defaultProps = {
|
|
|
10438
11382
|
};
|
|
10439
11383
|
var index = withReactQuery(TeamMembers);
|
|
10440
11384
|
|
|
11385
|
+
const VALIDATION_SCHEMA = {
|
|
11386
|
+
MULTIPLE_EMAIL_INPUT: MULTIPLE_EMAIL_INPUT_VALIDATION_SCHEMA,
|
|
11387
|
+
ROLES_RADIO_GROUP: ROLES_RADIO_GROUP_VALIDATION_SCHEMA
|
|
11388
|
+
};
|
|
11389
|
+
|
|
10441
11390
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
10442
11391
|
|
|
10443
11392
|
var css = ":root {\n --ntm-roles-table-default-scroll: 15px;\n}\n\n.ntm-dropdown__button {\n border-radius: 0 !important;\n font-weight: var(--neeto-ui-font-normal);\n min-height: 34px;\n min-width: 150px;\n text-align: left;\n width: 100%;\n}\n\n.ntm-scrollbar__inner {\n width: 100%;\n height: 200px;\n}\n.ntm-scrollbar__outer {\n position: \"absolute\";\n top: 0px;\n left: 0px;\n width: 200px;\n height: 150px;\n overflow: \"hidden\";\n visibility: \"hidden\";\n}\n\n.ntm-empty-state {\n align-items: center;\n display: flex;\n height: 100%;\n justify-content: center;\n width: 100%;\n}\n.ntm-empty-state__image {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 2rem;\n}\n.ntm-empty-state__title--with-action-block {\n margin-bottom: 1rem;\n}\n.ntm-empty-state__action-block {\n display: flex;\n justify-content: center;\n}\n\n.ntm-members {\n overflow: auto;\n width: 100%;\n}\n.ntm-members-wrapper {\n display: flex;\n}\n.ntm-members-page-loader {\n width: 100%;\n height: 100vh;\n}\n.ntm-members__table-wrapper {\n height: calc(100vh - 205px);\n width: 100%;\n}\n.ntm-members-table__column {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n.ntm-members-pane__header {\n margin-bottom: 0.5rem;\n}\n.ntm-members-pane__body {\n width: 100%;\n padding-bottom: 1rem;\n}\n.ntm-members-pane__body > * + * {\n margin-top: 1rem;\n}\n.ntm-members-pane__footer {\n display: flex;\n gap: 0.5rem;\n}\n\n.ntm-members-radio-group {\n width: 100%;\n}\n.ntm-members-radio-group .neeto-ui-radio__container--stacked {\n width: 100%;\n}\n\n.ntm-members-pane-radio-item__wrapper {\n width: 100%;\n cursor: pointer;\n padding: 16px 0px !important;\n border-bottom: 1px solid rgb(var(--neeto-ui-gray-200));\n}\n.ntm-members-pane-radio-item__wrapper:first-child {\n padding-top: 0px !important;\n}\n.ntm-members-pane-radio-item__label {\n margin-bottom: 0 !important;\n}\n.ntm-members-pane-radio-item__description {\n color: rgb(var(--neeto-ui-gray-700));\n}\n\n.ntm-roles-header {\n border-bottom: 1px solid rgb(var(--neeto-ui-gray-300));\n}\n\n.ntm-roles-table__wrapper {\n width: 100%;\n height: calc(100vh - var(--neeto-ui-main-header-height));\n display: flex;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar {\n width: 396px;\n min-width: 396px;\n border-right: thin solid rgb(var(--neeto-ui-gray-300));\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar .ntm-roles-table-sidebar__search {\n padding: 24px 24px 16px;\n height: 72px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar .ntm-roles-table-sidebar__list {\n height: calc(\n 100vh - var(--neeto-ui-main-header-height) - 72px -\n var(--ntm-roles-table-default-scroll)\n );\n overflow-y: auto;\n padding-left: 24px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar .ntm-roles-table-sidebar__list .ntm-roles-table-sidebar__list-item {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 12px 8px;\n min-height: 48px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar .ntm-roles-table-sidebar__list .ntm-roles-table-sidebar__list-item.ntm-roles-table-sidebar__list-item--highlighted {\n background-color: rgb(var(--neeto-ui-primary-100));\n padding: 12px 8px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__sidebar .ntm-roles-table-sidebar__list .ntm-roles-table-sidebar__list-item:not(.ntm-roles-table-sidebar__list-item--highlighted) {\n border-bottom: thin solid rgb(var(--neeto-ui-gray-300));\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns {\n width: calc(\n 100vw - var(--neeto-ui-sidebar-width) - 396px - 24px\n );\n overflow: hidden;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__cell {\n width: 100%;\n min-width: 200px;\n min-height: 48px;\n padding: 12px 8px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-right: thin solid rgb(var(--neeto-ui-gray-300));\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table-cell__checkbox-wrapper {\n position: absolute;\n height: 1rem;\n width: 1rem;\n margin: auto;\n z-index: 10;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table-cell__checkbox {\n z-index: 10;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__header {\n display: flex;\n align-items: center;\n overflow-x: auto;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__header .ntm-roles-table__cell {\n height: 72px;\n padding-left: 24px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__header .ntm-roles-table-header-cell__container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n gap: 1rem;\n overflow: hidden;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__header .ntm-roles-table-header__dropdown {\n margin: 3px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__header .ntm-roles-table-header__role-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows {\n width: 100%;\n height: calc(\n 100vh - var(--neeto-ui-main-header-height) - 72px -\n var(--ntm-roles-table-default-scroll)\n );\n overflow-y: auto;\n scrollbar-width: none;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows::-webkit-scrollbar {\n width: 0px;\n height: 0px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows::-webkit-scrollbar-thumb {\n background: rgb(var(--neeto-ui-gray-300));\n border-radius: 50px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows::-webkit-scrollbar-thumb:hover {\n border-radius: 50px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows::-webkit-scrollbar-track {\n background: rgb(var(--neeto-ui-gray-300));\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows .ntm-roles-table__row {\n display: flex;\n align-items: center;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows .ntm-roles-table__row .ntm-roles-table__cell {\n overflow: hidden;\n position: relative;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows .ntm-roles-table__row .ntm-roles-table__cell p {\n opacity: 0;\n width: 340px;\n min-width: 340px;\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows .ntm-roles-table__row.ntm-roles-table__row--highlighted .ntm-roles-table__cell {\n background-color: rgb(var(--neeto-ui-primary-100));\n}\n.ntm-roles-table__wrapper .ntm-roles-table__columns .ntm-roles-table__rows .ntm-roles-table__row:not(.ntm-roles-table__row--highlighted) .ntm-roles-table__cell {\n border-bottom: thin solid rgb(var(--neeto-ui-gray-300));\n}\n\n.ntm-roles-table-sidebar__drop-down-button {\n color: rgb(var(--neeto-ui-gray-600));\n cursor: pointer;\n}\n\n.ntm-roles-modal__body > * + * {\n margin-top: 1rem;\n}\n.ntm-roles-modal__footer {\n display: flex;\n gap: 0.5rem;\n}\n\n.ntm-roles-pane__body {\n width: 100%;\n margin-bottom: 1.5rem;\n}\n.ntm-roles-pane__body-wrapper > * + * {\n margin-top: 1rem;\n}\n.ntm-roles-pane__body > * + * {\n margin-top: 1.5rem;\n}\n.ntm-roles-pane__footer {\n display: flex;\n gap: 0.5rem;\n}\n\n.ntm-roles-permission > * + * {\n margin: 0.5rem;\n}\n.ntm-roles-permission__heading {\n color: rgb(var(--neeto-ui-gray-500));\n text-transform: uppercase;\n}\n.ntm-roles-permission__card {\n background-color: rgb(var(--neeto-ui-white));\n align-items: center;\n border-radius: var(--neeto-ui-rounded);\n border-width: 1px;\n border-color: rgb(var(--neeto-ui-gray-300));\n cursor: pointer;\n display: flex;\n gap: 0.75rem;\n padding: 1rem 0.75rem;\n}\n.ntm-roles-permission__card--description {\n flex-grow: 1;\n}\n.ntm-roles-permission__card--checkbox {\n padding: 0 0.5rem;\n}\n\ntd.ant-table-column-sort {\n background: transparent;\n}";
|
|
10444
11393
|
n(css,{});
|
|
10445
11394
|
|
|
10446
|
-
export { index$1 as Roles, index as TeamMembers, hasPermission };
|
|
11395
|
+
export { MultipleEmailInput, index$1 as Roles, RolesRadioGroup, index as TeamMembers, VALIDATION_SCHEMA, hasPermission };
|
|
10447
11396
|
//# sourceMappingURL=index.esm.js.map
|