mui-drawer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/index.d.ts +94 -0
- package/dist/mui-drawer.es.js +2079 -0
- package/package.json +111 -0
|
@@ -0,0 +1,2079 @@
|
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode(".vi-drawer .MuiDrawer-paper{overflow-y:hidden;max-width:100%}.vi-drawer .drawer-body-pt{padding-top:0}.vi-drawer .drawer-body-pb{padding-bottom:0}.vi-drawer .close-icon{cursor:pointer;color:#717371}.vi-drawer .vi-drawer-actions{position:sticky;bottom:0;padding:24px;background-color:#fff;z-index:50;display:flex;align-items:center;justify-content:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{display:flex;align-items:center;justify-content:flex-end;gap:16px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:50%;align-self:flex-end}.vi-drawer .vi-drawer-actions .vi-drawer-cta.destructive{background-color:#ed1d31}.vi-drawer .vi-drawer-actions.tertiary-cta{justify-content:space-between;gap:16px}.vi-drawer .vi-drawer-actions.tertiary-cta .tertiary-cta-destructive{color:#ed1d31}.vi-drawer .vi-drawer-actions.divider{border-top:1px solid #e9e9e9}.vi-drawer .vi-drawer-title{position:sticky;top:0;padding:24px 24px 28px;background-color:#fff;z-index:50}.vi-drawer .vi-drawer-title .description{margin-top:16px!important}.vi-drawer .drawer-children{padding:24px;overflow-y:auto;height:100%}.vi-drawer .drawer-children.with-header-footer{padding-top:0;padding-bottom:28px;height:calc(100% - 173px)}.vi-drawer .drawer-children.with-header{padding-top:0;height:calc(100% - 80px)}.vi-drawer .drawer-children.with-footer{padding-bottom:28px;height:calc(100% - 93px)}.vi-drawer .drawer-children.no-divider{padding-bottom:0}@media only screen and (max-width: 600px){.vi-drawer .MuiPaper-root{margin:0;width:100%;height:100%}.vi-drawer .vi-drawer-actions-wrapper,.vi-drawer .vi-drawer-actions{flex-direction:column-reverse;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-action-ctas{flex-direction:column-reverse;width:100%!important;gap:12px}.vi-drawer .vi-drawer-actions .vi-drawer-cta{width:100%}.vi-drawer .drawer-children.one-cta.with-header-footer{height:calc(100% - 170px)}.vi-drawer .drawer-children.one-cta.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.one-cta.with-footer{height:calc(100% - 90px)}.vi-drawer .drawer-children.two-ctas.with-header-footer{height:calc(100% - 222px)}.vi-drawer .drawer-children.two-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.two-ctas.with-footer{height:calc(100% - 142px)}.vi-drawer .drawer-children.three-ctas.with-header-footer{height:calc(100% - 259px)}.vi-drawer .drawer-children.three-ctas.with-header{height:calc(100% - 80px)}.vi-drawer .drawer-children.three-ctas.with-footer{height:calc(100% - 179px)}}")),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useState, useRef, useEffect } from 'react';
|
|
5
|
+
import { createTheme, Drawer, Typography, Tooltip } from '@mui/material';
|
|
6
|
+
import { createSvgIcon } from '@mui/material/utils';
|
|
7
|
+
import { useTheme, ThemeProvider } from '@mui/material/styles';
|
|
8
|
+
import Button from '@mui/material/Button';
|
|
9
|
+
|
|
10
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
11
|
+
|
|
12
|
+
function getDefaultExportFromCjs (x) {
|
|
13
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var classnames = {exports: {}};
|
|
17
|
+
|
|
18
|
+
/*!
|
|
19
|
+
Copyright (c) 2018 Jed Watson.
|
|
20
|
+
Licensed under the MIT License (MIT), see
|
|
21
|
+
http://jedwatson.github.io/classnames
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
var hasRequiredClassnames;
|
|
25
|
+
|
|
26
|
+
function requireClassnames () {
|
|
27
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
28
|
+
hasRequiredClassnames = 1;
|
|
29
|
+
(function (module) {
|
|
30
|
+
/* global define */
|
|
31
|
+
|
|
32
|
+
(function () {
|
|
33
|
+
|
|
34
|
+
var hasOwn = {}.hasOwnProperty;
|
|
35
|
+
|
|
36
|
+
function classNames () {
|
|
37
|
+
var classes = '';
|
|
38
|
+
|
|
39
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
40
|
+
var arg = arguments[i];
|
|
41
|
+
if (arg) {
|
|
42
|
+
classes = appendClass(classes, parseValue(arg));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return classes;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function parseValue (arg) {
|
|
50
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
51
|
+
return arg;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (typeof arg !== 'object') {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (Array.isArray(arg)) {
|
|
59
|
+
return classNames.apply(null, arg);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
63
|
+
return arg.toString();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var classes = '';
|
|
67
|
+
|
|
68
|
+
for (var key in arg) {
|
|
69
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
70
|
+
classes = appendClass(classes, key);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return classes;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function appendClass (value, newClass) {
|
|
78
|
+
if (!newClass) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (value) {
|
|
83
|
+
return value + ' ' + newClass;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return value + newClass;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (module.exports) {
|
|
90
|
+
classNames.default = classNames;
|
|
91
|
+
module.exports = classNames;
|
|
92
|
+
} else {
|
|
93
|
+
window.classNames = classNames;
|
|
94
|
+
}
|
|
95
|
+
}());
|
|
96
|
+
} (classnames));
|
|
97
|
+
return classnames.exports;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
var classnamesExports = requireClassnames();
|
|
101
|
+
const classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
102
|
+
|
|
103
|
+
const CloseIcon = createSvgIcon(/*#__PURE__*/jsx("path", {
|
|
104
|
+
d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
|
105
|
+
}), 'Close');
|
|
106
|
+
|
|
107
|
+
let warnedOnce = false;
|
|
108
|
+
const warn = () => {
|
|
109
|
+
if (!warnedOnce) {
|
|
110
|
+
console.warn(['MUI: The LoadingButton component functionality is now part of the Button component from Material UI.', '', "You should use `import Button from '@mui/material/Button'`", "or `import { Button } from '@mui/material'`"].join('\n'));
|
|
111
|
+
warnedOnce = true;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @ignore - do not document.
|
|
117
|
+
*/
|
|
118
|
+
const LoadingButton = /*#__PURE__*/React.forwardRef(function DeprecatedLoadingButton(props, ref) {
|
|
119
|
+
warn();
|
|
120
|
+
return /*#__PURE__*/jsx(Button, {
|
|
121
|
+
ref: ref,
|
|
122
|
+
...props
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* This method returns `undefined`.
|
|
128
|
+
*
|
|
129
|
+
* @static
|
|
130
|
+
* @memberOf _
|
|
131
|
+
* @since 2.3.0
|
|
132
|
+
* @category Util
|
|
133
|
+
* @example
|
|
134
|
+
*
|
|
135
|
+
* _.times(2, _.noop);
|
|
136
|
+
* // => [undefined, undefined]
|
|
137
|
+
*/
|
|
138
|
+
|
|
139
|
+
var noop_1;
|
|
140
|
+
var hasRequiredNoop;
|
|
141
|
+
|
|
142
|
+
function requireNoop () {
|
|
143
|
+
if (hasRequiredNoop) return noop_1;
|
|
144
|
+
hasRequiredNoop = 1;
|
|
145
|
+
function noop() {
|
|
146
|
+
// No operation performed.
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
noop_1 = noop;
|
|
150
|
+
return noop_1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var noopExports = requireNoop();
|
|
154
|
+
const _noop = /*@__PURE__*/getDefaultExportFromCjs(noopExports);
|
|
155
|
+
|
|
156
|
+
/** Used for built-in method references. */
|
|
157
|
+
|
|
158
|
+
var _isPrototype;
|
|
159
|
+
var hasRequired_isPrototype;
|
|
160
|
+
|
|
161
|
+
function require_isPrototype () {
|
|
162
|
+
if (hasRequired_isPrototype) return _isPrototype;
|
|
163
|
+
hasRequired_isPrototype = 1;
|
|
164
|
+
var objectProto = Object.prototype;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Checks if `value` is likely a prototype object.
|
|
168
|
+
*
|
|
169
|
+
* @private
|
|
170
|
+
* @param {*} value The value to check.
|
|
171
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
172
|
+
*/
|
|
173
|
+
function isPrototype(value) {
|
|
174
|
+
var Ctor = value && value.constructor,
|
|
175
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
|
|
176
|
+
|
|
177
|
+
return value === proto;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
_isPrototype = isPrototype;
|
|
181
|
+
return _isPrototype;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
186
|
+
*
|
|
187
|
+
* @private
|
|
188
|
+
* @param {Function} func The function to wrap.
|
|
189
|
+
* @param {Function} transform The argument transform.
|
|
190
|
+
* @returns {Function} Returns the new function.
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
var _overArg;
|
|
194
|
+
var hasRequired_overArg;
|
|
195
|
+
|
|
196
|
+
function require_overArg () {
|
|
197
|
+
if (hasRequired_overArg) return _overArg;
|
|
198
|
+
hasRequired_overArg = 1;
|
|
199
|
+
function overArg(func, transform) {
|
|
200
|
+
return function(arg) {
|
|
201
|
+
return func(transform(arg));
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
_overArg = overArg;
|
|
206
|
+
return _overArg;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
var _nativeKeys;
|
|
210
|
+
var hasRequired_nativeKeys;
|
|
211
|
+
|
|
212
|
+
function require_nativeKeys () {
|
|
213
|
+
if (hasRequired_nativeKeys) return _nativeKeys;
|
|
214
|
+
hasRequired_nativeKeys = 1;
|
|
215
|
+
var overArg = require_overArg();
|
|
216
|
+
|
|
217
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
218
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
219
|
+
|
|
220
|
+
_nativeKeys = nativeKeys;
|
|
221
|
+
return _nativeKeys;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
var _baseKeys;
|
|
225
|
+
var hasRequired_baseKeys;
|
|
226
|
+
|
|
227
|
+
function require_baseKeys () {
|
|
228
|
+
if (hasRequired_baseKeys) return _baseKeys;
|
|
229
|
+
hasRequired_baseKeys = 1;
|
|
230
|
+
var isPrototype = require_isPrototype(),
|
|
231
|
+
nativeKeys = require_nativeKeys();
|
|
232
|
+
|
|
233
|
+
/** Used for built-in method references. */
|
|
234
|
+
var objectProto = Object.prototype;
|
|
235
|
+
|
|
236
|
+
/** Used to check objects for own properties. */
|
|
237
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
241
|
+
*
|
|
242
|
+
* @private
|
|
243
|
+
* @param {Object} object The object to query.
|
|
244
|
+
* @returns {Array} Returns the array of property names.
|
|
245
|
+
*/
|
|
246
|
+
function baseKeys(object) {
|
|
247
|
+
if (!isPrototype(object)) {
|
|
248
|
+
return nativeKeys(object);
|
|
249
|
+
}
|
|
250
|
+
var result = [];
|
|
251
|
+
for (var key in Object(object)) {
|
|
252
|
+
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
|
253
|
+
result.push(key);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
_baseKeys = baseKeys;
|
|
260
|
+
return _baseKeys;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Detect free variable `global` from Node.js. */
|
|
264
|
+
|
|
265
|
+
var _freeGlobal;
|
|
266
|
+
var hasRequired_freeGlobal;
|
|
267
|
+
|
|
268
|
+
function require_freeGlobal () {
|
|
269
|
+
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
270
|
+
hasRequired_freeGlobal = 1;
|
|
271
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
272
|
+
|
|
273
|
+
_freeGlobal = freeGlobal;
|
|
274
|
+
return _freeGlobal;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
var _root;
|
|
278
|
+
var hasRequired_root;
|
|
279
|
+
|
|
280
|
+
function require_root () {
|
|
281
|
+
if (hasRequired_root) return _root;
|
|
282
|
+
hasRequired_root = 1;
|
|
283
|
+
var freeGlobal = require_freeGlobal();
|
|
284
|
+
|
|
285
|
+
/** Detect free variable `self`. */
|
|
286
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
287
|
+
|
|
288
|
+
/** Used as a reference to the global object. */
|
|
289
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
290
|
+
|
|
291
|
+
_root = root;
|
|
292
|
+
return _root;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
var _Symbol;
|
|
296
|
+
var hasRequired_Symbol;
|
|
297
|
+
|
|
298
|
+
function require_Symbol () {
|
|
299
|
+
if (hasRequired_Symbol) return _Symbol;
|
|
300
|
+
hasRequired_Symbol = 1;
|
|
301
|
+
var root = require_root();
|
|
302
|
+
|
|
303
|
+
/** Built-in value references. */
|
|
304
|
+
var Symbol = root.Symbol;
|
|
305
|
+
|
|
306
|
+
_Symbol = Symbol;
|
|
307
|
+
return _Symbol;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
var _getRawTag;
|
|
311
|
+
var hasRequired_getRawTag;
|
|
312
|
+
|
|
313
|
+
function require_getRawTag () {
|
|
314
|
+
if (hasRequired_getRawTag) return _getRawTag;
|
|
315
|
+
hasRequired_getRawTag = 1;
|
|
316
|
+
var Symbol = require_Symbol();
|
|
317
|
+
|
|
318
|
+
/** Used for built-in method references. */
|
|
319
|
+
var objectProto = Object.prototype;
|
|
320
|
+
|
|
321
|
+
/** Used to check objects for own properties. */
|
|
322
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Used to resolve the
|
|
326
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
327
|
+
* of values.
|
|
328
|
+
*/
|
|
329
|
+
var nativeObjectToString = objectProto.toString;
|
|
330
|
+
|
|
331
|
+
/** Built-in value references. */
|
|
332
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
336
|
+
*
|
|
337
|
+
* @private
|
|
338
|
+
* @param {*} value The value to query.
|
|
339
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
340
|
+
*/
|
|
341
|
+
function getRawTag(value) {
|
|
342
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
343
|
+
tag = value[symToStringTag];
|
|
344
|
+
|
|
345
|
+
try {
|
|
346
|
+
value[symToStringTag] = undefined;
|
|
347
|
+
var unmasked = true;
|
|
348
|
+
} catch (e) {}
|
|
349
|
+
|
|
350
|
+
var result = nativeObjectToString.call(value);
|
|
351
|
+
if (unmasked) {
|
|
352
|
+
if (isOwn) {
|
|
353
|
+
value[symToStringTag] = tag;
|
|
354
|
+
} else {
|
|
355
|
+
delete value[symToStringTag];
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
_getRawTag = getRawTag;
|
|
362
|
+
return _getRawTag;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** Used for built-in method references. */
|
|
366
|
+
|
|
367
|
+
var _objectToString;
|
|
368
|
+
var hasRequired_objectToString;
|
|
369
|
+
|
|
370
|
+
function require_objectToString () {
|
|
371
|
+
if (hasRequired_objectToString) return _objectToString;
|
|
372
|
+
hasRequired_objectToString = 1;
|
|
373
|
+
var objectProto = Object.prototype;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Used to resolve the
|
|
377
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
378
|
+
* of values.
|
|
379
|
+
*/
|
|
380
|
+
var nativeObjectToString = objectProto.toString;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
384
|
+
*
|
|
385
|
+
* @private
|
|
386
|
+
* @param {*} value The value to convert.
|
|
387
|
+
* @returns {string} Returns the converted string.
|
|
388
|
+
*/
|
|
389
|
+
function objectToString(value) {
|
|
390
|
+
return nativeObjectToString.call(value);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
_objectToString = objectToString;
|
|
394
|
+
return _objectToString;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
var _baseGetTag;
|
|
398
|
+
var hasRequired_baseGetTag;
|
|
399
|
+
|
|
400
|
+
function require_baseGetTag () {
|
|
401
|
+
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
402
|
+
hasRequired_baseGetTag = 1;
|
|
403
|
+
var Symbol = require_Symbol(),
|
|
404
|
+
getRawTag = require_getRawTag(),
|
|
405
|
+
objectToString = require_objectToString();
|
|
406
|
+
|
|
407
|
+
/** `Object#toString` result references. */
|
|
408
|
+
var nullTag = '[object Null]',
|
|
409
|
+
undefinedTag = '[object Undefined]';
|
|
410
|
+
|
|
411
|
+
/** Built-in value references. */
|
|
412
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
416
|
+
*
|
|
417
|
+
* @private
|
|
418
|
+
* @param {*} value The value to query.
|
|
419
|
+
* @returns {string} Returns the `toStringTag`.
|
|
420
|
+
*/
|
|
421
|
+
function baseGetTag(value) {
|
|
422
|
+
if (value == null) {
|
|
423
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
424
|
+
}
|
|
425
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
426
|
+
? getRawTag(value)
|
|
427
|
+
: objectToString(value);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
_baseGetTag = baseGetTag;
|
|
431
|
+
return _baseGetTag;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Checks if `value` is the
|
|
436
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
437
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
438
|
+
*
|
|
439
|
+
* @static
|
|
440
|
+
* @memberOf _
|
|
441
|
+
* @since 0.1.0
|
|
442
|
+
* @category Lang
|
|
443
|
+
* @param {*} value The value to check.
|
|
444
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
445
|
+
* @example
|
|
446
|
+
*
|
|
447
|
+
* _.isObject({});
|
|
448
|
+
* // => true
|
|
449
|
+
*
|
|
450
|
+
* _.isObject([1, 2, 3]);
|
|
451
|
+
* // => true
|
|
452
|
+
*
|
|
453
|
+
* _.isObject(_.noop);
|
|
454
|
+
* // => true
|
|
455
|
+
*
|
|
456
|
+
* _.isObject(null);
|
|
457
|
+
* // => false
|
|
458
|
+
*/
|
|
459
|
+
|
|
460
|
+
var isObject_1;
|
|
461
|
+
var hasRequiredIsObject;
|
|
462
|
+
|
|
463
|
+
function requireIsObject () {
|
|
464
|
+
if (hasRequiredIsObject) return isObject_1;
|
|
465
|
+
hasRequiredIsObject = 1;
|
|
466
|
+
function isObject(value) {
|
|
467
|
+
var type = typeof value;
|
|
468
|
+
return value != null && (type == 'object' || type == 'function');
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
isObject_1 = isObject;
|
|
472
|
+
return isObject_1;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
var isFunction_1;
|
|
476
|
+
var hasRequiredIsFunction;
|
|
477
|
+
|
|
478
|
+
function requireIsFunction () {
|
|
479
|
+
if (hasRequiredIsFunction) return isFunction_1;
|
|
480
|
+
hasRequiredIsFunction = 1;
|
|
481
|
+
var baseGetTag = require_baseGetTag(),
|
|
482
|
+
isObject = requireIsObject();
|
|
483
|
+
|
|
484
|
+
/** `Object#toString` result references. */
|
|
485
|
+
var asyncTag = '[object AsyncFunction]',
|
|
486
|
+
funcTag = '[object Function]',
|
|
487
|
+
genTag = '[object GeneratorFunction]',
|
|
488
|
+
proxyTag = '[object Proxy]';
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Checks if `value` is classified as a `Function` object.
|
|
492
|
+
*
|
|
493
|
+
* @static
|
|
494
|
+
* @memberOf _
|
|
495
|
+
* @since 0.1.0
|
|
496
|
+
* @category Lang
|
|
497
|
+
* @param {*} value The value to check.
|
|
498
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
499
|
+
* @example
|
|
500
|
+
*
|
|
501
|
+
* _.isFunction(_);
|
|
502
|
+
* // => true
|
|
503
|
+
*
|
|
504
|
+
* _.isFunction(/abc/);
|
|
505
|
+
* // => false
|
|
506
|
+
*/
|
|
507
|
+
function isFunction(value) {
|
|
508
|
+
if (!isObject(value)) {
|
|
509
|
+
return false;
|
|
510
|
+
}
|
|
511
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
512
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
513
|
+
var tag = baseGetTag(value);
|
|
514
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
isFunction_1 = isFunction;
|
|
518
|
+
return isFunction_1;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
var _coreJsData;
|
|
522
|
+
var hasRequired_coreJsData;
|
|
523
|
+
|
|
524
|
+
function require_coreJsData () {
|
|
525
|
+
if (hasRequired_coreJsData) return _coreJsData;
|
|
526
|
+
hasRequired_coreJsData = 1;
|
|
527
|
+
var root = require_root();
|
|
528
|
+
|
|
529
|
+
/** Used to detect overreaching core-js shims. */
|
|
530
|
+
var coreJsData = root['__core-js_shared__'];
|
|
531
|
+
|
|
532
|
+
_coreJsData = coreJsData;
|
|
533
|
+
return _coreJsData;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
var _isMasked;
|
|
537
|
+
var hasRequired_isMasked;
|
|
538
|
+
|
|
539
|
+
function require_isMasked () {
|
|
540
|
+
if (hasRequired_isMasked) return _isMasked;
|
|
541
|
+
hasRequired_isMasked = 1;
|
|
542
|
+
var coreJsData = require_coreJsData();
|
|
543
|
+
|
|
544
|
+
/** Used to detect methods masquerading as native. */
|
|
545
|
+
var maskSrcKey = (function() {
|
|
546
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
|
547
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
548
|
+
}());
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Checks if `func` has its source masked.
|
|
552
|
+
*
|
|
553
|
+
* @private
|
|
554
|
+
* @param {Function} func The function to check.
|
|
555
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
556
|
+
*/
|
|
557
|
+
function isMasked(func) {
|
|
558
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
_isMasked = isMasked;
|
|
562
|
+
return _isMasked;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
/** Used for built-in method references. */
|
|
566
|
+
|
|
567
|
+
var _toSource;
|
|
568
|
+
var hasRequired_toSource;
|
|
569
|
+
|
|
570
|
+
function require_toSource () {
|
|
571
|
+
if (hasRequired_toSource) return _toSource;
|
|
572
|
+
hasRequired_toSource = 1;
|
|
573
|
+
var funcProto = Function.prototype;
|
|
574
|
+
|
|
575
|
+
/** Used to resolve the decompiled source of functions. */
|
|
576
|
+
var funcToString = funcProto.toString;
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Converts `func` to its source code.
|
|
580
|
+
*
|
|
581
|
+
* @private
|
|
582
|
+
* @param {Function} func The function to convert.
|
|
583
|
+
* @returns {string} Returns the source code.
|
|
584
|
+
*/
|
|
585
|
+
function toSource(func) {
|
|
586
|
+
if (func != null) {
|
|
587
|
+
try {
|
|
588
|
+
return funcToString.call(func);
|
|
589
|
+
} catch (e) {}
|
|
590
|
+
try {
|
|
591
|
+
return (func + '');
|
|
592
|
+
} catch (e) {}
|
|
593
|
+
}
|
|
594
|
+
return '';
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
_toSource = toSource;
|
|
598
|
+
return _toSource;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
var _baseIsNative;
|
|
602
|
+
var hasRequired_baseIsNative;
|
|
603
|
+
|
|
604
|
+
function require_baseIsNative () {
|
|
605
|
+
if (hasRequired_baseIsNative) return _baseIsNative;
|
|
606
|
+
hasRequired_baseIsNative = 1;
|
|
607
|
+
var isFunction = requireIsFunction(),
|
|
608
|
+
isMasked = require_isMasked(),
|
|
609
|
+
isObject = requireIsObject(),
|
|
610
|
+
toSource = require_toSource();
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Used to match `RegExp`
|
|
614
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
615
|
+
*/
|
|
616
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
617
|
+
|
|
618
|
+
/** Used to detect host constructors (Safari). */
|
|
619
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
620
|
+
|
|
621
|
+
/** Used for built-in method references. */
|
|
622
|
+
var funcProto = Function.prototype,
|
|
623
|
+
objectProto = Object.prototype;
|
|
624
|
+
|
|
625
|
+
/** Used to resolve the decompiled source of functions. */
|
|
626
|
+
var funcToString = funcProto.toString;
|
|
627
|
+
|
|
628
|
+
/** Used to check objects for own properties. */
|
|
629
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
630
|
+
|
|
631
|
+
/** Used to detect if a method is native. */
|
|
632
|
+
var reIsNative = RegExp('^' +
|
|
633
|
+
funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
|
|
634
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
|
639
|
+
*
|
|
640
|
+
* @private
|
|
641
|
+
* @param {*} value The value to check.
|
|
642
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
643
|
+
* else `false`.
|
|
644
|
+
*/
|
|
645
|
+
function baseIsNative(value) {
|
|
646
|
+
if (!isObject(value) || isMasked(value)) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
650
|
+
return pattern.test(toSource(value));
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
_baseIsNative = baseIsNative;
|
|
654
|
+
return _baseIsNative;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Gets the value at `key` of `object`.
|
|
659
|
+
*
|
|
660
|
+
* @private
|
|
661
|
+
* @param {Object} [object] The object to query.
|
|
662
|
+
* @param {string} key The key of the property to get.
|
|
663
|
+
* @returns {*} Returns the property value.
|
|
664
|
+
*/
|
|
665
|
+
|
|
666
|
+
var _getValue;
|
|
667
|
+
var hasRequired_getValue;
|
|
668
|
+
|
|
669
|
+
function require_getValue () {
|
|
670
|
+
if (hasRequired_getValue) return _getValue;
|
|
671
|
+
hasRequired_getValue = 1;
|
|
672
|
+
function getValue(object, key) {
|
|
673
|
+
return object == null ? undefined : object[key];
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
_getValue = getValue;
|
|
677
|
+
return _getValue;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
var _getNative;
|
|
681
|
+
var hasRequired_getNative;
|
|
682
|
+
|
|
683
|
+
function require_getNative () {
|
|
684
|
+
if (hasRequired_getNative) return _getNative;
|
|
685
|
+
hasRequired_getNative = 1;
|
|
686
|
+
var baseIsNative = require_baseIsNative(),
|
|
687
|
+
getValue = require_getValue();
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Gets the native function at `key` of `object`.
|
|
691
|
+
*
|
|
692
|
+
* @private
|
|
693
|
+
* @param {Object} object The object to query.
|
|
694
|
+
* @param {string} key The key of the method to get.
|
|
695
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
696
|
+
*/
|
|
697
|
+
function getNative(object, key) {
|
|
698
|
+
var value = getValue(object, key);
|
|
699
|
+
return baseIsNative(value) ? value : undefined;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
_getNative = getNative;
|
|
703
|
+
return _getNative;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
var _DataView;
|
|
707
|
+
var hasRequired_DataView;
|
|
708
|
+
|
|
709
|
+
function require_DataView () {
|
|
710
|
+
if (hasRequired_DataView) return _DataView;
|
|
711
|
+
hasRequired_DataView = 1;
|
|
712
|
+
var getNative = require_getNative(),
|
|
713
|
+
root = require_root();
|
|
714
|
+
|
|
715
|
+
/* Built-in method references that are verified to be native. */
|
|
716
|
+
var DataView = getNative(root, 'DataView');
|
|
717
|
+
|
|
718
|
+
_DataView = DataView;
|
|
719
|
+
return _DataView;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
var _Map;
|
|
723
|
+
var hasRequired_Map;
|
|
724
|
+
|
|
725
|
+
function require_Map () {
|
|
726
|
+
if (hasRequired_Map) return _Map;
|
|
727
|
+
hasRequired_Map = 1;
|
|
728
|
+
var getNative = require_getNative(),
|
|
729
|
+
root = require_root();
|
|
730
|
+
|
|
731
|
+
/* Built-in method references that are verified to be native. */
|
|
732
|
+
var Map = getNative(root, 'Map');
|
|
733
|
+
|
|
734
|
+
_Map = Map;
|
|
735
|
+
return _Map;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
var _Promise;
|
|
739
|
+
var hasRequired_Promise;
|
|
740
|
+
|
|
741
|
+
function require_Promise () {
|
|
742
|
+
if (hasRequired_Promise) return _Promise;
|
|
743
|
+
hasRequired_Promise = 1;
|
|
744
|
+
var getNative = require_getNative(),
|
|
745
|
+
root = require_root();
|
|
746
|
+
|
|
747
|
+
/* Built-in method references that are verified to be native. */
|
|
748
|
+
var Promise = getNative(root, 'Promise');
|
|
749
|
+
|
|
750
|
+
_Promise = Promise;
|
|
751
|
+
return _Promise;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
var _Set;
|
|
755
|
+
var hasRequired_Set;
|
|
756
|
+
|
|
757
|
+
function require_Set () {
|
|
758
|
+
if (hasRequired_Set) return _Set;
|
|
759
|
+
hasRequired_Set = 1;
|
|
760
|
+
var getNative = require_getNative(),
|
|
761
|
+
root = require_root();
|
|
762
|
+
|
|
763
|
+
/* Built-in method references that are verified to be native. */
|
|
764
|
+
var Set = getNative(root, 'Set');
|
|
765
|
+
|
|
766
|
+
_Set = Set;
|
|
767
|
+
return _Set;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
var _WeakMap;
|
|
771
|
+
var hasRequired_WeakMap;
|
|
772
|
+
|
|
773
|
+
function require_WeakMap () {
|
|
774
|
+
if (hasRequired_WeakMap) return _WeakMap;
|
|
775
|
+
hasRequired_WeakMap = 1;
|
|
776
|
+
var getNative = require_getNative(),
|
|
777
|
+
root = require_root();
|
|
778
|
+
|
|
779
|
+
/* Built-in method references that are verified to be native. */
|
|
780
|
+
var WeakMap = getNative(root, 'WeakMap');
|
|
781
|
+
|
|
782
|
+
_WeakMap = WeakMap;
|
|
783
|
+
return _WeakMap;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
var _getTag;
|
|
787
|
+
var hasRequired_getTag;
|
|
788
|
+
|
|
789
|
+
function require_getTag () {
|
|
790
|
+
if (hasRequired_getTag) return _getTag;
|
|
791
|
+
hasRequired_getTag = 1;
|
|
792
|
+
var DataView = require_DataView(),
|
|
793
|
+
Map = require_Map(),
|
|
794
|
+
Promise = require_Promise(),
|
|
795
|
+
Set = require_Set(),
|
|
796
|
+
WeakMap = require_WeakMap(),
|
|
797
|
+
baseGetTag = require_baseGetTag(),
|
|
798
|
+
toSource = require_toSource();
|
|
799
|
+
|
|
800
|
+
/** `Object#toString` result references. */
|
|
801
|
+
var mapTag = '[object Map]',
|
|
802
|
+
objectTag = '[object Object]',
|
|
803
|
+
promiseTag = '[object Promise]',
|
|
804
|
+
setTag = '[object Set]',
|
|
805
|
+
weakMapTag = '[object WeakMap]';
|
|
806
|
+
|
|
807
|
+
var dataViewTag = '[object DataView]';
|
|
808
|
+
|
|
809
|
+
/** Used to detect maps, sets, and weakmaps. */
|
|
810
|
+
var dataViewCtorString = toSource(DataView),
|
|
811
|
+
mapCtorString = toSource(Map),
|
|
812
|
+
promiseCtorString = toSource(Promise),
|
|
813
|
+
setCtorString = toSource(Set),
|
|
814
|
+
weakMapCtorString = toSource(WeakMap);
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* Gets the `toStringTag` of `value`.
|
|
818
|
+
*
|
|
819
|
+
* @private
|
|
820
|
+
* @param {*} value The value to query.
|
|
821
|
+
* @returns {string} Returns the `toStringTag`.
|
|
822
|
+
*/
|
|
823
|
+
var getTag = baseGetTag;
|
|
824
|
+
|
|
825
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
826
|
+
if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
827
|
+
(Map && getTag(new Map) != mapTag) ||
|
|
828
|
+
(Promise && getTag(Promise.resolve()) != promiseTag) ||
|
|
829
|
+
(Set && getTag(new Set) != setTag) ||
|
|
830
|
+
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
|
|
831
|
+
getTag = function(value) {
|
|
832
|
+
var result = baseGetTag(value),
|
|
833
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
|
834
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
|
835
|
+
|
|
836
|
+
if (ctorString) {
|
|
837
|
+
switch (ctorString) {
|
|
838
|
+
case dataViewCtorString: return dataViewTag;
|
|
839
|
+
case mapCtorString: return mapTag;
|
|
840
|
+
case promiseCtorString: return promiseTag;
|
|
841
|
+
case setCtorString: return setTag;
|
|
842
|
+
case weakMapCtorString: return weakMapTag;
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
return result;
|
|
846
|
+
};
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
_getTag = getTag;
|
|
850
|
+
return _getTag;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
855
|
+
* and has a `typeof` result of "object".
|
|
856
|
+
*
|
|
857
|
+
* @static
|
|
858
|
+
* @memberOf _
|
|
859
|
+
* @since 4.0.0
|
|
860
|
+
* @category Lang
|
|
861
|
+
* @param {*} value The value to check.
|
|
862
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
863
|
+
* @example
|
|
864
|
+
*
|
|
865
|
+
* _.isObjectLike({});
|
|
866
|
+
* // => true
|
|
867
|
+
*
|
|
868
|
+
* _.isObjectLike([1, 2, 3]);
|
|
869
|
+
* // => true
|
|
870
|
+
*
|
|
871
|
+
* _.isObjectLike(_.noop);
|
|
872
|
+
* // => false
|
|
873
|
+
*
|
|
874
|
+
* _.isObjectLike(null);
|
|
875
|
+
* // => false
|
|
876
|
+
*/
|
|
877
|
+
|
|
878
|
+
var isObjectLike_1;
|
|
879
|
+
var hasRequiredIsObjectLike;
|
|
880
|
+
|
|
881
|
+
function requireIsObjectLike () {
|
|
882
|
+
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
883
|
+
hasRequiredIsObjectLike = 1;
|
|
884
|
+
function isObjectLike(value) {
|
|
885
|
+
return value != null && typeof value == 'object';
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
isObjectLike_1 = isObjectLike;
|
|
889
|
+
return isObjectLike_1;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
var _baseIsArguments;
|
|
893
|
+
var hasRequired_baseIsArguments;
|
|
894
|
+
|
|
895
|
+
function require_baseIsArguments () {
|
|
896
|
+
if (hasRequired_baseIsArguments) return _baseIsArguments;
|
|
897
|
+
hasRequired_baseIsArguments = 1;
|
|
898
|
+
var baseGetTag = require_baseGetTag(),
|
|
899
|
+
isObjectLike = requireIsObjectLike();
|
|
900
|
+
|
|
901
|
+
/** `Object#toString` result references. */
|
|
902
|
+
var argsTag = '[object Arguments]';
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* The base implementation of `_.isArguments`.
|
|
906
|
+
*
|
|
907
|
+
* @private
|
|
908
|
+
* @param {*} value The value to check.
|
|
909
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
910
|
+
*/
|
|
911
|
+
function baseIsArguments(value) {
|
|
912
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
_baseIsArguments = baseIsArguments;
|
|
916
|
+
return _baseIsArguments;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
var isArguments_1;
|
|
920
|
+
var hasRequiredIsArguments;
|
|
921
|
+
|
|
922
|
+
function requireIsArguments () {
|
|
923
|
+
if (hasRequiredIsArguments) return isArguments_1;
|
|
924
|
+
hasRequiredIsArguments = 1;
|
|
925
|
+
var baseIsArguments = require_baseIsArguments(),
|
|
926
|
+
isObjectLike = requireIsObjectLike();
|
|
927
|
+
|
|
928
|
+
/** Used for built-in method references. */
|
|
929
|
+
var objectProto = Object.prototype;
|
|
930
|
+
|
|
931
|
+
/** Used to check objects for own properties. */
|
|
932
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
933
|
+
|
|
934
|
+
/** Built-in value references. */
|
|
935
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Checks if `value` is likely an `arguments` object.
|
|
939
|
+
*
|
|
940
|
+
* @static
|
|
941
|
+
* @memberOf _
|
|
942
|
+
* @since 0.1.0
|
|
943
|
+
* @category Lang
|
|
944
|
+
* @param {*} value The value to check.
|
|
945
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
946
|
+
* else `false`.
|
|
947
|
+
* @example
|
|
948
|
+
*
|
|
949
|
+
* _.isArguments(function() { return arguments; }());
|
|
950
|
+
* // => true
|
|
951
|
+
*
|
|
952
|
+
* _.isArguments([1, 2, 3]);
|
|
953
|
+
* // => false
|
|
954
|
+
*/
|
|
955
|
+
var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
|
|
956
|
+
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
|
|
957
|
+
!propertyIsEnumerable.call(value, 'callee');
|
|
958
|
+
};
|
|
959
|
+
|
|
960
|
+
isArguments_1 = isArguments;
|
|
961
|
+
return isArguments_1;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Checks if `value` is classified as an `Array` object.
|
|
966
|
+
*
|
|
967
|
+
* @static
|
|
968
|
+
* @memberOf _
|
|
969
|
+
* @since 0.1.0
|
|
970
|
+
* @category Lang
|
|
971
|
+
* @param {*} value The value to check.
|
|
972
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
973
|
+
* @example
|
|
974
|
+
*
|
|
975
|
+
* _.isArray([1, 2, 3]);
|
|
976
|
+
* // => true
|
|
977
|
+
*
|
|
978
|
+
* _.isArray(document.body.children);
|
|
979
|
+
* // => false
|
|
980
|
+
*
|
|
981
|
+
* _.isArray('abc');
|
|
982
|
+
* // => false
|
|
983
|
+
*
|
|
984
|
+
* _.isArray(_.noop);
|
|
985
|
+
* // => false
|
|
986
|
+
*/
|
|
987
|
+
|
|
988
|
+
var isArray_1;
|
|
989
|
+
var hasRequiredIsArray;
|
|
990
|
+
|
|
991
|
+
function requireIsArray () {
|
|
992
|
+
if (hasRequiredIsArray) return isArray_1;
|
|
993
|
+
hasRequiredIsArray = 1;
|
|
994
|
+
var isArray = Array.isArray;
|
|
995
|
+
|
|
996
|
+
isArray_1 = isArray;
|
|
997
|
+
return isArray_1;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
/** Used as references for various `Number` constants. */
|
|
1001
|
+
|
|
1002
|
+
var isLength_1;
|
|
1003
|
+
var hasRequiredIsLength;
|
|
1004
|
+
|
|
1005
|
+
function requireIsLength () {
|
|
1006
|
+
if (hasRequiredIsLength) return isLength_1;
|
|
1007
|
+
hasRequiredIsLength = 1;
|
|
1008
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* Checks if `value` is a valid array-like length.
|
|
1012
|
+
*
|
|
1013
|
+
* **Note:** This method is loosely based on
|
|
1014
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
1015
|
+
*
|
|
1016
|
+
* @static
|
|
1017
|
+
* @memberOf _
|
|
1018
|
+
* @since 4.0.0
|
|
1019
|
+
* @category Lang
|
|
1020
|
+
* @param {*} value The value to check.
|
|
1021
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
1022
|
+
* @example
|
|
1023
|
+
*
|
|
1024
|
+
* _.isLength(3);
|
|
1025
|
+
* // => true
|
|
1026
|
+
*
|
|
1027
|
+
* _.isLength(Number.MIN_VALUE);
|
|
1028
|
+
* // => false
|
|
1029
|
+
*
|
|
1030
|
+
* _.isLength(Infinity);
|
|
1031
|
+
* // => false
|
|
1032
|
+
*
|
|
1033
|
+
* _.isLength('3');
|
|
1034
|
+
* // => false
|
|
1035
|
+
*/
|
|
1036
|
+
function isLength(value) {
|
|
1037
|
+
return typeof value == 'number' &&
|
|
1038
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
isLength_1 = isLength;
|
|
1042
|
+
return isLength_1;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
var isArrayLike_1;
|
|
1046
|
+
var hasRequiredIsArrayLike;
|
|
1047
|
+
|
|
1048
|
+
function requireIsArrayLike () {
|
|
1049
|
+
if (hasRequiredIsArrayLike) return isArrayLike_1;
|
|
1050
|
+
hasRequiredIsArrayLike = 1;
|
|
1051
|
+
var isFunction = requireIsFunction(),
|
|
1052
|
+
isLength = requireIsLength();
|
|
1053
|
+
|
|
1054
|
+
/**
|
|
1055
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
1056
|
+
* not a function and has a `value.length` that's an integer greater than or
|
|
1057
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
1058
|
+
*
|
|
1059
|
+
* @static
|
|
1060
|
+
* @memberOf _
|
|
1061
|
+
* @since 4.0.0
|
|
1062
|
+
* @category Lang
|
|
1063
|
+
* @param {*} value The value to check.
|
|
1064
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
1065
|
+
* @example
|
|
1066
|
+
*
|
|
1067
|
+
* _.isArrayLike([1, 2, 3]);
|
|
1068
|
+
* // => true
|
|
1069
|
+
*
|
|
1070
|
+
* _.isArrayLike(document.body.children);
|
|
1071
|
+
* // => true
|
|
1072
|
+
*
|
|
1073
|
+
* _.isArrayLike('abc');
|
|
1074
|
+
* // => true
|
|
1075
|
+
*
|
|
1076
|
+
* _.isArrayLike(_.noop);
|
|
1077
|
+
* // => false
|
|
1078
|
+
*/
|
|
1079
|
+
function isArrayLike(value) {
|
|
1080
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
isArrayLike_1 = isArrayLike;
|
|
1084
|
+
return isArrayLike_1;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
var isBuffer = {exports: {}};
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* This method returns `false`.
|
|
1091
|
+
*
|
|
1092
|
+
* @static
|
|
1093
|
+
* @memberOf _
|
|
1094
|
+
* @since 4.13.0
|
|
1095
|
+
* @category Util
|
|
1096
|
+
* @returns {boolean} Returns `false`.
|
|
1097
|
+
* @example
|
|
1098
|
+
*
|
|
1099
|
+
* _.times(2, _.stubFalse);
|
|
1100
|
+
* // => [false, false]
|
|
1101
|
+
*/
|
|
1102
|
+
|
|
1103
|
+
var stubFalse_1;
|
|
1104
|
+
var hasRequiredStubFalse;
|
|
1105
|
+
|
|
1106
|
+
function requireStubFalse () {
|
|
1107
|
+
if (hasRequiredStubFalse) return stubFalse_1;
|
|
1108
|
+
hasRequiredStubFalse = 1;
|
|
1109
|
+
function stubFalse() {
|
|
1110
|
+
return false;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
stubFalse_1 = stubFalse;
|
|
1114
|
+
return stubFalse_1;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
isBuffer.exports;
|
|
1118
|
+
|
|
1119
|
+
var hasRequiredIsBuffer;
|
|
1120
|
+
|
|
1121
|
+
function requireIsBuffer () {
|
|
1122
|
+
if (hasRequiredIsBuffer) return isBuffer.exports;
|
|
1123
|
+
hasRequiredIsBuffer = 1;
|
|
1124
|
+
(function (module, exports) {
|
|
1125
|
+
var root = require_root(),
|
|
1126
|
+
stubFalse = requireStubFalse();
|
|
1127
|
+
|
|
1128
|
+
/** Detect free variable `exports`. */
|
|
1129
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1130
|
+
|
|
1131
|
+
/** Detect free variable `module`. */
|
|
1132
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1133
|
+
|
|
1134
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1135
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1136
|
+
|
|
1137
|
+
/** Built-in value references. */
|
|
1138
|
+
var Buffer = moduleExports ? root.Buffer : undefined;
|
|
1139
|
+
|
|
1140
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1141
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Checks if `value` is a buffer.
|
|
1145
|
+
*
|
|
1146
|
+
* @static
|
|
1147
|
+
* @memberOf _
|
|
1148
|
+
* @since 4.3.0
|
|
1149
|
+
* @category Lang
|
|
1150
|
+
* @param {*} value The value to check.
|
|
1151
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1152
|
+
* @example
|
|
1153
|
+
*
|
|
1154
|
+
* _.isBuffer(new Buffer(2));
|
|
1155
|
+
* // => true
|
|
1156
|
+
*
|
|
1157
|
+
* _.isBuffer(new Uint8Array(2));
|
|
1158
|
+
* // => false
|
|
1159
|
+
*/
|
|
1160
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
|
1161
|
+
|
|
1162
|
+
module.exports = isBuffer;
|
|
1163
|
+
} (isBuffer, isBuffer.exports));
|
|
1164
|
+
return isBuffer.exports;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
var _baseIsTypedArray;
|
|
1168
|
+
var hasRequired_baseIsTypedArray;
|
|
1169
|
+
|
|
1170
|
+
function require_baseIsTypedArray () {
|
|
1171
|
+
if (hasRequired_baseIsTypedArray) return _baseIsTypedArray;
|
|
1172
|
+
hasRequired_baseIsTypedArray = 1;
|
|
1173
|
+
var baseGetTag = require_baseGetTag(),
|
|
1174
|
+
isLength = requireIsLength(),
|
|
1175
|
+
isObjectLike = requireIsObjectLike();
|
|
1176
|
+
|
|
1177
|
+
/** `Object#toString` result references. */
|
|
1178
|
+
var argsTag = '[object Arguments]',
|
|
1179
|
+
arrayTag = '[object Array]',
|
|
1180
|
+
boolTag = '[object Boolean]',
|
|
1181
|
+
dateTag = '[object Date]',
|
|
1182
|
+
errorTag = '[object Error]',
|
|
1183
|
+
funcTag = '[object Function]',
|
|
1184
|
+
mapTag = '[object Map]',
|
|
1185
|
+
numberTag = '[object Number]',
|
|
1186
|
+
objectTag = '[object Object]',
|
|
1187
|
+
regexpTag = '[object RegExp]',
|
|
1188
|
+
setTag = '[object Set]',
|
|
1189
|
+
stringTag = '[object String]',
|
|
1190
|
+
weakMapTag = '[object WeakMap]';
|
|
1191
|
+
|
|
1192
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
|
1193
|
+
dataViewTag = '[object DataView]',
|
|
1194
|
+
float32Tag = '[object Float32Array]',
|
|
1195
|
+
float64Tag = '[object Float64Array]',
|
|
1196
|
+
int8Tag = '[object Int8Array]',
|
|
1197
|
+
int16Tag = '[object Int16Array]',
|
|
1198
|
+
int32Tag = '[object Int32Array]',
|
|
1199
|
+
uint8Tag = '[object Uint8Array]',
|
|
1200
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
1201
|
+
uint16Tag = '[object Uint16Array]',
|
|
1202
|
+
uint32Tag = '[object Uint32Array]';
|
|
1203
|
+
|
|
1204
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
|
1205
|
+
var typedArrayTags = {};
|
|
1206
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
1207
|
+
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
1208
|
+
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
1209
|
+
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
1210
|
+
typedArrayTags[uint32Tag] = true;
|
|
1211
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
|
|
1212
|
+
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
1213
|
+
typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
|
|
1214
|
+
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
1215
|
+
typedArrayTags[mapTag] = typedArrayTags[numberTag] =
|
|
1216
|
+
typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
|
|
1217
|
+
typedArrayTags[setTag] = typedArrayTags[stringTag] =
|
|
1218
|
+
typedArrayTags[weakMapTag] = false;
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
1222
|
+
*
|
|
1223
|
+
* @private
|
|
1224
|
+
* @param {*} value The value to check.
|
|
1225
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1226
|
+
*/
|
|
1227
|
+
function baseIsTypedArray(value) {
|
|
1228
|
+
return isObjectLike(value) &&
|
|
1229
|
+
isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
_baseIsTypedArray = baseIsTypedArray;
|
|
1233
|
+
return _baseIsTypedArray;
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
/**
|
|
1237
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
|
1238
|
+
*
|
|
1239
|
+
* @private
|
|
1240
|
+
* @param {Function} func The function to cap arguments for.
|
|
1241
|
+
* @returns {Function} Returns the new capped function.
|
|
1242
|
+
*/
|
|
1243
|
+
|
|
1244
|
+
var _baseUnary;
|
|
1245
|
+
var hasRequired_baseUnary;
|
|
1246
|
+
|
|
1247
|
+
function require_baseUnary () {
|
|
1248
|
+
if (hasRequired_baseUnary) return _baseUnary;
|
|
1249
|
+
hasRequired_baseUnary = 1;
|
|
1250
|
+
function baseUnary(func) {
|
|
1251
|
+
return function(value) {
|
|
1252
|
+
return func(value);
|
|
1253
|
+
};
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
_baseUnary = baseUnary;
|
|
1257
|
+
return _baseUnary;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
var _nodeUtil = {exports: {}};
|
|
1261
|
+
|
|
1262
|
+
_nodeUtil.exports;
|
|
1263
|
+
|
|
1264
|
+
var hasRequired_nodeUtil;
|
|
1265
|
+
|
|
1266
|
+
function require_nodeUtil () {
|
|
1267
|
+
if (hasRequired_nodeUtil) return _nodeUtil.exports;
|
|
1268
|
+
hasRequired_nodeUtil = 1;
|
|
1269
|
+
(function (module, exports) {
|
|
1270
|
+
var freeGlobal = require_freeGlobal();
|
|
1271
|
+
|
|
1272
|
+
/** Detect free variable `exports`. */
|
|
1273
|
+
var freeExports = exports && !exports.nodeType && exports;
|
|
1274
|
+
|
|
1275
|
+
/** Detect free variable `module`. */
|
|
1276
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1277
|
+
|
|
1278
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1279
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1280
|
+
|
|
1281
|
+
/** Detect free variable `process` from Node.js. */
|
|
1282
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
|
1283
|
+
|
|
1284
|
+
/** Used to access faster Node.js helpers. */
|
|
1285
|
+
var nodeUtil = (function() {
|
|
1286
|
+
try {
|
|
1287
|
+
// Use `util.types` for Node.js 10+.
|
|
1288
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
1289
|
+
|
|
1290
|
+
if (types) {
|
|
1291
|
+
return types;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
|
1295
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
1296
|
+
} catch (e) {}
|
|
1297
|
+
}());
|
|
1298
|
+
|
|
1299
|
+
module.exports = nodeUtil;
|
|
1300
|
+
} (_nodeUtil, _nodeUtil.exports));
|
|
1301
|
+
return _nodeUtil.exports;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
var isTypedArray_1;
|
|
1305
|
+
var hasRequiredIsTypedArray;
|
|
1306
|
+
|
|
1307
|
+
function requireIsTypedArray () {
|
|
1308
|
+
if (hasRequiredIsTypedArray) return isTypedArray_1;
|
|
1309
|
+
hasRequiredIsTypedArray = 1;
|
|
1310
|
+
var baseIsTypedArray = require_baseIsTypedArray(),
|
|
1311
|
+
baseUnary = require_baseUnary(),
|
|
1312
|
+
nodeUtil = require_nodeUtil();
|
|
1313
|
+
|
|
1314
|
+
/* Node.js helper references. */
|
|
1315
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
1316
|
+
|
|
1317
|
+
/**
|
|
1318
|
+
* Checks if `value` is classified as a typed array.
|
|
1319
|
+
*
|
|
1320
|
+
* @static
|
|
1321
|
+
* @memberOf _
|
|
1322
|
+
* @since 3.0.0
|
|
1323
|
+
* @category Lang
|
|
1324
|
+
* @param {*} value The value to check.
|
|
1325
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1326
|
+
* @example
|
|
1327
|
+
*
|
|
1328
|
+
* _.isTypedArray(new Uint8Array);
|
|
1329
|
+
* // => true
|
|
1330
|
+
*
|
|
1331
|
+
* _.isTypedArray([]);
|
|
1332
|
+
* // => false
|
|
1333
|
+
*/
|
|
1334
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
1335
|
+
|
|
1336
|
+
isTypedArray_1 = isTypedArray;
|
|
1337
|
+
return isTypedArray_1;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
var isEmpty_1;
|
|
1341
|
+
var hasRequiredIsEmpty;
|
|
1342
|
+
|
|
1343
|
+
function requireIsEmpty () {
|
|
1344
|
+
if (hasRequiredIsEmpty) return isEmpty_1;
|
|
1345
|
+
hasRequiredIsEmpty = 1;
|
|
1346
|
+
var baseKeys = require_baseKeys(),
|
|
1347
|
+
getTag = require_getTag(),
|
|
1348
|
+
isArguments = requireIsArguments(),
|
|
1349
|
+
isArray = requireIsArray(),
|
|
1350
|
+
isArrayLike = requireIsArrayLike(),
|
|
1351
|
+
isBuffer = requireIsBuffer(),
|
|
1352
|
+
isPrototype = require_isPrototype(),
|
|
1353
|
+
isTypedArray = requireIsTypedArray();
|
|
1354
|
+
|
|
1355
|
+
/** `Object#toString` result references. */
|
|
1356
|
+
var mapTag = '[object Map]',
|
|
1357
|
+
setTag = '[object Set]';
|
|
1358
|
+
|
|
1359
|
+
/** Used for built-in method references. */
|
|
1360
|
+
var objectProto = Object.prototype;
|
|
1361
|
+
|
|
1362
|
+
/** Used to check objects for own properties. */
|
|
1363
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Checks if `value` is an empty object, collection, map, or set.
|
|
1367
|
+
*
|
|
1368
|
+
* Objects are considered empty if they have no own enumerable string keyed
|
|
1369
|
+
* properties.
|
|
1370
|
+
*
|
|
1371
|
+
* Array-like values such as `arguments` objects, arrays, buffers, strings, or
|
|
1372
|
+
* jQuery-like collections are considered empty if they have a `length` of `0`.
|
|
1373
|
+
* Similarly, maps and sets are considered empty if they have a `size` of `0`.
|
|
1374
|
+
*
|
|
1375
|
+
* @static
|
|
1376
|
+
* @memberOf _
|
|
1377
|
+
* @since 0.1.0
|
|
1378
|
+
* @category Lang
|
|
1379
|
+
* @param {*} value The value to check.
|
|
1380
|
+
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
1381
|
+
* @example
|
|
1382
|
+
*
|
|
1383
|
+
* _.isEmpty(null);
|
|
1384
|
+
* // => true
|
|
1385
|
+
*
|
|
1386
|
+
* _.isEmpty(true);
|
|
1387
|
+
* // => true
|
|
1388
|
+
*
|
|
1389
|
+
* _.isEmpty(1);
|
|
1390
|
+
* // => true
|
|
1391
|
+
*
|
|
1392
|
+
* _.isEmpty([1, 2, 3]);
|
|
1393
|
+
* // => false
|
|
1394
|
+
*
|
|
1395
|
+
* _.isEmpty({ 'a': 1 });
|
|
1396
|
+
* // => false
|
|
1397
|
+
*/
|
|
1398
|
+
function isEmpty(value) {
|
|
1399
|
+
if (value == null) {
|
|
1400
|
+
return true;
|
|
1401
|
+
}
|
|
1402
|
+
if (isArrayLike(value) &&
|
|
1403
|
+
(isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
|
|
1404
|
+
isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
1405
|
+
return !value.length;
|
|
1406
|
+
}
|
|
1407
|
+
var tag = getTag(value);
|
|
1408
|
+
if (tag == mapTag || tag == setTag) {
|
|
1409
|
+
return !value.size;
|
|
1410
|
+
}
|
|
1411
|
+
if (isPrototype(value)) {
|
|
1412
|
+
return !baseKeys(value).length;
|
|
1413
|
+
}
|
|
1414
|
+
for (var key in value) {
|
|
1415
|
+
if (hasOwnProperty.call(value, key)) {
|
|
1416
|
+
return false;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
return true;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
isEmpty_1 = isEmpty;
|
|
1423
|
+
return isEmpty_1;
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
var isEmptyExports = requireIsEmpty();
|
|
1427
|
+
const _isEmpty = /*@__PURE__*/getDefaultExportFromCjs(isEmptyExports);
|
|
1428
|
+
|
|
1429
|
+
const textStyles = {
|
|
1430
|
+
fontWeight: {
|
|
1431
|
+
semibold: 590,
|
|
1432
|
+
regular: 400
|
|
1433
|
+
},
|
|
1434
|
+
letterSpacing: {
|
|
1435
|
+
default: "normal"
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
const drawerTypography = {
|
|
1440
|
+
fontFamily: "-apple-system,system-ui,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Fira Sans,Ubuntu,Oxygen,Oxygen Sans,Cantarell,Droid Sans,Apple Color Emoji,Segoe UI Emoji,Segoe UI Emoji,Segoe UI Symbol,Lucida Grande,Helvetica,Arial,sans-serif",
|
|
1441
|
+
displayL: {
|
|
1442
|
+
fontSize: "80px",
|
|
1443
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1444
|
+
lineHeight: "92px",
|
|
1445
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1446
|
+
},
|
|
1447
|
+
displayM: {
|
|
1448
|
+
fontSize: "40px",
|
|
1449
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1450
|
+
lineHeight: "52px",
|
|
1451
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1452
|
+
},
|
|
1453
|
+
headingL: {
|
|
1454
|
+
fontSize: "32px",
|
|
1455
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1456
|
+
lineHeight: "44px",
|
|
1457
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1458
|
+
},
|
|
1459
|
+
headingM: {
|
|
1460
|
+
fontSize: "28px",
|
|
1461
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1462
|
+
lineHeight: "40px",
|
|
1463
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1464
|
+
},
|
|
1465
|
+
headingS: {
|
|
1466
|
+
fontSize: "24px",
|
|
1467
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1468
|
+
lineHeight: "36px",
|
|
1469
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1470
|
+
},
|
|
1471
|
+
semiBoldLabelL: {
|
|
1472
|
+
fontSize: "20px",
|
|
1473
|
+
lineHeight: "28px",
|
|
1474
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1475
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1476
|
+
},
|
|
1477
|
+
semiBoldLabelM: {
|
|
1478
|
+
fontSize: "16px",
|
|
1479
|
+
lineHeight: "24px",
|
|
1480
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1481
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1482
|
+
},
|
|
1483
|
+
semiBoldLabelS: {
|
|
1484
|
+
fontSize: "14px",
|
|
1485
|
+
lineHeight: "20px",
|
|
1486
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1487
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1488
|
+
},
|
|
1489
|
+
semiBoldLabelXs: {
|
|
1490
|
+
fontSize: "12px",
|
|
1491
|
+
lineHeight: "16px",
|
|
1492
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1493
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1494
|
+
},
|
|
1495
|
+
semiBoldLabelXxs: {
|
|
1496
|
+
fontSize: "10px",
|
|
1497
|
+
lineHeight: "14px",
|
|
1498
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1499
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1500
|
+
},
|
|
1501
|
+
regularLabelL: {
|
|
1502
|
+
fontSize: "20px",
|
|
1503
|
+
lineHeight: "28px",
|
|
1504
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1505
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1506
|
+
},
|
|
1507
|
+
regularLabelM: {
|
|
1508
|
+
fontSize: "16px",
|
|
1509
|
+
lineHeight: "24px",
|
|
1510
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1511
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1512
|
+
},
|
|
1513
|
+
regularLabelS: {
|
|
1514
|
+
fontSize: "14px",
|
|
1515
|
+
lineHeight: "20px",
|
|
1516
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1517
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1518
|
+
},
|
|
1519
|
+
regularLabelXs: {
|
|
1520
|
+
fontSize: "12px",
|
|
1521
|
+
lineHeight: "16px",
|
|
1522
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1523
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1524
|
+
},
|
|
1525
|
+
regularLabelXxs: {
|
|
1526
|
+
fontSize: "10px",
|
|
1527
|
+
lineHeight: "14px",
|
|
1528
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1529
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1530
|
+
},
|
|
1531
|
+
textXl: {
|
|
1532
|
+
fontSize: "20px",
|
|
1533
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1534
|
+
lineHeight: "28px",
|
|
1535
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1536
|
+
},
|
|
1537
|
+
textL: {
|
|
1538
|
+
fontSize: "16px",
|
|
1539
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1540
|
+
lineHeight: "24px",
|
|
1541
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1542
|
+
},
|
|
1543
|
+
textM: {
|
|
1544
|
+
fontSize: "14px",
|
|
1545
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1546
|
+
lineHeight: "20px",
|
|
1547
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1548
|
+
},
|
|
1549
|
+
subtextM: {
|
|
1550
|
+
fontSize: "12px",
|
|
1551
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1552
|
+
lineHeight: "16px",
|
|
1553
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1554
|
+
},
|
|
1555
|
+
subtextS: {
|
|
1556
|
+
fontSize: "10px",
|
|
1557
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1558
|
+
lineHeight: "14px",
|
|
1559
|
+
letterSpacing: textStyles.letterSpacing.default
|
|
1560
|
+
},
|
|
1561
|
+
semiBoldLinkXL: {
|
|
1562
|
+
fontSize: "20px",
|
|
1563
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1564
|
+
lineHeight: "28px",
|
|
1565
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1566
|
+
textDecoration: "underline"
|
|
1567
|
+
},
|
|
1568
|
+
semiBoldLinkL: {
|
|
1569
|
+
fontSize: "16px",
|
|
1570
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1571
|
+
lineHeight: "24px",
|
|
1572
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1573
|
+
textDecoration: "underline"
|
|
1574
|
+
},
|
|
1575
|
+
semiBoldLinkM: {
|
|
1576
|
+
fontSize: "14px",
|
|
1577
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1578
|
+
lineHeight: "20px",
|
|
1579
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1580
|
+
textDecoration: "underline"
|
|
1581
|
+
},
|
|
1582
|
+
semiBoldLinkS: {
|
|
1583
|
+
fontSize: "12px",
|
|
1584
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1585
|
+
lineHeight: "16px",
|
|
1586
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1587
|
+
textDecoration: "underline"
|
|
1588
|
+
},
|
|
1589
|
+
semiBoldLinkXs: {
|
|
1590
|
+
fontSize: "10px",
|
|
1591
|
+
fontWeight: textStyles.fontWeight.semibold,
|
|
1592
|
+
lineHeight: "14px",
|
|
1593
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1594
|
+
textDecoration: "underline"
|
|
1595
|
+
},
|
|
1596
|
+
regularLinkXL: {
|
|
1597
|
+
fontSize: "20px",
|
|
1598
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1599
|
+
lineHeight: "20px",
|
|
1600
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1601
|
+
textDecoration: "underline"
|
|
1602
|
+
},
|
|
1603
|
+
regularLinkL: {
|
|
1604
|
+
fontSize: "16px",
|
|
1605
|
+
fontWeight: textStyles.fontWeight.regular,
|
|
1606
|
+
lineHeight: "24px",
|
|
1607
|
+
letterSpacing: textStyles.letterSpacing.default,
|
|
1608
|
+
textDecoration: "underline"
|
|
1609
|
+
},
|
|
1610
|
+
h1: {
|
|
1611
|
+
fontSize: "26px",
|
|
1612
|
+
fontWeight: 590,
|
|
1613
|
+
lineHeight: "32px"
|
|
1614
|
+
},
|
|
1615
|
+
h2: {
|
|
1616
|
+
fontSize: "22px",
|
|
1617
|
+
fontWeight: 590,
|
|
1618
|
+
lineHeight: "26px"
|
|
1619
|
+
},
|
|
1620
|
+
h3: {
|
|
1621
|
+
fontSize: "17px",
|
|
1622
|
+
fontWeight: 590,
|
|
1623
|
+
lineHeight: "22px"
|
|
1624
|
+
},
|
|
1625
|
+
h4: {
|
|
1626
|
+
fontSize: "15px",
|
|
1627
|
+
fontWeight: 590,
|
|
1628
|
+
lineHeight: "20px"
|
|
1629
|
+
},
|
|
1630
|
+
h5: {
|
|
1631
|
+
fontSize: "14px",
|
|
1632
|
+
fontWeight: 590,
|
|
1633
|
+
lineHeight: "20px"
|
|
1634
|
+
},
|
|
1635
|
+
headline: {
|
|
1636
|
+
fontSize: "13px",
|
|
1637
|
+
fontWeight: 590,
|
|
1638
|
+
lineHeight: "16px"
|
|
1639
|
+
},
|
|
1640
|
+
body: {
|
|
1641
|
+
fontSize: "13px",
|
|
1642
|
+
lineHeight: "16px",
|
|
1643
|
+
fontWeight: 400
|
|
1644
|
+
},
|
|
1645
|
+
callout: {
|
|
1646
|
+
fontSize: "13px",
|
|
1647
|
+
fontWeight: 510,
|
|
1648
|
+
lineHeight: "15px"
|
|
1649
|
+
},
|
|
1650
|
+
subHeadline1: {
|
|
1651
|
+
fontSize: "14px",
|
|
1652
|
+
lineHeight: "20px",
|
|
1653
|
+
fontWeight: 400
|
|
1654
|
+
},
|
|
1655
|
+
subHeadline2: {
|
|
1656
|
+
fontSize: "13px",
|
|
1657
|
+
lineHeight: "20px",
|
|
1658
|
+
fontWeight: 400
|
|
1659
|
+
},
|
|
1660
|
+
footNote: {
|
|
1661
|
+
fontSize: "12px",
|
|
1662
|
+
lineHeight: "13px",
|
|
1663
|
+
fontWeight: 400
|
|
1664
|
+
},
|
|
1665
|
+
caption1: {
|
|
1666
|
+
fontSize: "10px",
|
|
1667
|
+
lineHeight: "13px",
|
|
1668
|
+
fontWeight: 400
|
|
1669
|
+
},
|
|
1670
|
+
caption2: {
|
|
1671
|
+
fontSize: "10px",
|
|
1672
|
+
lineHeight: "13px",
|
|
1673
|
+
fontWeight: 510
|
|
1674
|
+
}
|
|
1675
|
+
};
|
|
1676
|
+
const muiTheme = createTheme({
|
|
1677
|
+
palette: {
|
|
1678
|
+
primary: {
|
|
1679
|
+
main: "#1E221E",
|
|
1680
|
+
contrastText: "#ffffff"
|
|
1681
|
+
},
|
|
1682
|
+
secondary: {
|
|
1683
|
+
main: "#0A9083",
|
|
1684
|
+
contrastText: "#000000"
|
|
1685
|
+
},
|
|
1686
|
+
error: {
|
|
1687
|
+
main: "#ED1D31",
|
|
1688
|
+
contrastText: "#ffffff"
|
|
1689
|
+
},
|
|
1690
|
+
warning: {
|
|
1691
|
+
main: "#F3800D",
|
|
1692
|
+
contrastText: "#000000"
|
|
1693
|
+
},
|
|
1694
|
+
info: {
|
|
1695
|
+
main: "#0881EA",
|
|
1696
|
+
contrastText: "#000000"
|
|
1697
|
+
},
|
|
1698
|
+
success: {
|
|
1699
|
+
main: "#0AB22C",
|
|
1700
|
+
contrastText: "#000000"
|
|
1701
|
+
},
|
|
1702
|
+
background: {
|
|
1703
|
+
default: "#F7F9FC"
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
typography: drawerTypography,
|
|
1707
|
+
components: {
|
|
1708
|
+
MuiTypography: {
|
|
1709
|
+
defaultProps: {
|
|
1710
|
+
variantMapping: {
|
|
1711
|
+
h1: "h1",
|
|
1712
|
+
h2: "h2",
|
|
1713
|
+
h3: "h3",
|
|
1714
|
+
h4: "h4",
|
|
1715
|
+
headline: "h5",
|
|
1716
|
+
body: "span",
|
|
1717
|
+
callout: "span",
|
|
1718
|
+
subHeadline1: "span",
|
|
1719
|
+
subHeadline2: "span",
|
|
1720
|
+
footNote: "span",
|
|
1721
|
+
caption1: "span",
|
|
1722
|
+
caption2: "span"
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
MuiButton: {
|
|
1727
|
+
defaultProps: {
|
|
1728
|
+
disableElevation: true,
|
|
1729
|
+
size: "large"
|
|
1730
|
+
},
|
|
1731
|
+
styleOverrides: {
|
|
1732
|
+
root: {
|
|
1733
|
+
textTransform: "none",
|
|
1734
|
+
fontSize: "14px",
|
|
1735
|
+
borderRadius: "8px"
|
|
1736
|
+
},
|
|
1737
|
+
text: {
|
|
1738
|
+
textDecoration: "underline",
|
|
1739
|
+
"&:hover": {
|
|
1740
|
+
backgroundColor: "transparent",
|
|
1741
|
+
textDecoration: "underline"
|
|
1742
|
+
},
|
|
1743
|
+
padding: "0px 8px",
|
|
1744
|
+
textAlign: "left"
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
},
|
|
1748
|
+
MuiTab: {
|
|
1749
|
+
styleOverrides: {
|
|
1750
|
+
root: {
|
|
1751
|
+
textTransform: "none",
|
|
1752
|
+
fontSize: "14px"
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
MuiChip: {
|
|
1757
|
+
defaultProps: {
|
|
1758
|
+
size: "small"
|
|
1759
|
+
},
|
|
1760
|
+
styleOverrides: {
|
|
1761
|
+
root: {
|
|
1762
|
+
paddingLeft: "5px",
|
|
1763
|
+
paddingRight: "5px"
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
},
|
|
1767
|
+
MuiPaper: {
|
|
1768
|
+
styleOverrides: {
|
|
1769
|
+
root: {
|
|
1770
|
+
borderRadius: "16px"
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
},
|
|
1774
|
+
MuiCard: {
|
|
1775
|
+
defaultProps: {
|
|
1776
|
+
variant: "outlined"
|
|
1777
|
+
},
|
|
1778
|
+
styleOverrides: {
|
|
1779
|
+
root: {
|
|
1780
|
+
borderRadius: "16px"
|
|
1781
|
+
}
|
|
1782
|
+
}
|
|
1783
|
+
},
|
|
1784
|
+
MuiAutocomplete: {
|
|
1785
|
+
styleOverrides: {
|
|
1786
|
+
root: {
|
|
1787
|
+
"& .MuiAutocomplete-inputRoot": {
|
|
1788
|
+
paddingLeft: "14px"
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
},
|
|
1793
|
+
MuiLink: {
|
|
1794
|
+
styleOverrides: {
|
|
1795
|
+
root: {
|
|
1796
|
+
fontWeight: "bold",
|
|
1797
|
+
"&:hover": {
|
|
1798
|
+
cursor: "pointer"
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
defaultProps: {
|
|
1803
|
+
variant: "body"
|
|
1804
|
+
}
|
|
1805
|
+
},
|
|
1806
|
+
MuiTextField: {
|
|
1807
|
+
styleOverrides: {
|
|
1808
|
+
root: {
|
|
1809
|
+
"& .MuiInputBase-root": {
|
|
1810
|
+
borderRadius: "8px"
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
},
|
|
1815
|
+
MuiFormControl: {
|
|
1816
|
+
styleOverrides: {
|
|
1817
|
+
root: {
|
|
1818
|
+
"& .MuiInputBase-root": {
|
|
1819
|
+
borderRadius: "8px"
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
},
|
|
1824
|
+
MuiDrawer: {
|
|
1825
|
+
styleOverrides: {
|
|
1826
|
+
paper: {
|
|
1827
|
+
borderRadius: 0
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
|
|
1834
|
+
const DRAWER_TYPES = {
|
|
1835
|
+
INFORMATION: "information",
|
|
1836
|
+
INPUT: "input"
|
|
1837
|
+
};
|
|
1838
|
+
const INFORMATION_SUBTYPES = {
|
|
1839
|
+
PROGRESS: "progress",
|
|
1840
|
+
PASSIVE: "passive"
|
|
1841
|
+
};
|
|
1842
|
+
const INPUT_SUBTYPES = {
|
|
1843
|
+
DEFAULT: "default",
|
|
1844
|
+
DESTRUCTIVE: "destructive"
|
|
1845
|
+
};
|
|
1846
|
+
const DRAWER_CONFIGS = {
|
|
1847
|
+
[DRAWER_TYPES.INFORMATION]: {
|
|
1848
|
+
[INFORMATION_SUBTYPES.PROGRESS]: {
|
|
1849
|
+
DISMISSIBLE: "partial"
|
|
1850
|
+
},
|
|
1851
|
+
[INFORMATION_SUBTYPES.PASSIVE]: {
|
|
1852
|
+
DISMISSIBLE: "full"
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
[DRAWER_TYPES.INPUT]: {
|
|
1856
|
+
[INPUT_SUBTYPES.DEFAULT]: {
|
|
1857
|
+
DISMISSIBLE: "partial"
|
|
1858
|
+
},
|
|
1859
|
+
[INPUT_SUBTYPES.DESTRUCTIVE]: {
|
|
1860
|
+
DISMISSIBLE: "partial"
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
const TERTIARY_CTA_TYPES = {
|
|
1865
|
+
DEFAULT: "default",
|
|
1866
|
+
DESTRUCTIVE: "destructive"
|
|
1867
|
+
};
|
|
1868
|
+
|
|
1869
|
+
const MuiDrawer = (props) => {
|
|
1870
|
+
const [actionsMaxWidth, setActionsMaxWidth] = useState("50%");
|
|
1871
|
+
const drawerRef = useRef(null);
|
|
1872
|
+
const parentTheme = useTheme();
|
|
1873
|
+
const currentTheme = _isEmpty(parentTheme) ? muiTheme : {
|
|
1874
|
+
...parentTheme,
|
|
1875
|
+
typography: {
|
|
1876
|
+
...parentTheme.typography,
|
|
1877
|
+
...drawerTypography
|
|
1878
|
+
}
|
|
1879
|
+
};
|
|
1880
|
+
const subtype = props.type === DRAWER_TYPES.INFORMATION ? props.subtype : props.type === DRAWER_TYPES.INPUT ? props.subtype : "default";
|
|
1881
|
+
const {
|
|
1882
|
+
anchor = "right",
|
|
1883
|
+
wrapperClassName,
|
|
1884
|
+
bodyWrapperClassName,
|
|
1885
|
+
open,
|
|
1886
|
+
type,
|
|
1887
|
+
title,
|
|
1888
|
+
subTitle,
|
|
1889
|
+
description,
|
|
1890
|
+
onClose,
|
|
1891
|
+
children,
|
|
1892
|
+
actions,
|
|
1893
|
+
width,
|
|
1894
|
+
maxWidth,
|
|
1895
|
+
showActions = true,
|
|
1896
|
+
showDivider = true,
|
|
1897
|
+
showCloseIcon = true,
|
|
1898
|
+
tertiaryCtaType = "default",
|
|
1899
|
+
...rest
|
|
1900
|
+
} = props;
|
|
1901
|
+
const {
|
|
1902
|
+
primaryCtaTitle,
|
|
1903
|
+
secondaryCtaTitle,
|
|
1904
|
+
isPrimaryCtaLoading = false,
|
|
1905
|
+
isPrimaryCtaDisabled,
|
|
1906
|
+
isSecondaryCtaLoading = false,
|
|
1907
|
+
isSecondaryCtaDisabled,
|
|
1908
|
+
onPrimaryCtaClick = _noop,
|
|
1909
|
+
onSecondaryCtaClick = _noop,
|
|
1910
|
+
tertiaryCtaTitle,
|
|
1911
|
+
tertiaryCtaStartIcon,
|
|
1912
|
+
isTertiaryCtaLoading = false,
|
|
1913
|
+
isTertiaryCtaDisabled,
|
|
1914
|
+
onTertiaryCtaClick = _noop,
|
|
1915
|
+
primaryCtaTooltipText,
|
|
1916
|
+
secondaryCtaTooltipText,
|
|
1917
|
+
tertiaryCtaTooltipText
|
|
1918
|
+
} = actions || {};
|
|
1919
|
+
const config = DRAWER_CONFIGS[type][subtype] || DRAWER_CONFIGS[type].default;
|
|
1920
|
+
const showFooter = showActions && (primaryCtaTitle || secondaryCtaTitle || tertiaryCtaTitle);
|
|
1921
|
+
const footerCtaCount = [
|
|
1922
|
+
primaryCtaTitle,
|
|
1923
|
+
secondaryCtaTitle,
|
|
1924
|
+
tertiaryCtaTitle
|
|
1925
|
+
].filter(Boolean).length;
|
|
1926
|
+
const handleClose = () => {
|
|
1927
|
+
if (config?.DISMISSIBLE === "full") {
|
|
1928
|
+
onClose();
|
|
1929
|
+
}
|
|
1930
|
+
};
|
|
1931
|
+
useEffect(() => {
|
|
1932
|
+
const timer = setTimeout(() => {
|
|
1933
|
+
if (drawerRef.current) {
|
|
1934
|
+
const width2 = drawerRef.current.getBoundingClientRect().width;
|
|
1935
|
+
if (width2 < 600) setActionsMaxWidth("100%");
|
|
1936
|
+
if (width2 >= 600) setActionsMaxWidth("50%");
|
|
1937
|
+
if (width2 >= 900) setActionsMaxWidth("33%");
|
|
1938
|
+
if (width2 >= 1200) setActionsMaxWidth("25%");
|
|
1939
|
+
}
|
|
1940
|
+
}, 0);
|
|
1941
|
+
return () => clearTimeout(timer);
|
|
1942
|
+
}, [drawerRef.current]);
|
|
1943
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: currentTheme, children: /* @__PURE__ */ jsx(
|
|
1944
|
+
Drawer,
|
|
1945
|
+
{
|
|
1946
|
+
className: classNames("vi-drawer", wrapperClassName),
|
|
1947
|
+
open,
|
|
1948
|
+
anchor,
|
|
1949
|
+
onClose: handleClose,
|
|
1950
|
+
...rest,
|
|
1951
|
+
children: /* @__PURE__ */ jsxs("div", { ref: drawerRef, style: { width, maxWidth }, className: "h-fill", children: [
|
|
1952
|
+
title && /* @__PURE__ */ jsxs("div", { className: "vi-drawer-title", children: [
|
|
1953
|
+
/* @__PURE__ */ jsxs("div", { className: "d-f ai-c jc-sb", children: [
|
|
1954
|
+
/* @__PURE__ */ jsxs("div", { className: "d-f flex-dir-col gap-8", children: [
|
|
1955
|
+
/* @__PURE__ */ jsx(Typography, { variant: "semiBoldLabelL", children: title }),
|
|
1956
|
+
subTitle && /* @__PURE__ */ jsx(Typography, { variant: "subtextM", children: subTitle })
|
|
1957
|
+
] }),
|
|
1958
|
+
showCloseIcon && /* @__PURE__ */ jsx(
|
|
1959
|
+
CloseIcon,
|
|
1960
|
+
{
|
|
1961
|
+
fontSize: "small",
|
|
1962
|
+
className: "close-icon",
|
|
1963
|
+
"aria-label": "Close drawer",
|
|
1964
|
+
onClick: onClose
|
|
1965
|
+
}
|
|
1966
|
+
)
|
|
1967
|
+
] }),
|
|
1968
|
+
description && /* @__PURE__ */ jsx(
|
|
1969
|
+
Typography,
|
|
1970
|
+
{
|
|
1971
|
+
component: "div",
|
|
1972
|
+
className: "description",
|
|
1973
|
+
variant: "subtextM",
|
|
1974
|
+
children: description
|
|
1975
|
+
}
|
|
1976
|
+
)
|
|
1977
|
+
] }),
|
|
1978
|
+
/* @__PURE__ */ jsx(
|
|
1979
|
+
"div",
|
|
1980
|
+
{
|
|
1981
|
+
className: classNames(
|
|
1982
|
+
"drawer-children",
|
|
1983
|
+
title && showFooter ? "with-header-footer" : title ? "with-header" : showFooter ? "with-footer" : "",
|
|
1984
|
+
footerCtaCount === 3 ? "three-ctas" : "",
|
|
1985
|
+
footerCtaCount === 2 ? "two-ctas" : "",
|
|
1986
|
+
footerCtaCount === 1 ? "one-cta" : "",
|
|
1987
|
+
showFooter && !showDivider ? "no-divider" : "",
|
|
1988
|
+
bodyWrapperClassName
|
|
1989
|
+
),
|
|
1990
|
+
children
|
|
1991
|
+
}
|
|
1992
|
+
),
|
|
1993
|
+
showFooter && /* @__PURE__ */ jsxs(
|
|
1994
|
+
"div",
|
|
1995
|
+
{
|
|
1996
|
+
className: classNames(
|
|
1997
|
+
"vi-drawer-actions",
|
|
1998
|
+
showDivider ? "divider" : "",
|
|
1999
|
+
tertiaryCtaTitle ? "tertiary-cta" : ""
|
|
2000
|
+
),
|
|
2001
|
+
children: [
|
|
2002
|
+
tertiaryCtaTitle && /* @__PURE__ */ jsx(
|
|
2003
|
+
Tooltip,
|
|
2004
|
+
{
|
|
2005
|
+
title: isTertiaryCtaDisabled ? tertiaryCtaTooltipText : "",
|
|
2006
|
+
arrow: true,
|
|
2007
|
+
children: /* @__PURE__ */ jsx(
|
|
2008
|
+
LoadingButton,
|
|
2009
|
+
{
|
|
2010
|
+
className: classNames(
|
|
2011
|
+
tertiaryCtaType === TERTIARY_CTA_TYPES.DESTRUCTIVE ? "tertiary-cta-destructive" : ""
|
|
2012
|
+
),
|
|
2013
|
+
variant: "text",
|
|
2014
|
+
onClick: onTertiaryCtaClick,
|
|
2015
|
+
startIcon: tertiaryCtaStartIcon,
|
|
2016
|
+
loading: isTertiaryCtaLoading,
|
|
2017
|
+
disabled: isTertiaryCtaDisabled !== void 0 ? isTertiaryCtaDisabled : !!(isPrimaryCtaLoading || isSecondaryCtaLoading),
|
|
2018
|
+
children: tertiaryCtaTitle
|
|
2019
|
+
}
|
|
2020
|
+
)
|
|
2021
|
+
}
|
|
2022
|
+
),
|
|
2023
|
+
/* @__PURE__ */ jsxs(
|
|
2024
|
+
"div",
|
|
2025
|
+
{
|
|
2026
|
+
style: { width: actionsMaxWidth },
|
|
2027
|
+
className: "vi-drawer-action-ctas",
|
|
2028
|
+
children: [
|
|
2029
|
+
secondaryCtaTitle && /* @__PURE__ */ jsx(
|
|
2030
|
+
Tooltip,
|
|
2031
|
+
{
|
|
2032
|
+
title: isSecondaryCtaDisabled ? secondaryCtaTooltipText : "",
|
|
2033
|
+
arrow: true,
|
|
2034
|
+
children: /* @__PURE__ */ jsx(
|
|
2035
|
+
LoadingButton,
|
|
2036
|
+
{
|
|
2037
|
+
className: "vi-drawer-cta",
|
|
2038
|
+
variant: "outlined",
|
|
2039
|
+
onClick: onSecondaryCtaClick,
|
|
2040
|
+
loading: isSecondaryCtaLoading,
|
|
2041
|
+
disabled: isSecondaryCtaDisabled !== void 0 ? isSecondaryCtaDisabled : !!(isPrimaryCtaLoading || isTertiaryCtaLoading),
|
|
2042
|
+
children: secondaryCtaTitle
|
|
2043
|
+
}
|
|
2044
|
+
)
|
|
2045
|
+
}
|
|
2046
|
+
),
|
|
2047
|
+
primaryCtaTitle && /* @__PURE__ */ jsx(
|
|
2048
|
+
Tooltip,
|
|
2049
|
+
{
|
|
2050
|
+
title: isPrimaryCtaDisabled ? primaryCtaTooltipText : "",
|
|
2051
|
+
arrow: true,
|
|
2052
|
+
children: /* @__PURE__ */ jsx(
|
|
2053
|
+
LoadingButton,
|
|
2054
|
+
{
|
|
2055
|
+
className: classNames(
|
|
2056
|
+
"vi-drawer-cta",
|
|
2057
|
+
subtype === "destructive" ? "destructive" : ""
|
|
2058
|
+
),
|
|
2059
|
+
variant: "contained",
|
|
2060
|
+
onClick: onPrimaryCtaClick,
|
|
2061
|
+
loading: isPrimaryCtaLoading,
|
|
2062
|
+
disabled: isPrimaryCtaDisabled !== void 0 ? isPrimaryCtaDisabled : !!(isSecondaryCtaLoading || isTertiaryCtaLoading),
|
|
2063
|
+
children: primaryCtaTitle
|
|
2064
|
+
}
|
|
2065
|
+
)
|
|
2066
|
+
}
|
|
2067
|
+
)
|
|
2068
|
+
]
|
|
2069
|
+
}
|
|
2070
|
+
)
|
|
2071
|
+
]
|
|
2072
|
+
}
|
|
2073
|
+
)
|
|
2074
|
+
] })
|
|
2075
|
+
}
|
|
2076
|
+
) });
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
export { DRAWER_CONFIGS, DRAWER_TYPES, INFORMATION_SUBTYPES, INPUT_SUBTYPES, MuiDrawer, TERTIARY_CTA_TYPES };
|