@adaptabletools/adaptable-cjs 22.0.0-canary.9 → 22.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/index.css +1157 -1319
- package/index.css.map +1 -1
- package/index.d.ts +8 -8
- package/index.js +8 -8
- package/package.json +1 -4
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
- package/src/AdaptableState/Common/AdaptableForm.d.ts +1 -1
- package/src/AdaptableState/Common/AggregationColumns.d.ts +1 -0
- package/src/AdaptableState/Common/AggregationColumns.js +2 -1
- package/src/AdaptableState/Common/DataUpdateConfig.d.ts +15 -5
- package/src/AdaptableState/Common/TransposeConfig.d.ts +4 -9
- package/src/AdaptableState/InitialState.d.ts +1 -1
- package/src/AdaptableState/UserInterfaceState.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +1 -1
- package/src/Api/GridApi.d.ts +4 -0
- package/src/Api/Implementation/ApiBase.d.ts +1 -1
- package/src/Api/Implementation/ApiBase.js +1 -1
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ColumnApiImpl.js +4 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +1 -0
- package/src/Api/Implementation/GridApiImpl.js +6 -5
- package/src/Api/Implementation/LayoutHelpers.js +1 -1
- package/src/Api/Internal/ColumnInternalApi.d.ts +1 -1
- package/src/Api/Internal/ColumnInternalApi.js +5 -3
- package/src/Api/Internal/EventInternalApi.js +1 -1
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -6
- package/src/Strategy/FormatColumnModule.js +2 -2
- package/src/Strategy/LayoutModule.js +1 -1
- package/src/Strategy/StyledColumnModule.js +14 -6
- package/src/Strategy/TeamSharingModule.js +2 -2
- package/src/Strategy/Utilities/FormatColumn/{getFormatColumnSettingsTargetItems.d.ts → getFormatColumnRowTargetItems.d.ts} +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnRowTargetItems.js +26 -0
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +5 -13
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
- package/src/Utilities/Extensions/StringExtensions.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/Helpers/FormatHelper.js +2 -2
- package/src/Utilities/Hooks/index.d.ts +1 -2
- package/src/Utilities/Hooks/index.js +1 -3
- package/src/Utilities/Services/LicenseService/index.js +1 -1
- package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
- package/src/Utilities/Services/RowSummaryService.js +2 -2
- package/src/Utilities/getScopeViewItems.js +1 -1
- package/src/Utilities/only.d.ts +15 -0
- package/src/Utilities/only.js +58 -0
- package/src/Utilities/utils/chunk.d.ts +6 -0
- package/src/Utilities/utils/chunk.js +20 -0
- package/src/Utilities/utils/clamp.d.ts +5 -0
- package/src/Utilities/utils/clamp.js +10 -0
- package/src/Utilities/utils/cloneDeepWith.d.ts +9 -0
- package/src/Utilities/utils/cloneDeepWith.js +70 -0
- package/src/Utilities/utils/debounce.d.ts +20 -0
- package/src/Utilities/utils/debounce.js +124 -0
- package/src/Utilities/utils/flatten.d.ts +5 -0
- package/src/Utilities/utils/flatten.js +10 -0
- package/src/Utilities/utils/flattenDeep.d.ts +5 -0
- package/src/Utilities/utils/flattenDeep.js +10 -0
- package/src/Utilities/utils/get.d.ts +6 -0
- package/src/Utilities/utils/get.js +38 -0
- package/src/Utilities/utils/index.d.ts +22 -0
- package/src/Utilities/utils/index.js +48 -0
- package/src/Utilities/utils/isArray.d.ts +6 -0
- package/src/Utilities/utils/isArray.js +8 -0
- package/src/Utilities/utils/isEqual.d.ts +5 -0
- package/src/Utilities/utils/isEqual.js +127 -0
- package/src/Utilities/utils/isObject.d.ts +6 -0
- package/src/Utilities/utils/isObject.js +12 -0
- package/src/Utilities/utils/isPlainObject.d.ts +6 -0
- package/src/Utilities/utils/isPlainObject.js +20 -0
- package/src/Utilities/utils/kebabCase.d.ts +5 -0
- package/src/Utilities/utils/kebabCase.js +12 -0
- package/src/Utilities/utils/merge.d.ts +11 -0
- package/src/Utilities/utils/merge.js +44 -0
- package/src/Utilities/utils/mergeWith.d.ts +7 -0
- package/src/Utilities/utils/mergeWith.js +50 -0
- package/src/Utilities/utils/orderBy.d.ts +8 -0
- package/src/Utilities/utils/orderBy.js +33 -0
- package/src/Utilities/utils/parseInt.d.ts +6 -0
- package/src/Utilities/utils/parseInt.js +12 -0
- package/src/Utilities/utils/sentenceCase.d.ts +6 -0
- package/src/Utilities/utils/sentenceCase.js +19 -0
- package/src/Utilities/utils/startCase.d.ts +5 -0
- package/src/Utilities/utils/startCase.js +15 -0
- package/src/Utilities/utils/throttle.d.ts +17 -0
- package/src/Utilities/utils/throttle.js +23 -0
- package/src/Utilities/utils/toNumber.d.ts +5 -0
- package/src/Utilities/utils/toNumber.js +42 -0
- package/src/Utilities/utils/uniq.d.ts +7 -0
- package/src/Utilities/utils/uniq.js +12 -0
- package/src/Utilities/utils/uniqBy.d.ts +8 -0
- package/src/Utilities/utils/uniqBy.js +25 -0
- package/src/Utilities/utils/words.d.ts +7 -0
- package/src/Utilities/utils/words.js +13 -0
- package/src/Utilities/weightedAverage.js +1 -1
- package/src/View/AdaptableComputedCSSVarsContext.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +2 -2
- package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +2 -2
- package/src/View/Components/RangesComponent.js +1 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +7 -2
- package/src/View/Dashboard/CustomDashboardButton.js +1 -1
- package/src/View/Dashboard/Dashboard.js +1 -1
- package/src/View/Dashboard/DashboardPopup.js +4 -3
- package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
- package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
- package/src/View/Export/Wizard/NewReportWizard.js +8 -8
- package/src/View/Filter/FilterViewPanel.d.ts +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +19 -10
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.d.ts +8 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.js +86 -0
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +22 -61
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -10
- package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
- package/src/View/Layout/LayoutViewPanel.js +1 -1
- package/src/View/Layout/TransposedPopup.js +0 -1
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
- package/src/View/Note/NoteEditor.js +1 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeRowsSection.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/{StyledColumnWizardSettingsSection.js → StyledColumnBadgeRowsSection.js} +22 -22
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +10 -11
- package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
- package/src/View/Theme/ThemeEditor.js +1 -1
- package/src/View/Theme/ThemeField.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/View/Wizard/OnePageWizards.js +1 -1
- package/src/agGrid/AdaptableAgGrid.js +25 -6
- package/src/agGrid/AgGridAdapter.js +4 -4
- package/src/agGrid/AgGridColumnAdapter.js +11 -4
- package/src/agGrid/AgGridExportAdapter.d.ts +2 -2
- package/src/agGrid/AgGridExportAdapter.js +7 -6
- package/src/agGrid/cellRenderers/PercentBarRenderer.js +17 -5
- package/src/components/ColorPicker/ColorPicker.js +1 -1
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/index.js +1 -1
- package/src/components/Select/Select.js +4 -0
- package/src/env.js +2 -2
- package/src/layout-manager/src/isLayoutEqual.js +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +12 -1
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/migration/VersionUpgrade22.js +9 -0
- package/themes/dark.css +2 -3
- package/themes/light.css +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +0 -16
- package/src/Utilities/Hooks/useAdaptableState.d.ts +0 -3
- package/src/Utilities/Hooks/useAdaptableState.js +0 -42
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +0 -8
- package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +0 -37
- package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.d.ts +0 -8
- /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.d.ts → FormatColumnColumnScopeWizardSection.d.ts} +0 -0
- /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.js → FormatColumnColumnScopeWizardSection.js} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = clamp;
|
|
4
|
+
/**
|
|
5
|
+
* Clamps number within the inclusive lower and upper bounds.
|
|
6
|
+
* Drop-in replacement for lodash/clamp.
|
|
7
|
+
*/
|
|
8
|
+
function clamp(number, lower, upper) {
|
|
9
|
+
return Math.min(Math.max(number, lower), upper);
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This method is like `cloneDeep` except that it accepts customizer which
|
|
3
|
+
* is invoked to produce the cloned value. If customizer returns undefined,
|
|
4
|
+
* cloning is handled by the method instead.
|
|
5
|
+
* Drop-in replacement for lodash/cloneDeepWith.
|
|
6
|
+
*/
|
|
7
|
+
type CloneCustomizer = (value: any) => any;
|
|
8
|
+
export default function cloneDeepWith<T>(value: T, customizer: CloneCustomizer): T;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This method is like `cloneDeep` except that it accepts customizer which
|
|
4
|
+
* is invoked to produce the cloned value. If customizer returns undefined,
|
|
5
|
+
* cloning is handled by the method instead.
|
|
6
|
+
* Drop-in replacement for lodash/cloneDeepWith.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = cloneDeepWith;
|
|
10
|
+
function baseCloneDeep(value, customizer, seen) {
|
|
11
|
+
// Invoke customizer first
|
|
12
|
+
const customResult = customizer(value);
|
|
13
|
+
if (customResult !== undefined) {
|
|
14
|
+
return customResult;
|
|
15
|
+
}
|
|
16
|
+
// Primitives
|
|
17
|
+
if (value === null || typeof value !== 'object') {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
// Circular reference detection
|
|
21
|
+
if (seen.has(value)) {
|
|
22
|
+
return seen.get(value);
|
|
23
|
+
}
|
|
24
|
+
// Date
|
|
25
|
+
if (value instanceof Date) {
|
|
26
|
+
return new Date(value.getTime());
|
|
27
|
+
}
|
|
28
|
+
// RegExp
|
|
29
|
+
if (value instanceof RegExp) {
|
|
30
|
+
return new RegExp(value.source, value.flags);
|
|
31
|
+
}
|
|
32
|
+
// Map
|
|
33
|
+
if (value instanceof Map) {
|
|
34
|
+
const cloned = new Map();
|
|
35
|
+
seen.set(value, cloned);
|
|
36
|
+
value.forEach((v, k) => {
|
|
37
|
+
cloned.set(baseCloneDeep(k, customizer, seen), baseCloneDeep(v, customizer, seen));
|
|
38
|
+
});
|
|
39
|
+
return cloned;
|
|
40
|
+
}
|
|
41
|
+
// Set
|
|
42
|
+
if (value instanceof Set) {
|
|
43
|
+
const cloned = new Set();
|
|
44
|
+
seen.set(value, cloned);
|
|
45
|
+
value.forEach((v) => {
|
|
46
|
+
cloned.add(baseCloneDeep(v, customizer, seen));
|
|
47
|
+
});
|
|
48
|
+
return cloned;
|
|
49
|
+
}
|
|
50
|
+
// Arrays
|
|
51
|
+
if (Array.isArray(value)) {
|
|
52
|
+
const cloned = [];
|
|
53
|
+
seen.set(value, cloned);
|
|
54
|
+
for (let i = 0; i < value.length; i++) {
|
|
55
|
+
cloned[i] = baseCloneDeep(value[i], customizer, seen);
|
|
56
|
+
}
|
|
57
|
+
return cloned;
|
|
58
|
+
}
|
|
59
|
+
// Plain objects and others
|
|
60
|
+
const cloned = Object.create(Object.getPrototypeOf(value));
|
|
61
|
+
seen.set(value, cloned);
|
|
62
|
+
const keys = Object.keys(value);
|
|
63
|
+
for (const key of keys) {
|
|
64
|
+
cloned[key] = baseCloneDeep(value[key], customizer, seen);
|
|
65
|
+
}
|
|
66
|
+
return cloned;
|
|
67
|
+
}
|
|
68
|
+
function cloneDeepWith(value, customizer) {
|
|
69
|
+
return baseCloneDeep(value, customizer, new Map());
|
|
70
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced function that delays invoking func until after wait
|
|
3
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
4
|
+
* invoked. The debounced function comes with a cancel method to cancel
|
|
5
|
+
* delayed func invocations and a flush method to immediately invoke them.
|
|
6
|
+
*
|
|
7
|
+
* Supports options: { leading, trailing, maxWait }
|
|
8
|
+
* Drop-in replacement for lodash/debounce.
|
|
9
|
+
*/
|
|
10
|
+
export interface DebounceOptions {
|
|
11
|
+
leading?: boolean;
|
|
12
|
+
trailing?: boolean;
|
|
13
|
+
maxWait?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface DebouncedFunction<T extends (...args: any[]) => any> {
|
|
16
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
17
|
+
cancel(): void;
|
|
18
|
+
flush(): ReturnType<T> | undefined;
|
|
19
|
+
}
|
|
20
|
+
export default function debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: DebounceOptions): DebouncedFunction<T>;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a debounced function that delays invoking func until after wait
|
|
4
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
5
|
+
* invoked. The debounced function comes with a cancel method to cancel
|
|
6
|
+
* delayed func invocations and a flush method to immediately invoke them.
|
|
7
|
+
*
|
|
8
|
+
* Supports options: { leading, trailing, maxWait }
|
|
9
|
+
* Drop-in replacement for lodash/debounce.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.default = debounce;
|
|
13
|
+
function debounce(func, wait = 0, options) {
|
|
14
|
+
let lastArgs;
|
|
15
|
+
let lastThis;
|
|
16
|
+
let result;
|
|
17
|
+
let timerId;
|
|
18
|
+
let lastCallTime;
|
|
19
|
+
let lastInvokeTime = 0;
|
|
20
|
+
const leading = options?.leading ?? false;
|
|
21
|
+
const trailing = options?.trailing ?? true;
|
|
22
|
+
const maxWait = options?.maxWait;
|
|
23
|
+
const hasMaxWait = maxWait !== undefined;
|
|
24
|
+
const maxing = hasMaxWait;
|
|
25
|
+
function invokeFunc(time) {
|
|
26
|
+
const args = lastArgs;
|
|
27
|
+
const thisArg = lastThis;
|
|
28
|
+
lastArgs = undefined;
|
|
29
|
+
lastThis = undefined;
|
|
30
|
+
lastInvokeTime = time;
|
|
31
|
+
result = func.apply(thisArg, args);
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
function startTimer(pendingFunc, waitMs) {
|
|
35
|
+
timerId = setTimeout(pendingFunc, waitMs);
|
|
36
|
+
}
|
|
37
|
+
function cancelTimer() {
|
|
38
|
+
if (timerId !== undefined) {
|
|
39
|
+
clearTimeout(timerId);
|
|
40
|
+
}
|
|
41
|
+
timerId = undefined;
|
|
42
|
+
}
|
|
43
|
+
function remainingWait(time) {
|
|
44
|
+
const timeSinceLastCall = time - (lastCallTime ?? 0);
|
|
45
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
46
|
+
const timeWaiting = wait - timeSinceLastCall;
|
|
47
|
+
return maxing
|
|
48
|
+
? Math.min(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
49
|
+
: timeWaiting;
|
|
50
|
+
}
|
|
51
|
+
function shouldInvoke(time) {
|
|
52
|
+
const timeSinceLastCall = time - (lastCallTime ?? 0);
|
|
53
|
+
const timeSinceLastInvoke = time - lastInvokeTime;
|
|
54
|
+
return (lastCallTime === undefined ||
|
|
55
|
+
timeSinceLastCall >= wait ||
|
|
56
|
+
timeSinceLastCall < 0 ||
|
|
57
|
+
(maxing && timeSinceLastInvoke >= maxWait));
|
|
58
|
+
}
|
|
59
|
+
function timerExpired() {
|
|
60
|
+
const time = Date.now();
|
|
61
|
+
if (shouldInvoke(time)) {
|
|
62
|
+
trailingEdge(time);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Restart the timer
|
|
66
|
+
startTimer(timerExpired, remainingWait(time));
|
|
67
|
+
}
|
|
68
|
+
function trailingEdge(time) {
|
|
69
|
+
timerId = undefined;
|
|
70
|
+
if (trailing && lastArgs) {
|
|
71
|
+
invokeFunc(time);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
lastArgs = undefined;
|
|
75
|
+
lastThis = undefined;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function leadingEdge(time) {
|
|
79
|
+
lastInvokeTime = time;
|
|
80
|
+
startTimer(timerExpired, wait);
|
|
81
|
+
if (leading) {
|
|
82
|
+
invokeFunc(time);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function debounced(...args) {
|
|
86
|
+
const time = Date.now();
|
|
87
|
+
const isInvoking = shouldInvoke(time);
|
|
88
|
+
lastArgs = args;
|
|
89
|
+
lastThis = this;
|
|
90
|
+
lastCallTime = time;
|
|
91
|
+
if (isInvoking) {
|
|
92
|
+
if (timerId === undefined) {
|
|
93
|
+
leadingEdge(time);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
if (maxing) {
|
|
97
|
+
// Handle invocations in a tight loop with maxWait
|
|
98
|
+
cancelTimer();
|
|
99
|
+
startTimer(timerExpired, wait);
|
|
100
|
+
invokeFunc(time);
|
|
101
|
+
return result;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (timerId === undefined) {
|
|
105
|
+
startTimer(timerExpired, wait);
|
|
106
|
+
}
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
debounced.cancel = function cancel() {
|
|
110
|
+
cancelTimer();
|
|
111
|
+
lastInvokeTime = 0;
|
|
112
|
+
lastArgs = undefined;
|
|
113
|
+
lastCallTime = undefined;
|
|
114
|
+
lastThis = undefined;
|
|
115
|
+
};
|
|
116
|
+
debounced.flush = function flush() {
|
|
117
|
+
if (timerId === undefined) {
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
trailingEdge(Date.now());
|
|
121
|
+
return result;
|
|
122
|
+
};
|
|
123
|
+
return debounced;
|
|
124
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = flattenDeep;
|
|
4
|
+
/**
|
|
5
|
+
* Recursively flattens array.
|
|
6
|
+
* Drop-in replacement for lodash/flattenDeep.
|
|
7
|
+
*/
|
|
8
|
+
function flattenDeep(array) {
|
|
9
|
+
return array.flat(Infinity);
|
|
10
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Gets the value at path of object. If the resolved value is undefined,
|
|
4
|
+
* the defaultValue is returned in its place.
|
|
5
|
+
* Drop-in replacement for lodash/get.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.default = get;
|
|
9
|
+
const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
10
|
+
function toPath(path) {
|
|
11
|
+
if (Array.isArray(path)) {
|
|
12
|
+
return path;
|
|
13
|
+
}
|
|
14
|
+
const result = [];
|
|
15
|
+
const str = String(path);
|
|
16
|
+
str.replace(rePropName, (match, number, quote, subString) => {
|
|
17
|
+
result.push(quote ? subString.replace(/\\(\\)?/g, '$1') : number || match);
|
|
18
|
+
return match;
|
|
19
|
+
});
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
function get(object, path, defaultValue) {
|
|
23
|
+
if (typeof path === 'string' && path === '') {
|
|
24
|
+
return defaultValue;
|
|
25
|
+
}
|
|
26
|
+
const keys = toPath(path);
|
|
27
|
+
if (keys.length === 0) {
|
|
28
|
+
return defaultValue;
|
|
29
|
+
}
|
|
30
|
+
let result = object;
|
|
31
|
+
for (const key of keys) {
|
|
32
|
+
if (result == null) {
|
|
33
|
+
return defaultValue;
|
|
34
|
+
}
|
|
35
|
+
result = result[key];
|
|
36
|
+
}
|
|
37
|
+
return result === undefined ? defaultValue : result;
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { default as chunk } from './chunk';
|
|
2
|
+
export { default as clamp } from './clamp';
|
|
3
|
+
export { default as cloneDeepWith } from './cloneDeepWith';
|
|
4
|
+
export { default as debounce } from './debounce';
|
|
5
|
+
export { default as flatten } from './flatten';
|
|
6
|
+
export { default as flattenDeep } from './flattenDeep';
|
|
7
|
+
export { default as get } from './get';
|
|
8
|
+
export { default as isArray } from './isArray';
|
|
9
|
+
export { default as isEqual } from './isEqual';
|
|
10
|
+
export { default as isObject } from './isObject';
|
|
11
|
+
export { default as isPlainObject } from './isPlainObject';
|
|
12
|
+
export { default as kebabCase } from './kebabCase';
|
|
13
|
+
export { default as merge } from './merge';
|
|
14
|
+
export { default as mergeWith } from './mergeWith';
|
|
15
|
+
export { default as orderBy } from './orderBy';
|
|
16
|
+
export { default as parseInt } from './parseInt';
|
|
17
|
+
export { default as sentenceCase } from './sentenceCase';
|
|
18
|
+
export { default as startCase } from './startCase';
|
|
19
|
+
export { default as throttle } from './throttle';
|
|
20
|
+
export { default as toNumber } from './toNumber';
|
|
21
|
+
export { default as uniq } from './uniq';
|
|
22
|
+
export { default as uniqBy } from './uniqBy';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uniqBy = exports.uniq = exports.toNumber = exports.throttle = exports.startCase = exports.sentenceCase = exports.parseInt = exports.orderBy = exports.mergeWith = exports.merge = exports.kebabCase = exports.isPlainObject = exports.isObject = exports.isEqual = exports.isArray = exports.get = exports.flattenDeep = exports.flatten = exports.debounce = exports.cloneDeepWith = exports.clamp = exports.chunk = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
var chunk_1 = require("./chunk");
|
|
6
|
+
Object.defineProperty(exports, "chunk", { enumerable: true, get: function () { return tslib_1.__importDefault(chunk_1).default; } });
|
|
7
|
+
var clamp_1 = require("./clamp");
|
|
8
|
+
Object.defineProperty(exports, "clamp", { enumerable: true, get: function () { return tslib_1.__importDefault(clamp_1).default; } });
|
|
9
|
+
var cloneDeepWith_1 = require("./cloneDeepWith");
|
|
10
|
+
Object.defineProperty(exports, "cloneDeepWith", { enumerable: true, get: function () { return tslib_1.__importDefault(cloneDeepWith_1).default; } });
|
|
11
|
+
var debounce_1 = require("./debounce");
|
|
12
|
+
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return tslib_1.__importDefault(debounce_1).default; } });
|
|
13
|
+
var flatten_1 = require("./flatten");
|
|
14
|
+
Object.defineProperty(exports, "flatten", { enumerable: true, get: function () { return tslib_1.__importDefault(flatten_1).default; } });
|
|
15
|
+
var flattenDeep_1 = require("./flattenDeep");
|
|
16
|
+
Object.defineProperty(exports, "flattenDeep", { enumerable: true, get: function () { return tslib_1.__importDefault(flattenDeep_1).default; } });
|
|
17
|
+
var get_1 = require("./get");
|
|
18
|
+
Object.defineProperty(exports, "get", { enumerable: true, get: function () { return tslib_1.__importDefault(get_1).default; } });
|
|
19
|
+
var isArray_1 = require("./isArray");
|
|
20
|
+
Object.defineProperty(exports, "isArray", { enumerable: true, get: function () { return tslib_1.__importDefault(isArray_1).default; } });
|
|
21
|
+
var isEqual_1 = require("./isEqual");
|
|
22
|
+
Object.defineProperty(exports, "isEqual", { enumerable: true, get: function () { return tslib_1.__importDefault(isEqual_1).default; } });
|
|
23
|
+
var isObject_1 = require("./isObject");
|
|
24
|
+
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return tslib_1.__importDefault(isObject_1).default; } });
|
|
25
|
+
var isPlainObject_1 = require("./isPlainObject");
|
|
26
|
+
Object.defineProperty(exports, "isPlainObject", { enumerable: true, get: function () { return tslib_1.__importDefault(isPlainObject_1).default; } });
|
|
27
|
+
var kebabCase_1 = require("./kebabCase");
|
|
28
|
+
Object.defineProperty(exports, "kebabCase", { enumerable: true, get: function () { return tslib_1.__importDefault(kebabCase_1).default; } });
|
|
29
|
+
var merge_1 = require("./merge");
|
|
30
|
+
Object.defineProperty(exports, "merge", { enumerable: true, get: function () { return tslib_1.__importDefault(merge_1).default; } });
|
|
31
|
+
var mergeWith_1 = require("./mergeWith");
|
|
32
|
+
Object.defineProperty(exports, "mergeWith", { enumerable: true, get: function () { return tslib_1.__importDefault(mergeWith_1).default; } });
|
|
33
|
+
var orderBy_1 = require("./orderBy");
|
|
34
|
+
Object.defineProperty(exports, "orderBy", { enumerable: true, get: function () { return tslib_1.__importDefault(orderBy_1).default; } });
|
|
35
|
+
var parseInt_1 = require("./parseInt");
|
|
36
|
+
Object.defineProperty(exports, "parseInt", { enumerable: true, get: function () { return tslib_1.__importDefault(parseInt_1).default; } });
|
|
37
|
+
var sentenceCase_1 = require("./sentenceCase");
|
|
38
|
+
Object.defineProperty(exports, "sentenceCase", { enumerable: true, get: function () { return tslib_1.__importDefault(sentenceCase_1).default; } });
|
|
39
|
+
var startCase_1 = require("./startCase");
|
|
40
|
+
Object.defineProperty(exports, "startCase", { enumerable: true, get: function () { return tslib_1.__importDefault(startCase_1).default; } });
|
|
41
|
+
var throttle_1 = require("./throttle");
|
|
42
|
+
Object.defineProperty(exports, "throttle", { enumerable: true, get: function () { return tslib_1.__importDefault(throttle_1).default; } });
|
|
43
|
+
var toNumber_1 = require("./toNumber");
|
|
44
|
+
Object.defineProperty(exports, "toNumber", { enumerable: true, get: function () { return tslib_1.__importDefault(toNumber_1).default; } });
|
|
45
|
+
var uniq_1 = require("./uniq");
|
|
46
|
+
Object.defineProperty(exports, "uniq", { enumerable: true, get: function () { return tslib_1.__importDefault(uniq_1).default; } });
|
|
47
|
+
var uniqBy_1 = require("./uniqBy");
|
|
48
|
+
Object.defineProperty(exports, "uniqBy", { enumerable: true, get: function () { return tslib_1.__importDefault(uniqBy_1).default; } });
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Performs a deep comparison between two values to determine if they are equivalent.
|
|
4
|
+
* Drop-in replacement for lodash/isEqual.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.default = isEqual;
|
|
8
|
+
function baseIsEqual(a, b, seen) {
|
|
9
|
+
// Identical references or primitives
|
|
10
|
+
if (a === b) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
// NaN check
|
|
14
|
+
if (a !== a && b !== b) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
// Null/undefined/primitive mismatch
|
|
18
|
+
if (a == null || b == null) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const typeA = typeof a;
|
|
22
|
+
const typeB = typeof b;
|
|
23
|
+
if (typeA !== typeB) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (typeA !== 'object') {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
// Date
|
|
30
|
+
if (a instanceof Date && b instanceof Date) {
|
|
31
|
+
return a.getTime() === b.getTime();
|
|
32
|
+
}
|
|
33
|
+
// RegExp
|
|
34
|
+
if (a instanceof RegExp && b instanceof RegExp) {
|
|
35
|
+
return a.source === b.source && a.flags === b.flags;
|
|
36
|
+
}
|
|
37
|
+
// One is Date/RegExp but the other is not
|
|
38
|
+
if (a instanceof Date !== b instanceof Date) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
if (a instanceof RegExp !== b instanceof RegExp) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
// Circular reference detection
|
|
45
|
+
if (seen.has(a)) {
|
|
46
|
+
return seen.get(a) === b;
|
|
47
|
+
}
|
|
48
|
+
seen.set(a, b);
|
|
49
|
+
// Arrays
|
|
50
|
+
if (Array.isArray(a)) {
|
|
51
|
+
if (!Array.isArray(b) || a.length !== b.length) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
for (let i = 0; i < a.length; i++) {
|
|
55
|
+
if (!baseIsEqual(a[i], b[i], seen)) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (Array.isArray(b)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
// Map
|
|
65
|
+
if (a instanceof Map && b instanceof Map) {
|
|
66
|
+
if (a.size !== b.size) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
for (const [key, val] of a) {
|
|
70
|
+
if (!b.has(key) || !baseIsEqual(val, b.get(key), seen)) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
// Set (unordered deep comparison, matching lodash behavior)
|
|
77
|
+
if (a instanceof Set && b instanceof Set) {
|
|
78
|
+
if (a.size !== b.size) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
for (const valA of a) {
|
|
82
|
+
let found = false;
|
|
83
|
+
for (const valB of b) {
|
|
84
|
+
if (baseIsEqual(valA, valB, new Map(seen))) {
|
|
85
|
+
found = true;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (!found) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
// ArrayBuffer / TypedArray
|
|
96
|
+
if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
|
|
97
|
+
const viewA = a;
|
|
98
|
+
const viewB = b;
|
|
99
|
+
if (viewA.length !== viewB.length) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
for (let i = 0; i < viewA.length; i++) {
|
|
103
|
+
if (viewA[i] !== viewB[i]) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
// Plain objects
|
|
110
|
+
const keysA = Object.keys(a);
|
|
111
|
+
const keysB = Object.keys(b);
|
|
112
|
+
if (keysA.length !== keysB.length) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
for (const key of keysA) {
|
|
116
|
+
if (!Object.prototype.hasOwnProperty.call(b, key)) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
if (!baseIsEqual(a[key], b[key], seen)) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
function isEqual(value, other) {
|
|
126
|
+
return baseIsEqual(value, other, new Map());
|
|
127
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = isObject;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if value is the language type of Object.
|
|
6
|
+
* (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))
|
|
7
|
+
* Drop-in replacement for lodash/isObject.
|
|
8
|
+
*/
|
|
9
|
+
function isObject(value) {
|
|
10
|
+
const type = typeof value;
|
|
11
|
+
return value != null && (type === 'object' || type === 'function');
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if value is a plain object, that is, an object created by the
|
|
3
|
+
* Object constructor or one with a [[Prototype]] of null.
|
|
4
|
+
* Drop-in replacement for lodash/isPlainObject.
|
|
5
|
+
*/
|
|
6
|
+
export default function isPlainObject(value: any): value is Record<string, any>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = isPlainObject;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if value is a plain object, that is, an object created by the
|
|
6
|
+
* Object constructor or one with a [[Prototype]] of null.
|
|
7
|
+
* Drop-in replacement for lodash/isPlainObject.
|
|
8
|
+
*/
|
|
9
|
+
function isPlainObject(value) {
|
|
10
|
+
if (value === null || value === undefined || typeof value !== 'object') {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
const proto = Object.getPrototypeOf(value);
|
|
14
|
+
// Object.create(null)
|
|
15
|
+
if (proto === null) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
// Normal plain objects
|
|
19
|
+
return proto === Object.prototype;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Converts string to kebab-case.
|
|
4
|
+
* Drop-in replacement for lodash/kebabCase.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.default = kebabCase;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const words_1 = tslib_1.__importDefault(require("./words"));
|
|
10
|
+
function kebabCase(string) {
|
|
11
|
+
return (0, words_1.default)(string).map((w) => w.toLowerCase()).join('-');
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively merges own enumerable string keyed properties of source objects into
|
|
3
|
+
* the destination object. Source properties that resolve to undefined are skipped if
|
|
4
|
+
* a destination value exists. Array and plain object properties are merged recursively.
|
|
5
|
+
* Other objects and value types are overridden by assignment.
|
|
6
|
+
* Drop-in replacement for lodash/merge.
|
|
7
|
+
*/
|
|
8
|
+
export default function merge<TObject, TSource1>(object: TObject, source1: TSource1): TObject & TSource1;
|
|
9
|
+
export default function merge<TObject, TSource1, TSource2>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
|
|
10
|
+
export default function merge<TObject, TSource1, TSource2, TSource3>(object: TObject, source1: TSource1, source2: TSource2, source3: TSource3): TObject & TSource1 & TSource2 & TSource3;
|
|
11
|
+
export default function merge(target: any, ...sources: any[]): any;
|