@geneui/components 2.11.1

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.
Files changed (154) hide show
  1. package/ActionableList.js +1761 -0
  2. package/AdvancedSearch.js +872 -0
  3. package/Alert.js +98 -0
  4. package/Avatar.js +77 -0
  5. package/Badge.js +76 -0
  6. package/Breadcrumb.js +128 -0
  7. package/BusyLoader.js +69 -0
  8. package/Button.js +130 -0
  9. package/CHANGELOG.md +424 -0
  10. package/Card.js +513 -0
  11. package/CardList.js +705 -0
  12. package/CellMeasurerCache-c11cec83.js +229 -0
  13. package/Charts.js +99 -0
  14. package/Checkbox.js +232 -0
  15. package/CheckboxGroup.js +206 -0
  16. package/CheckboxGroupWithSearch.js +279 -0
  17. package/Collapse.js +196 -0
  18. package/ColorPicker.js +210 -0
  19. package/ComboBox.js +99 -0
  20. package/Counter.js +99 -0
  21. package/DateFilter.js +179 -0
  22. package/DatePicker.js +1231 -0
  23. package/DatePickerInput.js +30 -0
  24. package/Divider.js +56 -0
  25. package/Drawer.js +264 -0
  26. package/Dropdown.js +99 -0
  27. package/Editor.js +22965 -0
  28. package/Empty.js +132 -0
  29. package/ExtendedInput.js +578 -0
  30. package/Form.js +116 -0
  31. package/FormContainer.js +189 -0
  32. package/FormableCheckbox.js +27 -0
  33. package/FormableDatePicker.js +39 -0
  34. package/FormableDropdown.js +105 -0
  35. package/FormableEditor.js +24 -0
  36. package/FormableHOC-21051057.js +83 -0
  37. package/FormableMultiSelectDropdown.js +105 -0
  38. package/FormableNumberInput.js +31 -0
  39. package/FormableRadio.js +23 -0
  40. package/FormableSwitcher.js +23 -0
  41. package/FormableTextInput.js +31 -0
  42. package/FormableUploader.js +40 -0
  43. package/GeneUIProvider.js +256 -0
  44. package/Grid.js +166 -0
  45. package/Holder.js +99 -0
  46. package/Icon.js +63 -0
  47. package/Image.js +130 -0
  48. package/ImagePreview.js +99 -0
  49. package/KeyValue.js +63 -0
  50. package/Label.js +58 -0
  51. package/LinkButton.js +104 -0
  52. package/Menu.js +277 -0
  53. package/MobileNavigation.js +95 -0
  54. package/MobilePopup.js +180 -0
  55. package/Modal.js +251 -0
  56. package/ModuleTitle.js +99 -0
  57. package/NavigationMenu.js +212 -0
  58. package/Notification.js +120 -0
  59. package/Option.js +186 -0
  60. package/Overlay.js +99 -0
  61. package/Overspread.js +343 -0
  62. package/Pagination.js +258 -0
  63. package/Paper.js +97 -0
  64. package/Popover-f4d1cac0.js +411 -0
  65. package/Popover.js +20 -0
  66. package/PopoverV2.js +19 -0
  67. package/Portal.js +58 -0
  68. package/Products.js +115 -0
  69. package/Profile.js +99 -0
  70. package/Progress.js +200 -0
  71. package/QRCode.js +816 -0
  72. package/README.md +90 -0
  73. package/Radio.js +152 -0
  74. package/RadioGroup.js +105 -0
  75. package/Range.js +14 -0
  76. package/RichEditor-b7928765.js +228 -0
  77. package/RichEditor.js +13 -0
  78. package/Scrollbar.js +1587 -0
  79. package/Search.js +72 -0
  80. package/SearchWithDropdown.js +195 -0
  81. package/Section.js +62 -0
  82. package/SkeletonLoader.js +82 -0
  83. package/Slider.js +256 -0
  84. package/Status.js +104 -0
  85. package/Steps.js +312 -0
  86. package/SuggestionList.js +15 -0
  87. package/Switcher.js +194 -0
  88. package/Table.js +102 -0
  89. package/TableCompositions.js +17028 -0
  90. package/Tabs.js +236 -0
  91. package/Tag.js +103 -0
  92. package/TextLink.js +22 -0
  93. package/Textarea.js +239 -0
  94. package/Time.js +63 -0
  95. package/TimePicker.js +99 -0
  96. package/Timeline.js +114 -0
  97. package/Title.js +66 -0
  98. package/Toaster.js +116 -0
  99. package/Tooltip.js +157 -0
  100. package/TransferList.js +502 -0
  101. package/Uploader.js +32 -0
  102. package/ValidatableCheckbox.js +126 -0
  103. package/ValidatableDatePicker.js +312 -0
  104. package/ValidatableDropdown.js +99 -0
  105. package/ValidatableElements.js +99 -0
  106. package/ValidatableMultiSelectDropdown.js +99 -0
  107. package/ValidatableNumberInput.js +194 -0
  108. package/ValidatableRadio.js +117 -0
  109. package/ValidatableSwitcher.js +94 -0
  110. package/ValidatableTextInput.js +164 -0
  111. package/ValidatableTimeInput.js +171 -0
  112. package/ValidatableUploader.js +94 -0
  113. package/Widget.js +99 -0
  114. package/_commonjsHelpers-24198af3.js +35 -0
  115. package/_rollupPluginBabelHelpers-e8fb2e5c.js +16 -0
  116. package/checkTimeValidation-e56771be.js +16 -0
  117. package/checkboxRadioSwitcher-5b69d7bd.js +4 -0
  118. package/clsx.m-2bb6df4b.js +3 -0
  119. package/configs-91c86664.js +96 -0
  120. package/configs.js +131 -0
  121. package/dateValidation-67caec66.js +225 -0
  122. package/debounce-4419bc2f.js +17 -0
  123. package/globalStyling-9c60a159.js +4 -0
  124. package/guid-8ddf77b3.js +16 -0
  125. package/index-00fe8887.js +193 -0
  126. package/index-0cf65939.js +30991 -0
  127. package/index-122432cd.js +270 -0
  128. package/index-262edd7a.js +77 -0
  129. package/index-5cea9a7d.js +407 -0
  130. package/index-5e722d91.js +867 -0
  131. package/index-67f4d4d1.js +6568 -0
  132. package/index-6ff23041.js +66 -0
  133. package/index-702bf24a.js +1938 -0
  134. package/index-a4635754.js +329 -0
  135. package/index-a59530cd.js +4 -0
  136. package/index-ac59cb10.js +169 -0
  137. package/index-b7a33c58.js +11 -0
  138. package/index-d9e8a888.js +987 -0
  139. package/index-e0af0caf.js +1182 -0
  140. package/index-e8776f3d.js +807 -0
  141. package/index.js +128 -0
  142. package/localization-4ba17032.js +46 -0
  143. package/objectWithoutPropertiesLoose-299691d8.js +78 -0
  144. package/package.json +190 -0
  145. package/rangeAndSlider-20599da4.js +8839 -0
  146. package/react-beautiful-dnd.esm-38c37304.js +10117 -0
  147. package/style-inject.es-746bb8ed.js +28 -0
  148. package/useClickOutside-5183e396.js +25 -0
  149. package/useDeviceType-dd51db38.js +15 -0
  150. package/useEllipsisDetection-ef536015.js +23 -0
  151. package/useKeyDown-38102ae7.js +21 -0
  152. package/useMount-6fef51a5.js +9 -0
  153. package/useWidth-9f4647f8.js +15 -0
  154. package/useWindowSize-80369d76.js +33 -0
@@ -0,0 +1,1761 @@
1
+ import { _ as _extends } from './_rollupPluginBabelHelpers-e8fb2e5c.js';
2
+ import React__default, { useRef, useState, useMemo, useCallback, useEffect, forwardRef, useImperativeHandle } from 'react';
3
+ import { p as propTypesExports } from './index-e0af0caf.js';
4
+ import { P as PublicDraggable, C as ConnectedDroppable, D as DragDropContext } from './react-beautiful-dnd.esm-38c37304.js';
5
+ import './globalStyling-9c60a159.js';
6
+ import { s as styleInject } from './style-inject.es-746bb8ed.js';
7
+ import { n as noop } from './index-ac59cb10.js';
8
+ import CustomScrollbar from './Scrollbar.js';
9
+ import './TextLink.js';
10
+ import Button from './Button.js';
11
+ import './Label.js';
12
+ import Icon from './Icon.js';
13
+ import './Switcher.js';
14
+ import './Divider.js';
15
+ import './Radio.js';
16
+ import './Paper.js';
17
+ import './Portal.js';
18
+ import './Avatar.js';
19
+ import './Badge.js';
20
+ import BusyLoader from './BusyLoader.js';
21
+ import './index-0cf65939.js';
22
+ import './SkeletonLoader.js';
23
+ import './Time.js';
24
+ import Empty from './Empty.js';
25
+ import './index-a4635754.js';
26
+ import './index-702bf24a.js';
27
+ import './Title.js';
28
+ import './Image.js';
29
+ import './KeyValue.js';
30
+ import './Option.js';
31
+ import './QRCode.js';
32
+ import './Grid.js';
33
+ import './Tabs.js';
34
+ import './Steps.js';
35
+ import './Timeline.js';
36
+ import './RadioGroup.js';
37
+ import Checkbox from './Checkbox.js';
38
+ import './Card.js';
39
+ import './Tag.js';
40
+ import './Alert.js';
41
+ import Tooltip from './Tooltip.js';
42
+ import './index-00fe8887.js';
43
+ import './Slider.js';
44
+ import './Pagination.js';
45
+ import ExtendedInput from './ExtendedInput.js';
46
+ import './Editor.js';
47
+ import './ValidatableUploader.js';
48
+ import './ValidatableRadio.js';
49
+ import './ValidatableCheckbox.js';
50
+ import './ValidatableSwitcher.js';
51
+ import './ValidatableNumberInput.js';
52
+ import './ValidatableTextInput.js';
53
+ import './ValidatableDatePicker.js';
54
+ import './Notification.js';
55
+ import './Modal.js';
56
+ import './Collapse.js';
57
+ import './Status.js';
58
+ import './Menu.js';
59
+ import './Progress.js';
60
+ import './MobileNavigation.js';
61
+ import './MobilePopup.js';
62
+ import './index-d9e8a888.js';
63
+ import './Products.js';
64
+ import './Search.js';
65
+ import './index-5e722d91.js';
66
+ import './Breadcrumb.js';
67
+ import './Section.js';
68
+ import './ColorPicker.js';
69
+ import './NavigationMenu.js';
70
+ import './Textarea.js';
71
+ import './AdvancedSearch.js';
72
+ import { c as commonjsGlobal } from './_commonjsHelpers-24198af3.js';
73
+ import './objectWithoutPropertiesLoose-299691d8.js';
74
+ import './index-e8776f3d.js';
75
+ import 'react-dom';
76
+ import './dateValidation-67caec66.js';
77
+ import './index-6ff23041.js';
78
+ import './configs-91c86664.js';
79
+ import './useKeyDown-38102ae7.js';
80
+ import './checkboxRadioSwitcher-5b69d7bd.js';
81
+ import './guid-8ddf77b3.js';
82
+ import './GeneUIProvider.js';
83
+ import './configs.js';
84
+ import './useEllipsisDetection-ef536015.js';
85
+ import './useMount-6fef51a5.js';
86
+ import './rangeAndSlider-20599da4.js';
87
+ import './clsx.m-2bb6df4b.js';
88
+ import './useDeviceType-dd51db38.js';
89
+ import './useWindowSize-80369d76.js';
90
+ import './useClickOutside-5183e396.js';
91
+ import './index-5cea9a7d.js';
92
+ import './index-a59530cd.js';
93
+ import './index-b7a33c58.js';
94
+ import './localization-4ba17032.js';
95
+ import './Popover-f4d1cac0.js';
96
+ import './index-122432cd.js';
97
+ import './debounce-4419bc2f.js';
98
+ import './useWidth-9f4647f8.js';
99
+ import './checkTimeValidation-e56771be.js';
100
+ import './DatePicker.js';
101
+ import './LinkButton.js';
102
+
103
+ var css_248z = "[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list{display:flex;flex-direction:column;height:100%}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header{margin:16px 0}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header .gene-actionable-list-header-title{align-items:center;border-bottom:1px solid rgba(var(--background-sc-rgb),.1);display:flex;font:600 1.4rem/1.8rem var(--font-family);height:5.1rem;justify-content:space-between;padding:0 2rem}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header .gene-actionable-list-header-title h5{color:var(--hero)}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header .gene-actionable-list-header-title span{color:rgba(var(--background-sc-rgb),.5)}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header .gene-actionable-list-header-search-box{align-items:center;display:flex;padding:16px}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-header .gene-actionable-list-header-mark-all{padding:0 32px}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body{height:100%;padding:0 16px}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body .gene-actionable-list-row-content{align-items:center;background-color:var(--background);border:1px solid rgba(var(--background-sc-rgb),.1);border-radius:8px;display:flex;margin-bottom:1.5rem;padding:0 8px}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body .gene-actionable-list-row-content .gene-actionable-list-row-content-body{align-items:center;display:flex;flex:1;height:100%}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body .gene-actionable-list-row-content .gene-actionable-list-row-content-body>span{line-height:40px;margin-left:8px;width:100%}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body .gene-actionable-list-row-content .gene-actionable-list-row-content-body>span>span.highlight{background:rgba(var(--hero-rgb),.15);color:var(--hero)}[data-gene-ui-version=\"2.11.0\"] .gene-actionable-list .gene-actionable-list-body .gene-actionable-list-row-children{margin-left:34px}";
104
+ styleInject(css_248z);
105
+
106
+ // @TODO think about internalization give possibilities to
107
+ // pass tooltip texts via props refactor code duplications
108
+ const searchMethods = {
109
+ like: {
110
+ value: 'like',
111
+ tooltipText: 'Your typed text will be applied to the last level of the data and will use the "like search" algorithm.'
112
+ },
113
+ startsWith: {
114
+ value: 'startsWith',
115
+ tooltipText: 'Your typed text will be applied to the last level of the data and will use the "starts with search" algorithm.'
116
+ },
117
+ endsWith: {
118
+ value: 'endsWith',
119
+ tooltipText: 'Your typed text will be applied to the last level of the data and will use the "ends with search" algorithm.'
120
+ }
121
+ };
122
+ const searchFunctions = {
123
+ [searchMethods.like.value]: (label, searchKey) => "".concat(label).toLowerCase().includes(searchKey.toLowerCase()),
124
+ [searchMethods.startsWith.value]: (label, searchKey) => label.toLowerCase().startsWith(searchKey.toLowerCase()),
125
+ [searchMethods.endsWith.value]: (label, searchKey) => label.toLowerCase().endsWith(searchKey.toLowerCase())
126
+ };
127
+
128
+ /** Used for built-in method references. */
129
+
130
+ var objectProto$6 = Object.prototype;
131
+
132
+ /**
133
+ * Checks if `value` is likely a prototype object.
134
+ *
135
+ * @private
136
+ * @param {*} value The value to check.
137
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
138
+ */
139
+ function isPrototype$2(value) {
140
+ var Ctor = value && value.constructor,
141
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$6;
142
+
143
+ return value === proto;
144
+ }
145
+
146
+ var _isPrototype = isPrototype$2;
147
+
148
+ /**
149
+ * Creates a unary function that invokes `func` with its argument transformed.
150
+ *
151
+ * @private
152
+ * @param {Function} func The function to wrap.
153
+ * @param {Function} transform The argument transform.
154
+ * @returns {Function} Returns the new function.
155
+ */
156
+
157
+ function overArg$1(func, transform) {
158
+ return function(arg) {
159
+ return func(transform(arg));
160
+ };
161
+ }
162
+
163
+ var _overArg = overArg$1;
164
+
165
+ var overArg = _overArg;
166
+
167
+ /* Built-in method references for those with the same name as other `lodash` methods. */
168
+ var nativeKeys$1 = overArg(Object.keys, Object);
169
+
170
+ var _nativeKeys = nativeKeys$1;
171
+
172
+ var isPrototype$1 = _isPrototype,
173
+ nativeKeys = _nativeKeys;
174
+
175
+ /** Used for built-in method references. */
176
+ var objectProto$5 = Object.prototype;
177
+
178
+ /** Used to check objects for own properties. */
179
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
180
+
181
+ /**
182
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
183
+ *
184
+ * @private
185
+ * @param {Object} object The object to query.
186
+ * @returns {Array} Returns the array of property names.
187
+ */
188
+ function baseKeys$1(object) {
189
+ if (!isPrototype$1(object)) {
190
+ return nativeKeys(object);
191
+ }
192
+ var result = [];
193
+ for (var key in Object(object)) {
194
+ if (hasOwnProperty$4.call(object, key) && key != 'constructor') {
195
+ result.push(key);
196
+ }
197
+ }
198
+ return result;
199
+ }
200
+
201
+ var _baseKeys = baseKeys$1;
202
+
203
+ /** Detect free variable `global` from Node.js. */
204
+
205
+ var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
206
+
207
+ var _freeGlobal = freeGlobal$1;
208
+
209
+ var freeGlobal = _freeGlobal;
210
+
211
+ /** Detect free variable `self`. */
212
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
213
+
214
+ /** Used as a reference to the global object. */
215
+ var root$7 = freeGlobal || freeSelf || Function('return this')();
216
+
217
+ var _root = root$7;
218
+
219
+ var root$6 = _root;
220
+
221
+ /** Built-in value references. */
222
+ var Symbol$2 = root$6.Symbol;
223
+
224
+ var _Symbol = Symbol$2;
225
+
226
+ var Symbol$1 = _Symbol;
227
+
228
+ /** Used for built-in method references. */
229
+ var objectProto$4 = Object.prototype;
230
+
231
+ /** Used to check objects for own properties. */
232
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
233
+
234
+ /**
235
+ * Used to resolve the
236
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
237
+ * of values.
238
+ */
239
+ var nativeObjectToString$1 = objectProto$4.toString;
240
+
241
+ /** Built-in value references. */
242
+ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
243
+
244
+ /**
245
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
246
+ *
247
+ * @private
248
+ * @param {*} value The value to query.
249
+ * @returns {string} Returns the raw `toStringTag`.
250
+ */
251
+ function getRawTag$1(value) {
252
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1),
253
+ tag = value[symToStringTag$1];
254
+
255
+ try {
256
+ value[symToStringTag$1] = undefined;
257
+ var unmasked = true;
258
+ } catch (e) {}
259
+
260
+ var result = nativeObjectToString$1.call(value);
261
+ if (unmasked) {
262
+ if (isOwn) {
263
+ value[symToStringTag$1] = tag;
264
+ } else {
265
+ delete value[symToStringTag$1];
266
+ }
267
+ }
268
+ return result;
269
+ }
270
+
271
+ var _getRawTag = getRawTag$1;
272
+
273
+ /** Used for built-in method references. */
274
+
275
+ var objectProto$3 = Object.prototype;
276
+
277
+ /**
278
+ * Used to resolve the
279
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
280
+ * of values.
281
+ */
282
+ var nativeObjectToString = objectProto$3.toString;
283
+
284
+ /**
285
+ * Converts `value` to a string using `Object.prototype.toString`.
286
+ *
287
+ * @private
288
+ * @param {*} value The value to convert.
289
+ * @returns {string} Returns the converted string.
290
+ */
291
+ function objectToString$1(value) {
292
+ return nativeObjectToString.call(value);
293
+ }
294
+
295
+ var _objectToString = objectToString$1;
296
+
297
+ var Symbol = _Symbol,
298
+ getRawTag = _getRawTag,
299
+ objectToString = _objectToString;
300
+
301
+ /** `Object#toString` result references. */
302
+ var nullTag = '[object Null]',
303
+ undefinedTag = '[object Undefined]';
304
+
305
+ /** Built-in value references. */
306
+ var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
307
+
308
+ /**
309
+ * The base implementation of `getTag` without fallbacks for buggy environments.
310
+ *
311
+ * @private
312
+ * @param {*} value The value to query.
313
+ * @returns {string} Returns the `toStringTag`.
314
+ */
315
+ function baseGetTag$4(value) {
316
+ if (value == null) {
317
+ return value === undefined ? undefinedTag : nullTag;
318
+ }
319
+ return (symToStringTag && symToStringTag in Object(value))
320
+ ? getRawTag(value)
321
+ : objectToString(value);
322
+ }
323
+
324
+ var _baseGetTag = baseGetTag$4;
325
+
326
+ /**
327
+ * Checks if `value` is the
328
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
329
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
330
+ *
331
+ * @static
332
+ * @memberOf _
333
+ * @since 0.1.0
334
+ * @category Lang
335
+ * @param {*} value The value to check.
336
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
337
+ * @example
338
+ *
339
+ * _.isObject({});
340
+ * // => true
341
+ *
342
+ * _.isObject([1, 2, 3]);
343
+ * // => true
344
+ *
345
+ * _.isObject(_.noop);
346
+ * // => true
347
+ *
348
+ * _.isObject(null);
349
+ * // => false
350
+ */
351
+
352
+ function isObject$2(value) {
353
+ var type = typeof value;
354
+ return value != null && (type == 'object' || type == 'function');
355
+ }
356
+
357
+ var isObject_1 = isObject$2;
358
+
359
+ var baseGetTag$3 = _baseGetTag,
360
+ isObject$1 = isObject_1;
361
+
362
+ /** `Object#toString` result references. */
363
+ var asyncTag = '[object AsyncFunction]',
364
+ funcTag$1 = '[object Function]',
365
+ genTag = '[object GeneratorFunction]',
366
+ proxyTag = '[object Proxy]';
367
+
368
+ /**
369
+ * Checks if `value` is classified as a `Function` object.
370
+ *
371
+ * @static
372
+ * @memberOf _
373
+ * @since 0.1.0
374
+ * @category Lang
375
+ * @param {*} value The value to check.
376
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
377
+ * @example
378
+ *
379
+ * _.isFunction(_);
380
+ * // => true
381
+ *
382
+ * _.isFunction(/abc/);
383
+ * // => false
384
+ */
385
+ function isFunction$2(value) {
386
+ if (!isObject$1(value)) {
387
+ return false;
388
+ }
389
+ // The use of `Object#toString` avoids issues with the `typeof` operator
390
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
391
+ var tag = baseGetTag$3(value);
392
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
393
+ }
394
+
395
+ var isFunction_1 = isFunction$2;
396
+
397
+ var root$5 = _root;
398
+
399
+ /** Used to detect overreaching core-js shims. */
400
+ var coreJsData$1 = root$5['__core-js_shared__'];
401
+
402
+ var _coreJsData = coreJsData$1;
403
+
404
+ var coreJsData = _coreJsData;
405
+
406
+ /** Used to detect methods masquerading as native. */
407
+ var maskSrcKey = (function() {
408
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
409
+ return uid ? ('Symbol(src)_1.' + uid) : '';
410
+ }());
411
+
412
+ /**
413
+ * Checks if `func` has its source masked.
414
+ *
415
+ * @private
416
+ * @param {Function} func The function to check.
417
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
418
+ */
419
+ function isMasked$1(func) {
420
+ return !!maskSrcKey && (maskSrcKey in func);
421
+ }
422
+
423
+ var _isMasked = isMasked$1;
424
+
425
+ /** Used for built-in method references. */
426
+
427
+ var funcProto$1 = Function.prototype;
428
+
429
+ /** Used to resolve the decompiled source of functions. */
430
+ var funcToString$1 = funcProto$1.toString;
431
+
432
+ /**
433
+ * Converts `func` to its source code.
434
+ *
435
+ * @private
436
+ * @param {Function} func The function to convert.
437
+ * @returns {string} Returns the source code.
438
+ */
439
+ function toSource$2(func) {
440
+ if (func != null) {
441
+ try {
442
+ return funcToString$1.call(func);
443
+ } catch (e) {}
444
+ try {
445
+ return (func + '');
446
+ } catch (e) {}
447
+ }
448
+ return '';
449
+ }
450
+
451
+ var _toSource = toSource$2;
452
+
453
+ var isFunction$1 = isFunction_1,
454
+ isMasked = _isMasked,
455
+ isObject = isObject_1,
456
+ toSource$1 = _toSource;
457
+
458
+ /**
459
+ * Used to match `RegExp`
460
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
461
+ */
462
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
463
+
464
+ /** Used to detect host constructors (Safari). */
465
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
466
+
467
+ /** Used for built-in method references. */
468
+ var funcProto = Function.prototype,
469
+ objectProto$2 = Object.prototype;
470
+
471
+ /** Used to resolve the decompiled source of functions. */
472
+ var funcToString = funcProto.toString;
473
+
474
+ /** Used to check objects for own properties. */
475
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
476
+
477
+ /** Used to detect if a method is native. */
478
+ var reIsNative = RegExp('^' +
479
+ funcToString.call(hasOwnProperty$2).replace(reRegExpChar, '\\$&')
480
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
481
+ );
482
+
483
+ /**
484
+ * The base implementation of `_.isNative` without bad shim checks.
485
+ *
486
+ * @private
487
+ * @param {*} value The value to check.
488
+ * @returns {boolean} Returns `true` if `value` is a native function,
489
+ * else `false`.
490
+ */
491
+ function baseIsNative$1(value) {
492
+ if (!isObject(value) || isMasked(value)) {
493
+ return false;
494
+ }
495
+ var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
496
+ return pattern.test(toSource$1(value));
497
+ }
498
+
499
+ var _baseIsNative = baseIsNative$1;
500
+
501
+ /**
502
+ * Gets the value at `key` of `object`.
503
+ *
504
+ * @private
505
+ * @param {Object} [object] The object to query.
506
+ * @param {string} key The key of the property to get.
507
+ * @returns {*} Returns the property value.
508
+ */
509
+
510
+ function getValue$1(object, key) {
511
+ return object == null ? undefined : object[key];
512
+ }
513
+
514
+ var _getValue = getValue$1;
515
+
516
+ var baseIsNative = _baseIsNative,
517
+ getValue = _getValue;
518
+
519
+ /**
520
+ * Gets the native function at `key` of `object`.
521
+ *
522
+ * @private
523
+ * @param {Object} object The object to query.
524
+ * @param {string} key The key of the method to get.
525
+ * @returns {*} Returns the function if it's native, else `undefined`.
526
+ */
527
+ function getNative$5(object, key) {
528
+ var value = getValue(object, key);
529
+ return baseIsNative(value) ? value : undefined;
530
+ }
531
+
532
+ var _getNative = getNative$5;
533
+
534
+ var getNative$4 = _getNative,
535
+ root$4 = _root;
536
+
537
+ /* Built-in method references that are verified to be native. */
538
+ var DataView$1 = getNative$4(root$4, 'DataView');
539
+
540
+ var _DataView = DataView$1;
541
+
542
+ var getNative$3 = _getNative,
543
+ root$3 = _root;
544
+
545
+ /* Built-in method references that are verified to be native. */
546
+ var Map$1 = getNative$3(root$3, 'Map');
547
+
548
+ var _Map = Map$1;
549
+
550
+ var getNative$2 = _getNative,
551
+ root$2 = _root;
552
+
553
+ /* Built-in method references that are verified to be native. */
554
+ var Promise$2 = getNative$2(root$2, 'Promise');
555
+
556
+ var _Promise = Promise$2;
557
+
558
+ var getNative$1 = _getNative,
559
+ root$1 = _root;
560
+
561
+ /* Built-in method references that are verified to be native. */
562
+ var Set$1 = getNative$1(root$1, 'Set');
563
+
564
+ var _Set = Set$1;
565
+
566
+ var getNative = _getNative,
567
+ root = _root;
568
+
569
+ /* Built-in method references that are verified to be native. */
570
+ var WeakMap$1 = getNative(root, 'WeakMap');
571
+
572
+ var _WeakMap = WeakMap$1;
573
+
574
+ var DataView = _DataView,
575
+ Map = _Map,
576
+ Promise$1 = _Promise,
577
+ Set = _Set,
578
+ WeakMap = _WeakMap,
579
+ baseGetTag$2 = _baseGetTag,
580
+ toSource = _toSource;
581
+
582
+ /** `Object#toString` result references. */
583
+ var mapTag$2 = '[object Map]',
584
+ objectTag$1 = '[object Object]',
585
+ promiseTag = '[object Promise]',
586
+ setTag$2 = '[object Set]',
587
+ weakMapTag$1 = '[object WeakMap]';
588
+
589
+ var dataViewTag$1 = '[object DataView]';
590
+
591
+ /** Used to detect maps, sets, and weakmaps. */
592
+ var dataViewCtorString = toSource(DataView),
593
+ mapCtorString = toSource(Map),
594
+ promiseCtorString = toSource(Promise$1),
595
+ setCtorString = toSource(Set),
596
+ weakMapCtorString = toSource(WeakMap);
597
+
598
+ /**
599
+ * Gets the `toStringTag` of `value`.
600
+ *
601
+ * @private
602
+ * @param {*} value The value to query.
603
+ * @returns {string} Returns the `toStringTag`.
604
+ */
605
+ var getTag$1 = baseGetTag$2;
606
+
607
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
608
+ if ((DataView && getTag$1(new DataView(new ArrayBuffer(1))) != dataViewTag$1) ||
609
+ (Map && getTag$1(new Map) != mapTag$2) ||
610
+ (Promise$1 && getTag$1(Promise$1.resolve()) != promiseTag) ||
611
+ (Set && getTag$1(new Set) != setTag$2) ||
612
+ (WeakMap && getTag$1(new WeakMap) != weakMapTag$1)) {
613
+ getTag$1 = function(value) {
614
+ var result = baseGetTag$2(value),
615
+ Ctor = result == objectTag$1 ? value.constructor : undefined,
616
+ ctorString = Ctor ? toSource(Ctor) : '';
617
+
618
+ if (ctorString) {
619
+ switch (ctorString) {
620
+ case dataViewCtorString: return dataViewTag$1;
621
+ case mapCtorString: return mapTag$2;
622
+ case promiseCtorString: return promiseTag;
623
+ case setCtorString: return setTag$2;
624
+ case weakMapCtorString: return weakMapTag$1;
625
+ }
626
+ }
627
+ return result;
628
+ };
629
+ }
630
+
631
+ var _getTag = getTag$1;
632
+
633
+ /**
634
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
635
+ * and has a `typeof` result of "object".
636
+ *
637
+ * @static
638
+ * @memberOf _
639
+ * @since 4.0.0
640
+ * @category Lang
641
+ * @param {*} value The value to check.
642
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
643
+ * @example
644
+ *
645
+ * _.isObjectLike({});
646
+ * // => true
647
+ *
648
+ * _.isObjectLike([1, 2, 3]);
649
+ * // => true
650
+ *
651
+ * _.isObjectLike(_.noop);
652
+ * // => false
653
+ *
654
+ * _.isObjectLike(null);
655
+ * // => false
656
+ */
657
+
658
+ function isObjectLike$3(value) {
659
+ return value != null && typeof value == 'object';
660
+ }
661
+
662
+ var isObjectLike_1 = isObjectLike$3;
663
+
664
+ var baseGetTag$1 = _baseGetTag,
665
+ isObjectLike$2 = isObjectLike_1;
666
+
667
+ /** `Object#toString` result references. */
668
+ var argsTag$1 = '[object Arguments]';
669
+
670
+ /**
671
+ * The base implementation of `_.isArguments`.
672
+ *
673
+ * @private
674
+ * @param {*} value The value to check.
675
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
676
+ */
677
+ function baseIsArguments$1(value) {
678
+ return isObjectLike$2(value) && baseGetTag$1(value) == argsTag$1;
679
+ }
680
+
681
+ var _baseIsArguments = baseIsArguments$1;
682
+
683
+ var baseIsArguments = _baseIsArguments,
684
+ isObjectLike$1 = isObjectLike_1;
685
+
686
+ /** Used for built-in method references. */
687
+ var objectProto$1 = Object.prototype;
688
+
689
+ /** Used to check objects for own properties. */
690
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
691
+
692
+ /** Built-in value references. */
693
+ var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
694
+
695
+ /**
696
+ * Checks if `value` is likely an `arguments` object.
697
+ *
698
+ * @static
699
+ * @memberOf _
700
+ * @since 0.1.0
701
+ * @category Lang
702
+ * @param {*} value The value to check.
703
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
704
+ * else `false`.
705
+ * @example
706
+ *
707
+ * _.isArguments(function() { return arguments; }());
708
+ * // => true
709
+ *
710
+ * _.isArguments([1, 2, 3]);
711
+ * // => false
712
+ */
713
+ var isArguments$1 = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
714
+ return isObjectLike$1(value) && hasOwnProperty$1.call(value, 'callee') &&
715
+ !propertyIsEnumerable.call(value, 'callee');
716
+ };
717
+
718
+ var isArguments_1 = isArguments$1;
719
+
720
+ /**
721
+ * Checks if `value` is classified as an `Array` object.
722
+ *
723
+ * @static
724
+ * @memberOf _
725
+ * @since 0.1.0
726
+ * @category Lang
727
+ * @param {*} value The value to check.
728
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
729
+ * @example
730
+ *
731
+ * _.isArray([1, 2, 3]);
732
+ * // => true
733
+ *
734
+ * _.isArray(document.body.children);
735
+ * // => false
736
+ *
737
+ * _.isArray('abc');
738
+ * // => false
739
+ *
740
+ * _.isArray(_.noop);
741
+ * // => false
742
+ */
743
+
744
+ var isArray$1 = Array.isArray;
745
+
746
+ var isArray_1 = isArray$1;
747
+
748
+ /** Used as references for various `Number` constants. */
749
+
750
+ var MAX_SAFE_INTEGER = 9007199254740991;
751
+
752
+ /**
753
+ * Checks if `value` is a valid array-like length.
754
+ *
755
+ * **Note:** This method is loosely based on
756
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
757
+ *
758
+ * @static
759
+ * @memberOf _
760
+ * @since 4.0.0
761
+ * @category Lang
762
+ * @param {*} value The value to check.
763
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
764
+ * @example
765
+ *
766
+ * _.isLength(3);
767
+ * // => true
768
+ *
769
+ * _.isLength(Number.MIN_VALUE);
770
+ * // => false
771
+ *
772
+ * _.isLength(Infinity);
773
+ * // => false
774
+ *
775
+ * _.isLength('3');
776
+ * // => false
777
+ */
778
+ function isLength$2(value) {
779
+ return typeof value == 'number' &&
780
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
781
+ }
782
+
783
+ var isLength_1 = isLength$2;
784
+
785
+ var isFunction = isFunction_1,
786
+ isLength$1 = isLength_1;
787
+
788
+ /**
789
+ * Checks if `value` is array-like. A value is considered array-like if it's
790
+ * not a function and has a `value.length` that's an integer greater than or
791
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
792
+ *
793
+ * @static
794
+ * @memberOf _
795
+ * @since 4.0.0
796
+ * @category Lang
797
+ * @param {*} value The value to check.
798
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
799
+ * @example
800
+ *
801
+ * _.isArrayLike([1, 2, 3]);
802
+ * // => true
803
+ *
804
+ * _.isArrayLike(document.body.children);
805
+ * // => true
806
+ *
807
+ * _.isArrayLike('abc');
808
+ * // => true
809
+ *
810
+ * _.isArrayLike(_.noop);
811
+ * // => false
812
+ */
813
+ function isArrayLike$1(value) {
814
+ return value != null && isLength$1(value.length) && !isFunction(value);
815
+ }
816
+
817
+ var isArrayLike_1 = isArrayLike$1;
818
+
819
+ var isBufferExports = {};
820
+ var isBuffer$1 = {
821
+ get exports(){ return isBufferExports; },
822
+ set exports(v){ isBufferExports = v; },
823
+ };
824
+
825
+ /**
826
+ * This method returns `false`.
827
+ *
828
+ * @static
829
+ * @memberOf _
830
+ * @since 4.13.0
831
+ * @category Util
832
+ * @returns {boolean} Returns `false`.
833
+ * @example
834
+ *
835
+ * _.times(2, _.stubFalse);
836
+ * // => [false, false]
837
+ */
838
+
839
+ function stubFalse() {
840
+ return false;
841
+ }
842
+
843
+ var stubFalse_1 = stubFalse;
844
+
845
+ (function (module, exports) {
846
+ var root = _root,
847
+ stubFalse = stubFalse_1;
848
+
849
+ /** Detect free variable `exports`. */
850
+ var freeExports = exports && !exports.nodeType && exports;
851
+
852
+ /** Detect free variable `module`. */
853
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
854
+
855
+ /** Detect the popular CommonJS extension `module.exports`. */
856
+ var moduleExports = freeModule && freeModule.exports === freeExports;
857
+
858
+ /** Built-in value references. */
859
+ var Buffer = moduleExports ? root.Buffer : undefined;
860
+
861
+ /* Built-in method references for those with the same name as other `lodash` methods. */
862
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
863
+
864
+ /**
865
+ * Checks if `value` is a buffer.
866
+ *
867
+ * @static
868
+ * @memberOf _
869
+ * @since 4.3.0
870
+ * @category Lang
871
+ * @param {*} value The value to check.
872
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
873
+ * @example
874
+ *
875
+ * _.isBuffer(new Buffer(2));
876
+ * // => true
877
+ *
878
+ * _.isBuffer(new Uint8Array(2));
879
+ * // => false
880
+ */
881
+ var isBuffer = nativeIsBuffer || stubFalse;
882
+
883
+ module.exports = isBuffer;
884
+ } (isBuffer$1, isBufferExports));
885
+
886
+ var baseGetTag = _baseGetTag,
887
+ isLength = isLength_1,
888
+ isObjectLike = isObjectLike_1;
889
+
890
+ /** `Object#toString` result references. */
891
+ var argsTag = '[object Arguments]',
892
+ arrayTag = '[object Array]',
893
+ boolTag = '[object Boolean]',
894
+ dateTag = '[object Date]',
895
+ errorTag = '[object Error]',
896
+ funcTag = '[object Function]',
897
+ mapTag$1 = '[object Map]',
898
+ numberTag = '[object Number]',
899
+ objectTag = '[object Object]',
900
+ regexpTag = '[object RegExp]',
901
+ setTag$1 = '[object Set]',
902
+ stringTag = '[object String]',
903
+ weakMapTag = '[object WeakMap]';
904
+
905
+ var arrayBufferTag = '[object ArrayBuffer]',
906
+ dataViewTag = '[object DataView]',
907
+ float32Tag = '[object Float32Array]',
908
+ float64Tag = '[object Float64Array]',
909
+ int8Tag = '[object Int8Array]',
910
+ int16Tag = '[object Int16Array]',
911
+ int32Tag = '[object Int32Array]',
912
+ uint8Tag = '[object Uint8Array]',
913
+ uint8ClampedTag = '[object Uint8ClampedArray]',
914
+ uint16Tag = '[object Uint16Array]',
915
+ uint32Tag = '[object Uint32Array]';
916
+
917
+ /** Used to identify `toStringTag` values of typed arrays. */
918
+ var typedArrayTags = {};
919
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
920
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
921
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
922
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
923
+ typedArrayTags[uint32Tag] = true;
924
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
925
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
926
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
927
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
928
+ typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
929
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
930
+ typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
931
+ typedArrayTags[weakMapTag] = false;
932
+
933
+ /**
934
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
935
+ *
936
+ * @private
937
+ * @param {*} value The value to check.
938
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
939
+ */
940
+ function baseIsTypedArray$1(value) {
941
+ return isObjectLike(value) &&
942
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
943
+ }
944
+
945
+ var _baseIsTypedArray = baseIsTypedArray$1;
946
+
947
+ /**
948
+ * The base implementation of `_.unary` without support for storing metadata.
949
+ *
950
+ * @private
951
+ * @param {Function} func The function to cap arguments for.
952
+ * @returns {Function} Returns the new capped function.
953
+ */
954
+
955
+ function baseUnary$1(func) {
956
+ return function(value) {
957
+ return func(value);
958
+ };
959
+ }
960
+
961
+ var _baseUnary = baseUnary$1;
962
+
963
+ var _nodeUtilExports = {};
964
+ var _nodeUtil = {
965
+ get exports(){ return _nodeUtilExports; },
966
+ set exports(v){ _nodeUtilExports = v; },
967
+ };
968
+
969
+ (function (module, exports) {
970
+ var freeGlobal = _freeGlobal;
971
+
972
+ /** Detect free variable `exports`. */
973
+ var freeExports = exports && !exports.nodeType && exports;
974
+
975
+ /** Detect free variable `module`. */
976
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
977
+
978
+ /** Detect the popular CommonJS extension `module.exports`. */
979
+ var moduleExports = freeModule && freeModule.exports === freeExports;
980
+
981
+ /** Detect free variable `process` from Node.js. */
982
+ var freeProcess = moduleExports && freeGlobal.process;
983
+
984
+ /** Used to access faster Node.js helpers. */
985
+ var nodeUtil = (function() {
986
+ try {
987
+ // Use `util.types` for Node.js 10+.
988
+ var types = freeModule && freeModule.require && freeModule.require('util').types;
989
+
990
+ if (types) {
991
+ return types;
992
+ }
993
+
994
+ // Legacy `process.binding('util')` for Node.js < 10.
995
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
996
+ } catch (e) {}
997
+ }());
998
+
999
+ module.exports = nodeUtil;
1000
+ } (_nodeUtil, _nodeUtilExports));
1001
+
1002
+ var baseIsTypedArray = _baseIsTypedArray,
1003
+ baseUnary = _baseUnary,
1004
+ nodeUtil = _nodeUtilExports;
1005
+
1006
+ /* Node.js helper references. */
1007
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
1008
+
1009
+ /**
1010
+ * Checks if `value` is classified as a typed array.
1011
+ *
1012
+ * @static
1013
+ * @memberOf _
1014
+ * @since 3.0.0
1015
+ * @category Lang
1016
+ * @param {*} value The value to check.
1017
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1018
+ * @example
1019
+ *
1020
+ * _.isTypedArray(new Uint8Array);
1021
+ * // => true
1022
+ *
1023
+ * _.isTypedArray([]);
1024
+ * // => false
1025
+ */
1026
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1027
+
1028
+ var isTypedArray_1 = isTypedArray$1;
1029
+
1030
+ var baseKeys = _baseKeys,
1031
+ getTag = _getTag,
1032
+ isArguments = isArguments_1,
1033
+ isArray = isArray_1,
1034
+ isArrayLike = isArrayLike_1,
1035
+ isBuffer = isBufferExports,
1036
+ isPrototype = _isPrototype,
1037
+ isTypedArray = isTypedArray_1;
1038
+
1039
+ /** `Object#toString` result references. */
1040
+ var mapTag = '[object Map]',
1041
+ setTag = '[object Set]';
1042
+
1043
+ /** Used for built-in method references. */
1044
+ var objectProto = Object.prototype;
1045
+
1046
+ /** Used to check objects for own properties. */
1047
+ var hasOwnProperty = objectProto.hasOwnProperty;
1048
+
1049
+ /**
1050
+ * Checks if `value` is an empty object, collection, map, or set.
1051
+ *
1052
+ * Objects are considered empty if they have no own enumerable string keyed
1053
+ * properties.
1054
+ *
1055
+ * Array-like values such as `arguments` objects, arrays, buffers, strings, or
1056
+ * jQuery-like collections are considered empty if they have a `length` of `0`.
1057
+ * Similarly, maps and sets are considered empty if they have a `size` of `0`.
1058
+ *
1059
+ * @static
1060
+ * @memberOf _
1061
+ * @since 0.1.0
1062
+ * @category Lang
1063
+ * @param {*} value The value to check.
1064
+ * @returns {boolean} Returns `true` if `value` is empty, else `false`.
1065
+ * @example
1066
+ *
1067
+ * _.isEmpty(null);
1068
+ * // => true
1069
+ *
1070
+ * _.isEmpty(true);
1071
+ * // => true
1072
+ *
1073
+ * _.isEmpty(1);
1074
+ * // => true
1075
+ *
1076
+ * _.isEmpty([1, 2, 3]);
1077
+ * // => false
1078
+ *
1079
+ * _.isEmpty({ 'a': 1 });
1080
+ * // => false
1081
+ */
1082
+ function isEmpty(value) {
1083
+ if (value == null) {
1084
+ return true;
1085
+ }
1086
+ if (isArrayLike(value) &&
1087
+ (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
1088
+ isBuffer(value) || isTypedArray(value) || isArguments(value))) {
1089
+ return !value.length;
1090
+ }
1091
+ var tag = getTag(value);
1092
+ if (tag == mapTag || tag == setTag) {
1093
+ return !value.size;
1094
+ }
1095
+ if (isPrototype(value)) {
1096
+ return !baseKeys(value).length;
1097
+ }
1098
+ for (var key in value) {
1099
+ if (hasOwnProperty.call(value, key)) {
1100
+ return false;
1101
+ }
1102
+ }
1103
+ return true;
1104
+ }
1105
+
1106
+ var isEmpty_1 = isEmpty;
1107
+
1108
+ function RowContent(_ref) {
1109
+ let {
1110
+ label,
1111
+ highlightedLabel,
1112
+ isChecked,
1113
+ isPermanent,
1114
+ // @TODO extend CRM permanent row styles for this flag
1115
+ isOpened,
1116
+ isDraggable,
1117
+ isSelectable,
1118
+ hasChildren,
1119
+ onArrowBtnClick,
1120
+ onCheckboxClick,
1121
+ tooltipProps,
1122
+ childNodesCount,
1123
+ selectedChildNodesCount
1124
+ } = _ref;
1125
+ const checkboxRef = useRef({});
1126
+ const handleCheckboxChange = _ref2 => {
1127
+ let {
1128
+ current
1129
+ } = _ref2;
1130
+ onCheckboxClick(current.checked);
1131
+ };
1132
+ const dynamicProps = {};
1133
+ if (isSelectable) {
1134
+ dynamicProps.onChange = () => {
1135
+ handleCheckboxChange(checkboxRef);
1136
+ };
1137
+ dynamicProps.style = {
1138
+ cursor: 'pointer'
1139
+ };
1140
+ }
1141
+ return /*#__PURE__*/React__default.createElement("div", {
1142
+ className: "gene-actionable-list-row-content"
1143
+ }, hasChildren && /*#__PURE__*/React__default.createElement(Button, {
1144
+ appearance: "minimal",
1145
+ icon: "bc-icon-arrow-".concat(isOpened ? 'down' : 'right'),
1146
+ onClick: onArrowBtnClick
1147
+ }), /*#__PURE__*/React__default.createElement("div", {
1148
+ className: "gene-actionable-list-row-content-body"
1149
+ }, isSelectable && /*#__PURE__*/React__default.createElement(Checkbox, _extends({
1150
+ indeterminate: isChecked === null,
1151
+ checked: isChecked,
1152
+ ref: checkboxRef
1153
+ }, dynamicProps)), /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.isValidElement(highlightedLabel) ? highlightedLabel : label)), !isEmpty_1(tooltipProps) && /*#__PURE__*/React__default.createElement(Tooltip, tooltipProps, /*#__PURE__*/React__default.createElement(Icon, {
1154
+ type: "bc-icon-info"
1155
+ })), isDraggable && /*#__PURE__*/React__default.createElement(Icon, {
1156
+ type: "bc-icon-drag"
1157
+ }));
1158
+ }
1159
+ RowContent.propTypes = {
1160
+ label: propTypesExports.string,
1161
+ highlightedLabel: propTypesExports.node,
1162
+ isChecked: propTypesExports.bool,
1163
+ isPermanent: propTypesExports.bool,
1164
+ isOpened: propTypesExports.bool,
1165
+ hasChildren: propTypesExports.bool,
1166
+ onArrowBtnClick: propTypesExports.func,
1167
+ onCheckboxClick: propTypesExports.func,
1168
+ isDraggable: propTypesExports.bool,
1169
+ isSelectable: propTypesExports.bool,
1170
+ tooltipProps: propTypesExports.shape({
1171
+ ...Tooltip.propTypes
1172
+ })
1173
+ };
1174
+ RowContent.defaultProps = {
1175
+ onArrowBtnClick: noop,
1176
+ onCheckboxClick: noop,
1177
+ tooltipProps: {}
1178
+ };
1179
+ RowContent.displayName = 'RowContent';
1180
+
1181
+ const getItemStyle = (isDragging, draggableStyle) => ({
1182
+ // some basic styles to make the items look a bit nicer
1183
+ userSelect: 'none',
1184
+ // padding: grid * 2,
1185
+ margin: "0 0 1.5rem 0",
1186
+ // change background colour if dragging
1187
+ // background: isDragging ? "lightgreen" : "grey",
1188
+
1189
+ // styles we need to apply on draggables
1190
+ ...draggableStyle
1191
+ });
1192
+ function Row(props) {
1193
+ const {
1194
+ label,
1195
+ id,
1196
+ isChecked,
1197
+ isVisible,
1198
+ isPermanent,
1199
+ positionIndex,
1200
+ parentId,
1201
+ childrenList,
1202
+ isOpen,
1203
+ isDraggable,
1204
+ isSelectable,
1205
+ onRowSelectHandler,
1206
+ ...restProps
1207
+ } = props;
1208
+ const [isOpened, setIsOpened] = useState(isOpen);
1209
+ const hasChildren = useMemo(() => childrenList.length > 0, [childrenList]);
1210
+ const onRowToggleHandler = useCallback(() => {
1211
+ setIsOpened(!isOpened);
1212
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1213
+ }, [isOpened]);
1214
+ useEffect(() => {
1215
+ setIsOpened(isOpen);
1216
+ }, [isOpen]);
1217
+ const onRowSelectHandlerWrapper = checked => {
1218
+ onRowSelectHandler(props, checked);
1219
+ };
1220
+ return isVisible && /*#__PURE__*/React__default.createElement(PublicDraggable, {
1221
+ draggableId: id,
1222
+ index: positionIndex,
1223
+ isDragDisabled: !isDraggable || isOpened
1224
+ }, (provided, snapshot) => /*#__PURE__*/React__default.createElement("div", _extends({
1225
+ className: "gene-actionable-list-row",
1226
+ ref: provided.innerRef
1227
+ }, provided.draggableProps, provided.dragHandleProps, {
1228
+ style: getItemStyle(snapshot === null || snapshot === void 0 ? void 0 : snapshot.isDragging, provided === null || provided === void 0 ? void 0 : provided.draggableProps.style)
1229
+ }), /*#__PURE__*/React__default.createElement(RowContent, _extends({
1230
+ hasChildren: hasChildren,
1231
+ label: label,
1232
+ isChecked: isChecked,
1233
+ isPermanent: isPermanent,
1234
+ isOpened: isOpened,
1235
+ onArrowBtnClick: onRowToggleHandler,
1236
+ onCheckboxClick: onRowSelectHandlerWrapper,
1237
+ isDraggable: isDraggable,
1238
+ isSelectable: isSelectable
1239
+ }, restProps)), isOpened && /*#__PURE__*/React__default.createElement(ConnectedDroppable, {
1240
+ droppableId: "droppable_cnt_".concat(id),
1241
+ type: "droppable_cnt_".concat(id)
1242
+ }, (provided, snapshot, rubric) => /*#__PURE__*/React__default.createElement("div", _extends({
1243
+ className: "gene-actionable-list-row-children"
1244
+ }, provided.droppableProps, {
1245
+ ref: provided.innerRef
1246
+ }), childrenList.map((row, index) => /*#__PURE__*/React__default.createElement(Row, _extends({}, row, {
1247
+ key: row.id,
1248
+ isDraggable: isDraggable,
1249
+ isSelectable: isSelectable,
1250
+ onRowSelectHandler: onRowSelectHandler
1251
+ }))), provided.placeholder))));
1252
+ }
1253
+ Row.propTypes = {
1254
+ label: propTypesExports.string,
1255
+ id: propTypesExports.string,
1256
+ isChecked: propTypesExports.oneOf([true, false, null]),
1257
+ isVisible: propTypesExports.bool,
1258
+ isPermanent: propTypesExports.bool,
1259
+ positionIndex: propTypesExports.number,
1260
+ parentId: propTypesExports.string,
1261
+ childrenList: propTypesExports.array,
1262
+ isOpen: propTypesExports.bool,
1263
+ isDraggable: propTypesExports.bool,
1264
+ isSelectable: propTypesExports.bool,
1265
+ onRowSelectHandler: propTypesExports.func
1266
+ };
1267
+ Row.defaultProps = {
1268
+ isChecked: false,
1269
+ isVisible: true,
1270
+ isPermanent: false,
1271
+ childrenList: [],
1272
+ isOpen: false,
1273
+ tooltipInfo: '',
1274
+ onRowSelectHandler: noop
1275
+ };
1276
+ Row.displayName = 'Row';
1277
+
1278
+ // @TODO move helper function to separated file and check code to avoid code duplications
1279
+ const isNodeLeaf = function () {
1280
+ let node = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1281
+ return !node.hasOwnProperty('childrenList');
1282
+ };
1283
+ const isNodeVisible = function () {
1284
+ let {
1285
+ isVisible
1286
+ } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1287
+ return isVisible !== undefined ? isVisible : true;
1288
+ };
1289
+ const mapDataListToInternalModel = function () {
1290
+ let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1291
+ let parentId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1292
+ return list.map((row, index) => {
1293
+ if (parentId !== null) {
1294
+ row.parentId = parentId;
1295
+ row.id = "".concat(parentId, "_").concat(index);
1296
+ } else {
1297
+ row.id = "".concat(index);
1298
+ }
1299
+ if (!isNodeLeaf(row)) {
1300
+ row.childNodesCount = row === null || row === void 0 ? void 0 : row.childrenList.length;
1301
+ row.selectedChildNodesCount = row === null || row === void 0 ? void 0 : row.childrenList.filter(_ref => {
1302
+ let {
1303
+ isChecked
1304
+ } = _ref;
1305
+ return isChecked;
1306
+ }).length;
1307
+ mapDataListToInternalModel(row === null || row === void 0 ? void 0 : row.childrenList, row.id);
1308
+ }
1309
+ return row;
1310
+ });
1311
+ };
1312
+ const reorder = (list, path, startIndex, endIndex) => {
1313
+ if (path.length > 0) {
1314
+ var _list$index$childrenL, _list$index;
1315
+ const index = path.shift();
1316
+ return reorder((_list$index$childrenL = (_list$index = list[index]) === null || _list$index === void 0 ? void 0 : _list$index.childrenList) !== null && _list$index$childrenL !== void 0 ? _list$index$childrenL : list, path, startIndex, endIndex);
1317
+ }
1318
+ const result = [...list];
1319
+ const [removed] = result.splice(startIndex, 1);
1320
+ result.splice(endIndex, 0, removed);
1321
+ return result.map((row, index) => {
1322
+ row.positionIndex = index;
1323
+ return row;
1324
+ });
1325
+ };
1326
+ const replaceList = (list, levelId, value) => list.map(row => {
1327
+ var _row$childrenList;
1328
+ const isRowMatched = row.id === levelId.substring(0, levelId.length - 2);
1329
+ if (isRowMatched) {
1330
+ row.childrenList = value;
1331
+ }
1332
+ if ((row === null || row === void 0 ? void 0 : (_row$childrenList = row.childrenList) === null || _row$childrenList === void 0 ? void 0 : _row$childrenList.length) > 0 && !isRowMatched) {
1333
+ replaceList(row === null || row === void 0 ? void 0 : row.childrenList, levelId, value);
1334
+ }
1335
+ return row;
1336
+ });
1337
+ const highlightTextBySearchKey = function () {
1338
+ let text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1339
+ let searchKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
1340
+ let searchMethod = arguments.length > 2 ? arguments[2] : undefined;
1341
+ const result = text.replaceAll('<span className="highlight">', '').replaceAll('</span>', '');
1342
+ const index = searchMethod === searchMethods.endsWith.value ? result.lastIndexOf(searchKey) : result.indexOf(searchKey);
1343
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, result.substring(0, index), /*#__PURE__*/React__default.createElement("span", {
1344
+ className: "highlight"
1345
+ }, result.substring(index, index + searchKey.length)), result.substring(index + searchKey.length));
1346
+ };
1347
+
1348
+ // '0'
1349
+ // '0_0'
1350
+ // '0_0_0_1'
1351
+ const walkToNode = function (list, nodeIds) {
1352
+ let forceCloseAllRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1353
+ let searchKey = arguments.length > 3 ? arguments[3] : undefined;
1354
+ let withSearchHighlighting = arguments.length > 4 ? arguments[4] : undefined;
1355
+ let searchMethod = arguments.length > 5 ? arguments[5] : undefined;
1356
+ return list.map(row => {
1357
+ let isRowMatched = false;
1358
+ for (let i = 0; i < nodeIds.length; i++) {
1359
+ const _row = nodeIds[i];
1360
+ isRowMatched = row.id === _row.id.substring(0, row.id.length);
1361
+ if (isRowMatched) break;
1362
+ }
1363
+ row.isVisible = isRowMatched;
1364
+ if (isRowMatched) {
1365
+ if (!isNodeLeaf(row)) {
1366
+ row.isOpen = !!forceCloseAllRows;
1367
+ walkToNode(row.childrenList, nodeIds, forceCloseAllRows, searchKey, withSearchHighlighting, searchMethod);
1368
+ } else if (withSearchHighlighting) {
1369
+ row.highlightedLabel = highlightTextBySearchKey(row.label, searchKey, searchMethod);
1370
+ }
1371
+ }
1372
+ return row;
1373
+ });
1374
+ };
1375
+ const findLeafNodes = function (list) {
1376
+ let leafNodes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
1377
+ list.forEach(row => {
1378
+ if (isNodeLeaf(row)) {
1379
+ leafNodes.push(row);
1380
+ } else {
1381
+ findLeafNodes(row.childrenList, leafNodes);
1382
+ }
1383
+ });
1384
+ return leafNodes;
1385
+ };
1386
+ const applySearchFilter = function () {
1387
+ let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1388
+ let searchKey = arguments.length > 1 ? arguments[1] : undefined;
1389
+ let method = arguments.length > 2 ? arguments[2] : undefined;
1390
+ return list.filter(_ref2 => {
1391
+ let {
1392
+ label
1393
+ } = _ref2;
1394
+ return searchFunctions[method](label, searchKey);
1395
+ });
1396
+ };
1397
+ const searchHandler = (list, searchKey, method, withSearchHighlighting) => {
1398
+ const leafNodes = findLeafNodes(list);
1399
+ const matchedNodes = searchKey.trim() !== '' ? applySearchFilter(leafNodes, searchKey, method) : leafNodes;
1400
+ return {
1401
+ searchResult: walkToNode(list, matchedNodes, searchKey !== '', searchKey, withSearchHighlighting, method),
1402
+ matchedNodesCount: matchedNodes.length,
1403
+ isSearchEmpty: matchedNodes.length === 0
1404
+ };
1405
+ };
1406
+
1407
+ // @TODO fix bugs in selection logic
1408
+ const markAllNodes = function () {
1409
+ let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1410
+ let checked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1411
+ let selectedRow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
1412
+ return list.map(row => {
1413
+ if (!row.isPermanent && isNodeVisible(row)) {
1414
+ if (!isNodeLeaf(row)) {
1415
+ if (selectedRow !== null) {
1416
+ selectedRow.selectedChildNodesCount = checked ? selectedRow.childNodesCount : 0;
1417
+ }
1418
+ row.selectedChildNodesCount = checked ? row.childNodesCount : 0;
1419
+ markAllNodes(row.childrenList, checked, row);
1420
+ }
1421
+ }
1422
+ return row;
1423
+ });
1424
+ };
1425
+ const d = function () {
1426
+ let list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
1427
+ let id = arguments.length > 1 ? arguments[1] : undefined;
1428
+ let checked = arguments.length > 2 ? arguments[2] : undefined;
1429
+ const value = checked ? 1 : -1;
1430
+ return list.map(row => {
1431
+ if (id.startsWith(row.id)) {
1432
+ if (!isNodeLeaf(row)) {
1433
+ row.selectedChildNodesCount += row.selectedChildNodesCount + value <= row.childNodesCount && row.selectedChildNodesCount - value >= row.childNodesCount ? value : 0;
1434
+ let parentRowCheckedStatus = false;
1435
+ if (row.selectedChildNodesCount > 0) {
1436
+ parentRowCheckedStatus = null;
1437
+ if (row.selectedChildNodesCount === row.childNodesCount) {
1438
+ parentRowCheckedStatus = true;
1439
+ }
1440
+ }
1441
+ row.isChecked = parentRowCheckedStatus;
1442
+ d(row.childrenList, id, checked);
1443
+ } else {
1444
+ row.isChecked = checked;
1445
+ }
1446
+ }
1447
+ return row;
1448
+ });
1449
+ };
1450
+ const selectHandler = (list, selectedRow, checked) => list.map(row => {
1451
+ const {
1452
+ id,
1453
+ isPermanent
1454
+ } = row;
1455
+ const isRowMatched = id === selectedRow.id;
1456
+ if (!isNodeLeaf(row)) {
1457
+ if (isRowMatched && !isPermanent && isNodeVisible(row)) {
1458
+ markAllNodes(row === null || row === void 0 ? void 0 : row.childrenList, checked, row);
1459
+ } else {
1460
+ selectHandler(row === null || row === void 0 ? void 0 : row.childrenList, selectedRow, checked);
1461
+ }
1462
+ }
1463
+ return row;
1464
+ });
1465
+ const ActionableList = /*#__PURE__*/forwardRef((_ref3, ref) => {
1466
+ let {
1467
+ onChange,
1468
+ data,
1469
+ isLoading,
1470
+ withSortable,
1471
+ withSelection,
1472
+ withSearch,
1473
+ withSearchHighlighting,
1474
+ readOnly,
1475
+ searchPlaceholderText,
1476
+ emptyDataText,
1477
+ emptySearchText,
1478
+ titleText,
1479
+ selectionText,
1480
+ filteredNodesText,
1481
+ totalNodesText,
1482
+ loadingText,
1483
+ selectAllLabelText,
1484
+ searchMethod
1485
+ } = _ref3;
1486
+ const [searchInput, setSearchInput] = useState('');
1487
+ const searchInputTimeoutRef = useRef(null);
1488
+ const [dataList, setDataList] = useState([]);
1489
+ const leafNodes = useMemo(() => findLeafNodes(dataList), [dataList]);
1490
+ const [leafNodesCount, setLeafNodesCount] = useState('');
1491
+ const [selectedLeafNodesCount, setSelectedLeafNodesCount] = useState('');
1492
+ const hasDataList = useMemo(() => dataList.length > 0, [dataList]);
1493
+ const [isAllSelected, setIsAllSelected] = useState(false);
1494
+ const [isSearchEmpty, setIsSearchEmpty] = useState(null);
1495
+
1496
+ // Provide reset search functional to parent component
1497
+ useImperativeHandle(ref, () => ({
1498
+ resetSearch() {
1499
+ setSearchInput('');
1500
+ }
1501
+ }));
1502
+ const searchInputHandler = _ref4 => {
1503
+ let {
1504
+ target
1505
+ } = _ref4;
1506
+ setSearchInput(target === null || target === void 0 ? void 0 : target.value);
1507
+ };
1508
+ const onDragEnd = result => {
1509
+ // Dropped outside of the list
1510
+ if (!result.destination) {
1511
+ return;
1512
+ }
1513
+ // Discover the depth of dragged row
1514
+ const draggableIds = result.draggableId.split('_');
1515
+ const path = [...draggableIds];
1516
+ path.pop();
1517
+ setDataList(previousBlockItems => {
1518
+ const reorderedList = reorder(previousBlockItems, path, result.source.index, result.destination.index);
1519
+ if (draggableIds.length === 1) {
1520
+ const _data = mapDataListToInternalModel(reorderedList);
1521
+ onChange(_data);
1522
+ return _data;
1523
+ }
1524
+ const _data = mapDataListToInternalModel(replaceList(previousBlockItems, result.draggableId, reorderedList));
1525
+ onChange(_data);
1526
+ return _data;
1527
+ });
1528
+ };
1529
+ useEffect(() => {
1530
+ const _data = JSON.parse(JSON.stringify(data));
1531
+ setDataList(mapDataListToInternalModel(_data));
1532
+ }, [data]);
1533
+ useEffect(() => {
1534
+ if (hasDataList && leafNodesCount === '') {
1535
+ setLeafNodesCount(leafNodes.length);
1536
+ }
1537
+ setSelectedLeafNodesCount(leafNodes.filter(_ref5 => {
1538
+ let {
1539
+ isChecked
1540
+ } = _ref5;
1541
+ return isChecked !== undefined ? isChecked : false;
1542
+ }).length);
1543
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1544
+ }, [hasDataList, leafNodes]);
1545
+ useEffect(() => {
1546
+ if (!hasDataList) return;
1547
+ // debounce typing
1548
+ // filter array by label recursively via following search method
1549
+ // recursively find and open any parent row if exist set isOpen to true
1550
+ // set filtered values to dataList
1551
+
1552
+ clearTimeout(searchInputTimeoutRef.current);
1553
+ searchInputTimeoutRef.current = setTimeout(() => {
1554
+ const {
1555
+ searchResult,
1556
+ isSearchEmpty,
1557
+ matchedNodesCount
1558
+ } = searchHandler(dataList, searchInput, searchMethod, withSearchHighlighting);
1559
+ setDataList(searchResult);
1560
+ setLeafNodesCount(matchedNodesCount);
1561
+ setIsSearchEmpty(isSearchEmpty);
1562
+ }, 500);
1563
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1564
+ }, [searchInput]);
1565
+ const cleanup = () => () => {
1566
+ clearTimeout(searchInputTimeoutRef.current);
1567
+ };
1568
+ useEffect(() => cleanup, []);
1569
+
1570
+ // create selection logic
1571
+
1572
+ const handleCheckboxChange = e => {
1573
+ const {
1574
+ checked
1575
+ } = e.currentTarget ? e.currentTarget : e.current;
1576
+ const _data = markAllNodes(dataList, checked);
1577
+ setDataList(_data);
1578
+ // onChange(_data);
1579
+ setIsAllSelected(checked);
1580
+ };
1581
+ const onRowSelectHandler = (row, checked) => {
1582
+ const _data = selectHandler(dataList, row, checked);
1583
+ const a = d(_data, row.id, checked);
1584
+ // console.log('🚀 ~ file: index.js ~ line 366 ~ onRowSelectHandler ~ row.id', row.id);
1585
+
1586
+ setDataList(a);
1587
+ onChange(a);
1588
+ };
1589
+ useEffect(() => {
1590
+ setIsAllSelected(prev => {
1591
+ let value = false;
1592
+ if (prev !== true && selectedLeafNodesCount > 0) {
1593
+ value = null;
1594
+ if (leafNodes.length === selectedLeafNodesCount) {
1595
+ value = true;
1596
+ }
1597
+ }
1598
+ return value;
1599
+ });
1600
+ }, [leafNodes, selectedLeafNodesCount]);
1601
+ return /*#__PURE__*/React__default.createElement("div", {
1602
+ className: "gene-actionable-list"
1603
+ }, /*#__PURE__*/React__default.createElement(BusyLoader, {
1604
+ isBusy: isLoading,
1605
+ loadingText: loadingText
1606
+ }, hasDataList ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
1607
+ className: "gene-actionable-list-header"
1608
+ }, /*#__PURE__*/React__default.createElement("div", {
1609
+ className: "gene-actionable-list-header-title"
1610
+ }, /*#__PURE__*/React__default.createElement("h5", null, titleText), /*#__PURE__*/React__default.createElement("span", null, withSelection && "".concat(selectionText, " ").concat(selectedLeafNodesCount, " | "), withSearch && "".concat(filteredNodesText, " ").concat(leafNodesCount, " | "), "".concat(totalNodesText, " ").concat(leafNodes.length))), withSearch && /*#__PURE__*/React__default.createElement("div", {
1611
+ className: "gene-actionable-list-header-search-box"
1612
+ }, /*#__PURE__*/React__default.createElement(ExtendedInput, {
1613
+ placeholder: searchPlaceholderText,
1614
+ onChange: searchInputHandler,
1615
+ value: searchInput,
1616
+ icon: "bc-icon-search"
1617
+ }), /*#__PURE__*/React__default.createElement(Tooltip, {
1618
+ position: "left",
1619
+ text: searchMethods[searchMethod].tooltipText
1620
+ }, /*#__PURE__*/React__default.createElement(Icon, {
1621
+ type: "bc-icon-info"
1622
+ }))), withSelection && leafNodesCount > 1 && /*#__PURE__*/React__default.createElement(Checkbox, {
1623
+ className: "gene-actionable-list-header-mark-all",
1624
+ label: selectAllLabelText,
1625
+ checked: isAllSelected,
1626
+ onChange: handleCheckboxChange,
1627
+ indeterminate: isAllSelected === null
1628
+ })), /*#__PURE__*/React__default.createElement(CustomScrollbar, null, /*#__PURE__*/React__default.createElement("div", {
1629
+ className: "gene-actionable-list-body"
1630
+ }, isSearchEmpty ? /*#__PURE__*/React__default.createElement(Empty, {
1631
+ appearance: "greyscale",
1632
+ type: "search",
1633
+ title: emptySearchText
1634
+ }) : /*#__PURE__*/React__default.createElement(DragDropContext, {
1635
+ onDragEnd: onDragEnd
1636
+ }, /*#__PURE__*/React__default.createElement(ConnectedDroppable, {
1637
+ droppableId: "droppable_cnt",
1638
+ type: "droppable_cnt"
1639
+ }, (provided, snapshot, rubric) => /*#__PURE__*/React__default.createElement("div", _extends({}, provided.droppableProps, {
1640
+ ref: provided.innerRef
1641
+ }), dataList.map((row, index) => /*#__PURE__*/React__default.createElement(Row, _extends({}, row, {
1642
+ key: row.id,
1643
+ isDraggable: withSortable,
1644
+ isSelectable: withSelection,
1645
+ onRowSelectHandler: onRowSelectHandler
1646
+ }))), provided.placeholder)))))) : /*#__PURE__*/React__default.createElement(Empty, {
1647
+ appearance: "greyscale",
1648
+ type: "data",
1649
+ title: emptyDataText
1650
+ })));
1651
+ });
1652
+
1653
+ // @TODO add comments for props
1654
+ ActionableList.propTypes = {
1655
+ /**
1656
+ * Execute an callback on Reorder event with already reordered data
1657
+ */
1658
+ onChange: propTypesExports.func,
1659
+ // @TODO map and remove component props for list objects and return cloned list back
1660
+ /**
1661
+ * Data list of objects. This list is dynamic and has listener inside of the component you can change the data list and its objects runtime
1662
+ */
1663
+ data: propTypesExports.arrayOf(propTypesExports.shape({
1664
+ label: propTypesExports.string,
1665
+ id: propTypesExports.string,
1666
+ isChecked: propTypesExports.bool,
1667
+ isVisible: propTypesExports.bool,
1668
+ isPermanent: propTypesExports.bool,
1669
+ positionIndex: propTypesExports.number,
1670
+ parentId: propTypesExports.string,
1671
+ childrenList: propTypesExports.array,
1672
+ isOpen: propTypesExports.bool
1673
+ })),
1674
+ /**
1675
+ * Represent loader state in case of true will be shown spinner and loading text
1676
+ */
1677
+ isLoading: propTypesExports.bool,
1678
+ /**
1679
+ * Turn on search logic and show search input element on the top of component
1680
+ */
1681
+ withSearch: propTypesExports.bool,
1682
+ /**
1683
+ * Turn on search highlighting function
1684
+ */
1685
+ withSearchHighlighting: propTypesExports.bool,
1686
+ /**
1687
+ * Not supported yet will provided on next version
1688
+ */
1689
+ withSelection: propTypesExports.bool,
1690
+ /**
1691
+ * Turn on drag and drop reordering function on multilevel scopes
1692
+ */
1693
+ withSortable: propTypesExports.bool,
1694
+ /**
1695
+ * Not supported yet will provided on next version
1696
+ */
1697
+ readOnly: propTypesExports.bool,
1698
+ /**
1699
+ * Placeholder text for search input to cover localization support
1700
+ */
1701
+ searchPlaceholderText: propTypesExports.string,
1702
+ /**
1703
+ * Empty data text to cover localization support
1704
+ */
1705
+ emptyDataText: propTypesExports.string,
1706
+ /**
1707
+ * Empty search result text to cover localization support
1708
+ */
1709
+ emptySearchText: propTypesExports.string,
1710
+ /**
1711
+ * Title text to cover localization support
1712
+ */
1713
+ titleText: propTypesExports.string,
1714
+ /**
1715
+ * Not supported yet will provided on next version
1716
+ */
1717
+ selectionText: propTypesExports.string,
1718
+ /**
1719
+ * Filtered nodes count text to cover localization support
1720
+ */
1721
+ filteredNodesText: propTypesExports.string,
1722
+ /**
1723
+ * Total leaf nodes count text to cover localization support
1724
+ */
1725
+ totalNodesText: propTypesExports.string,
1726
+ /**
1727
+ * Text for loading state to cover localization support
1728
+ */
1729
+ loadingText: propTypesExports.string,
1730
+ /**
1731
+ * Not supported yet will provided on next version
1732
+ */
1733
+ selectAllLabelText: propTypesExports.string,
1734
+ /**
1735
+ * Search method can be one of [startsWith, endsWith, like]
1736
+ */
1737
+ searchMethod: propTypesExports.oneOf(Object.keys(searchMethods))
1738
+ };
1739
+ ActionableList.defaultProps = {
1740
+ onChange: noop,
1741
+ data: [],
1742
+ isLoading: false,
1743
+ withSearch: false,
1744
+ withSearchHighlighting: false,
1745
+ withSelection: false,
1746
+ withSortable: false,
1747
+ readOnly: true,
1748
+ searchPlaceholderText: 'Search',
1749
+ emptyDataText: 'No data to display',
1750
+ emptySearchText: 'No data found',
1751
+ titleText: 'Actionable list',
1752
+ selectionText: 'Selected',
1753
+ filteredNodesText: 'Filtered',
1754
+ totalNodesText: 'Total',
1755
+ loadingText: 'Loading data',
1756
+ selectAllLabelText: 'Select all filtered items',
1757
+ searchMethod: searchMethods.like.value
1758
+ };
1759
+ ActionableList.displayName = 'ActionableList';
1760
+
1761
+ export { ActionableList as default };