@adaptabletools/adaptable-cjs 22.0.0-canary.11 → 22.0.0-canary.13

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 (141) hide show
  1. package/index.css +3 -12
  2. package/index.css.map +1 -1
  3. package/index.d.ts +8 -8
  4. package/index.js +8 -8
  5. package/package.json +1 -4
  6. package/src/AdaptableOptions/UserInterfaceOptions.d.ts +2 -2
  7. package/src/AdaptableState/Common/AdaptableColumn.d.ts +3 -3
  8. package/src/AdaptableState/Common/AdaptableForm.d.ts +1 -1
  9. package/src/AdaptableState/InitialState.d.ts +1 -1
  10. package/src/AdaptableState/UserInterfaceState.d.ts +1 -1
  11. package/src/Api/ColumnApi.d.ts +1 -1
  12. package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -1
  13. package/src/Api/Implementation/ColumnApiImpl.js +4 -4
  14. package/src/Api/Implementation/LayoutHelpers.js +1 -1
  15. package/src/Api/Internal/ColumnInternalApi.d.ts +1 -1
  16. package/src/Api/Internal/ColumnInternalApi.js +5 -3
  17. package/src/Api/Internal/EventInternalApi.js +1 -1
  18. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
  19. package/src/Redux/Store/AdaptableReduxMerger.js +5 -6
  20. package/src/Strategy/FormatColumnModule.js +2 -2
  21. package/src/Strategy/LayoutModule.js +1 -1
  22. package/src/Strategy/StyledColumnModule.js +14 -6
  23. package/src/Strategy/TeamSharingModule.js +2 -2
  24. package/src/Strategy/Utilities/FormatColumn/{getFormatColumnSettingsTargetItems.d.ts → getFormatColumnRowTargetItems.d.ts} +1 -1
  25. package/src/Strategy/Utilities/FormatColumn/getFormatColumnRowTargetItems.js +26 -0
  26. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsViewItems.js +5 -13
  27. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
  28. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
  29. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  30. package/src/Utilities/Extensions/StringExtensions.js +1 -1
  31. package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
  32. package/src/Utilities/Helpers/FormatHelper.js +2 -2
  33. package/src/Utilities/Services/LicenseService/index.js +1 -1
  34. package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
  35. package/src/Utilities/Services/RowSummaryService.js +2 -2
  36. package/src/Utilities/getScopeViewItems.js +1 -1
  37. package/src/Utilities/utils/chunk.d.ts +6 -0
  38. package/src/Utilities/utils/chunk.js +20 -0
  39. package/src/Utilities/utils/clamp.d.ts +5 -0
  40. package/src/Utilities/utils/clamp.js +10 -0
  41. package/src/Utilities/utils/cloneDeepWith.d.ts +9 -0
  42. package/src/Utilities/utils/cloneDeepWith.js +70 -0
  43. package/src/Utilities/utils/debounce.d.ts +20 -0
  44. package/src/Utilities/utils/debounce.js +124 -0
  45. package/src/Utilities/utils/flatten.d.ts +5 -0
  46. package/src/Utilities/utils/flatten.js +10 -0
  47. package/src/Utilities/utils/flattenDeep.d.ts +5 -0
  48. package/src/Utilities/utils/flattenDeep.js +10 -0
  49. package/src/Utilities/utils/get.d.ts +6 -0
  50. package/src/Utilities/utils/get.js +38 -0
  51. package/src/Utilities/utils/index.d.ts +22 -0
  52. package/src/Utilities/utils/index.js +48 -0
  53. package/src/Utilities/utils/isArray.d.ts +6 -0
  54. package/src/Utilities/utils/isArray.js +8 -0
  55. package/src/Utilities/utils/isEqual.d.ts +5 -0
  56. package/src/Utilities/utils/isEqual.js +127 -0
  57. package/src/Utilities/utils/isObject.d.ts +6 -0
  58. package/src/Utilities/utils/isObject.js +12 -0
  59. package/src/Utilities/utils/isPlainObject.d.ts +6 -0
  60. package/src/Utilities/utils/isPlainObject.js +20 -0
  61. package/src/Utilities/utils/kebabCase.d.ts +5 -0
  62. package/src/Utilities/utils/kebabCase.js +12 -0
  63. package/src/Utilities/utils/merge.d.ts +11 -0
  64. package/src/Utilities/utils/merge.js +44 -0
  65. package/src/Utilities/utils/mergeWith.d.ts +7 -0
  66. package/src/Utilities/utils/mergeWith.js +50 -0
  67. package/src/Utilities/utils/orderBy.d.ts +8 -0
  68. package/src/Utilities/utils/orderBy.js +33 -0
  69. package/src/Utilities/utils/parseInt.d.ts +6 -0
  70. package/src/Utilities/utils/parseInt.js +12 -0
  71. package/src/Utilities/utils/sentenceCase.d.ts +6 -0
  72. package/src/Utilities/utils/sentenceCase.js +19 -0
  73. package/src/Utilities/utils/startCase.d.ts +5 -0
  74. package/src/Utilities/utils/startCase.js +15 -0
  75. package/src/Utilities/utils/throttle.d.ts +17 -0
  76. package/src/Utilities/utils/throttle.js +23 -0
  77. package/src/Utilities/utils/toNumber.d.ts +5 -0
  78. package/src/Utilities/utils/toNumber.js +42 -0
  79. package/src/Utilities/utils/uniq.d.ts +7 -0
  80. package/src/Utilities/utils/uniq.js +12 -0
  81. package/src/Utilities/utils/uniqBy.d.ts +8 -0
  82. package/src/Utilities/utils/uniqBy.js +25 -0
  83. package/src/Utilities/utils/words.d.ts +7 -0
  84. package/src/Utilities/utils/words.js +13 -0
  85. package/src/Utilities/weightedAverage.js +1 -1
  86. package/src/View/AdaptableComputedCSSVarsContext.js +1 -1
  87. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
  88. package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
  89. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  90. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
  91. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +2 -2
  92. package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +2 -2
  93. package/src/View/Components/RangesComponent.js +1 -1
  94. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
  95. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
  96. package/src/View/Components/ValueSelector/index.js +7 -2
  97. package/src/View/Dashboard/CustomDashboardButton.js +1 -1
  98. package/src/View/Dashboard/Dashboard.js +1 -1
  99. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
  100. package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
  101. package/src/View/Export/Wizard/NewReportWizard.js +8 -8
  102. package/src/View/Filter/FilterViewPanel.d.ts +1 -1
  103. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +19 -10
  104. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +1 -1
  105. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
  106. package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.d.ts +8 -0
  107. package/src/View/FormatColumn/Wizard/FormatColumnRowScopeWizardSection.js +86 -0
  108. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +22 -61
  109. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -10
  110. package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
  111. package/src/View/Layout/LayoutViewPanel.js +1 -1
  112. package/src/View/Layout/Wizard/sections/ColumnsSection.js +1 -1
  113. package/src/View/Note/NoteEditor.js +1 -1
  114. package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
  115. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  116. package/src/View/StyledColumn/Wizard/StyledColumnBadgeRowsSection.d.ts +8 -0
  117. package/src/View/StyledColumn/Wizard/{StyledColumnWizardSettingsSection.js → StyledColumnBadgeRowsSection.js} +22 -22
  118. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +10 -11
  119. package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
  120. package/src/View/Theme/ThemeEditor.js +1 -1
  121. package/src/View/Theme/ThemeField.js +1 -1
  122. package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
  123. package/src/agGrid/AdaptableAgGrid.js +2 -2
  124. package/src/agGrid/AgGridAdapter.js +4 -4
  125. package/src/agGrid/AgGridColumnAdapter.js +2 -2
  126. package/src/agGrid/cellRenderers/PercentBarRenderer.js +1 -1
  127. package/src/components/ColorPicker/ColorPicker.js +1 -1
  128. package/src/components/DropdownButton/renderItem.js +1 -1
  129. package/src/components/FormLayout/index.js +1 -1
  130. package/src/components/OverlayTrigger/index.js +1 -1
  131. package/src/env.js +2 -2
  132. package/src/layout-manager/src/isLayoutEqual.js +1 -1
  133. package/src/metamodel/adaptable.metamodel.js +1 -1
  134. package/src/migration/VersionUpgrade22.js +9 -0
  135. package/tsconfig.cjs.tsbuildinfo +1 -1
  136. package/src/Strategy/Utilities/FormatColumn/getFormatColumnSettingsTargetItems.js +0 -16
  137. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.d.ts +0 -8
  138. package/src/View/FormatColumn/Wizard/FormatColumnTargetWizardSection.js +0 -37
  139. package/src/View/StyledColumn/Wizard/StyledColumnWizardSettingsSection.d.ts +0 -8
  140. /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.d.ts → FormatColumnColumnScopeWizardSection.d.ts} +0 -0
  141. /package/src/View/FormatColumn/Wizard/{FormatColumnScopeWizardSection.js → FormatColumnColumnScopeWizardSection.js} +0 -0
@@ -32,6 +32,6 @@ export declare class ColumnInternalApi extends ApiBase {
32
32
  private buildColumnHeaderContext;
33
33
  hasArrayDataType(column: AdaptableColumn): boolean;
34
34
  getQueryableColumnsForUIEditor(): AdaptableColumn[];
35
- isAlwaysHiddenColumn(columnIdentifier: string | ColDef): boolean;
35
+ isColumnUIHidden(columnIdentifier: string | ColDef): boolean;
36
36
  getColumnDateTypes(): AdaptableColumnDataType[];
37
37
  }
@@ -5,7 +5,7 @@ exports.getAutoRowGroupColumnIdFor = getAutoRowGroupColumnIdFor;
5
5
  const tslib_1 = require("tslib");
6
6
  const ApiBase_1 = require("../Implementation/ApiBase");
7
7
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
8
- const uniq_1 = tslib_1.__importDefault(require("lodash/uniq"));
8
+ const uniq_1 = tslib_1.__importDefault(require("../../Utilities/utils/uniq"));
9
9
  const StringExtensions_1 = tslib_1.__importDefault(require("../../Utilities/Extensions/StringExtensions"));
10
10
  const ColumnApiImpl_1 = require("../Implementation/ColumnApiImpl");
11
11
  const destructurePivotColumnId_1 = require("../../layout-manager/src/destructurePivotColumnId");
@@ -282,9 +282,11 @@ class ColumnInternalApi extends ApiBase_1.ApiBase {
282
282
  getQueryableColumnsForUIEditor() {
283
283
  return this.getColumnApi()
284
284
  .getQueryableColumns()
285
- .filter((column) => !column.isGeneratedPivotResultColumn && !column.isGeneratedRowGroupColumn && !column.isGeneratedSelectionColumn);
285
+ .filter((column) => !column.isGeneratedPivotResultColumn &&
286
+ !column.isGeneratedRowGroupColumn &&
287
+ !column.isGeneratedSelectionColumn);
286
288
  }
287
- isAlwaysHiddenColumn(columnIdentifier) {
289
+ isColumnUIHidden(columnIdentifier) {
288
290
  return this.getColumnApi().hasColumnType(columnIdentifier, AdaptableColumn_1.HIDDEN_COLUMN_TYPE);
289
291
  }
290
292
  getColumnDateTypes() {
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventInternalApi = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ApiBase_1 = require("../Implementation/ApiBase");
6
- const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
6
+ const isEqual_1 = tslib_1.__importDefault(require("../../Utilities/utils/isEqual"));
7
7
  class EventInternalApi extends ApiBase_1.ApiBase {
8
8
  fireGridSortedEvent() {
9
9
  if (this.isAdapTableReady()) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createEngine = createEngine;
4
4
  const tslib_1 = require("tslib");
5
- const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
5
+ const debounce_1 = tslib_1.__importDefault(require("../../Utilities/utils/debounce"));
6
6
  const AdaptableReduxMerger_1 = require("./AdaptableReduxMerger");
7
7
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
8
8
  const buildAdaptableStateFunctionConfig_1 = require("./buildAdaptableStateFunctionConfig");
@@ -6,11 +6,10 @@ exports.ProcessKeepUserDefinedRevision = ProcessKeepUserDefinedRevision;
6
6
  exports.MergeStateFunction = MergeStateFunction;
7
7
  exports.MergeState = MergeState;
8
8
  const tslib_1 = require("tslib");
9
- const mergeWith_1 = tslib_1.__importDefault(require("lodash/mergeWith"));
10
- const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
11
- const isArray_1 = tslib_1.__importDefault(require("lodash/isArray"));
12
- const extend_1 = tslib_1.__importDefault(require("lodash/extend"));
13
- const isObject_1 = tslib_1.__importDefault(require("lodash/isObject"));
9
+ const mergeWith_1 = tslib_1.__importDefault(require("../../Utilities/utils/mergeWith"));
10
+ const merge_1 = tslib_1.__importDefault(require("../../Utilities/utils/merge"));
11
+ const isArray_1 = tslib_1.__importDefault(require("../../Utilities/utils/isArray"));
12
+ const isObject_1 = tslib_1.__importDefault(require("../../Utilities/utils/isObject"));
14
13
  const AdaptableLogger_1 = require("../../agGrid/AdaptableLogger");
15
14
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
16
15
  function customizer(objValue, srcValue) {
@@ -120,7 +119,7 @@ function MergeStateFunction(oldState, newState) {
120
119
  }
121
120
  // main merge function
122
121
  function MergeState(oldState, newState) {
123
- const result = (0, extend_1.default)({}, oldState);
122
+ const result = Object.assign({}, oldState);
124
123
  for (const key in newState) {
125
124
  if (!newState.hasOwnProperty(key)) {
126
125
  continue;
@@ -13,7 +13,7 @@ const MoveFormatColumn_1 = require("../View/FormatColumn/MoveFormatColumn");
13
13
  const getObjectTagsViewItems_1 = require("../Utilities/getObjectTagsViewItems");
14
14
  const getRuleViewItems_1 = require("../Utilities/getRuleViewItems");
15
15
  const getScopeViewItems_1 = require("../Utilities/getScopeViewItems");
16
- const getFormatColumnSettingsTargetItems_1 = require("./Utilities/FormatColumn/getFormatColumnSettingsTargetItems");
16
+ const getFormatColumnRowTargetItems_1 = require("./Utilities/FormatColumn/getFormatColumnRowTargetItems");
17
17
  const FormatColumnStyleWizardSection_1 = require("../View/FormatColumn/Wizard/FormatColumnStyleWizardSection");
18
18
  class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
19
19
  constructor(api) {
@@ -91,7 +91,7 @@ class FormatColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
91
91
  values: [formatColumn.Name],
92
92
  },
93
93
  (0, getScopeViewItems_1.getScopeViewItems)(formatColumn.Scope, this.api),
94
- (0, getFormatColumnSettingsTargetItems_1.getFormatColumnSettingsTargetItems)(formatColumn),
94
+ (0, getFormatColumnRowTargetItems_1.getFormatColumnRowTargetItems)(formatColumn),
95
95
  formatColumn.Rule && (0, getRuleViewItems_1.getRuleViewItems)(formatColumn.Rule, this.api),
96
96
  {
97
97
  name: 'Style',
@@ -15,7 +15,7 @@ const getLayoutFilterViewItems_1 = require("./Utilities/Layout/getLayoutFilterVi
15
15
  const getLayoutSortViewItems_1 = require("./Utilities/Layout/getLayoutSortViewItems");
16
16
  const AggregationColumns_1 = require("../AdaptableState/Common/AggregationColumns");
17
17
  const windowFactory_1 = require("../View/Components/Popups/WindowPopups/windowFactory");
18
- const flattenDeep_1 = tslib_1.__importDefault(require("lodash/flattenDeep"));
18
+ const flattenDeep_1 = tslib_1.__importDefault(require("../Utilities/utils/flattenDeep"));
19
19
  const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
20
20
  const getGridFilterPreview_1 = require("../View/Layout/Wizard/getGridFilterPreview");
21
21
  const RowSummaryService_1 = require("../Utilities/Services/RowSummaryService");
@@ -191,14 +191,22 @@ class StyledColumnModule extends AdaptableModuleBase_1.AdaptableModuleBase {
191
191
  });
192
192
  }
193
193
  if (styledColumn.BadgeStyle) {
194
+ let rowTypes = [];
195
+ if (!styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows) {
196
+ rowTypes.push('Data');
197
+ }
198
+ if (!styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows) {
199
+ rowTypes.push('Group');
200
+ }
201
+ if (!styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows) {
202
+ rowTypes.push('Summary');
203
+ }
204
+ if (!styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows) {
205
+ rowTypes.push('Total');
206
+ }
194
207
  specificTypeItems.push({
195
208
  name: 'Rows',
196
- values: [
197
- `Data Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeDataRows ? 'No' : 'Yes'}`,
198
- `Group Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeGroupRows ? 'No' : 'Yes'}`,
199
- `Summary Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeSummaryRows ? 'No' : 'Yes'}`,
200
- `Total Rows: ${styledColumn.BadgeStyle?.RowScope?.ExcludeTotalRows ? 'No' : 'Yes'}`,
201
- ],
209
+ values: rowTypes
202
210
  });
203
211
  }
204
212
  if (styledColumn.BadgeStyle) {
@@ -6,13 +6,13 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
6
6
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
7
7
  const TeamSharingRedux_1 = require("../Redux/ActionsReducers/TeamSharingRedux");
8
8
  const TeamSharingRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/TeamSharingRedux"));
9
- const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
9
+ const isEqual_1 = tslib_1.__importDefault(require("../Utilities/utils/isEqual"));
10
10
  const LayoutRedux_1 = require("../Redux/ActionsReducers/LayoutRedux");
11
11
  const SharedEntityObjectView_1 = require("../View/TeamSharing/SharedEntityObjectView");
12
12
  const TeamSharingApplyButton_1 = require("../View/TeamSharing/TeamSharingApplyButton");
13
13
  const SharedEntityDependencies_1 = require("../View/TeamSharing/SharedEntityDependencies");
14
14
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/ArrayExtensions"));
15
- const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
15
+ const flatten_1 = tslib_1.__importDefault(require("../Utilities/utils/flatten"));
16
16
  const AdaptableHelper_1 = tslib_1.__importDefault(require("../Utilities/Helpers/AdaptableHelper"));
17
17
  class TeamSharingModule extends AdaptableModuleBase_1.AdaptableModuleBase {
18
18
  SKIP_TEAMSHARING_UPDATE_ACTIONS = [
@@ -1,5 +1,5 @@
1
1
  import { FormatColumn } from '../../../AdaptableState/FormatColumnState';
2
- export declare const getFormatColumnSettingsTargetItems: (formatColumn: FormatColumn) => {
2
+ export declare const getFormatColumnRowTargetItems: (formatColumn: FormatColumn) => {
3
3
  name: string;
4
4
  values: string[];
5
5
  };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFormatColumnRowTargetItems = void 0;
4
+ const getFormatColumnRowTargetItems = (formatColumn) => {
5
+ let values = [];
6
+ if (formatColumn.RowScope) {
7
+ if (!formatColumn.RowScope.ExcludeDataRows) {
8
+ values.push('Data');
9
+ }
10
+ if (!formatColumn.RowScope.ExcludeGroupRows) {
11
+ values.push('Group');
12
+ }
13
+ if (!formatColumn.RowScope.ExcludeSummaryRows) {
14
+ values.push('Summary');
15
+ }
16
+ if (!formatColumn.RowScope.ExcludeTotalRows) {
17
+ values.push('Total');
18
+ }
19
+ }
20
+ values = values.filter(Boolean);
21
+ return {
22
+ name: 'Rows',
23
+ values: values.length > 0 ? values : ['-'],
24
+ };
25
+ };
26
+ exports.getFormatColumnRowTargetItems = getFormatColumnRowTargetItems;
@@ -3,19 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getFormatColumnSettingsViewItems = void 0;
4
4
  const getFormatColumnSettingsViewItems = (formatColumn) => {
5
5
  let values = [];
6
- if (formatColumn.RowScope) {
7
- if (formatColumn.RowScope.ExcludeDataRows) {
8
- values.push('Exclude Data Rows');
9
- }
10
- if (formatColumn.RowScope.ExcludeGroupRows) {
11
- values.push('Exclude Group Rows');
12
- }
13
- if (formatColumn.RowScope.ExcludeSummaryRows) {
14
- values.push('Exclude Summary Rows');
15
- }
16
- if (formatColumn.RowScope.ExcludeTotalRows) {
17
- values.push('Exclude Total Rows');
18
- }
6
+ if (!formatColumn.Target || formatColumn.Target === 'cell') {
7
+ values.push('Target: Column Cells');
8
+ }
9
+ else {
10
+ values.push('Target: Column Header');
19
11
  }
20
12
  if (formatColumn.ColumnGroupScope) {
21
13
  values.push(`Column Groups: ${formatColumn.ColumnGroupScope === 'Both' ? 'Always' : formatColumn.ColumnGroupScope}`);
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.aggregatedBooleanExpressionFunctionNames = exports.aggregatedBooleanExpressionFunctions = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const parseInt_1 = tslib_1.__importDefault(require("lodash/parseInt"));
5
+ const parseInt_1 = tslib_1.__importDefault(require("../utils/parseInt"));
6
6
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
7
7
  const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
8
8
  const aggregatedScalarExpressionFunctions_1 = require("./aggregatedScalarExpressionFunctions");
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
6
6
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
7
7
  const operators_1 = require("rxjs/operators");
8
- const toNumber_1 = tslib_1.__importDefault(require("lodash/toNumber"));
8
+ const toNumber_1 = tslib_1.__importDefault(require("../utils/toNumber"));
9
9
  const evaluator_1 = require("../../parser/src/evaluator");
10
10
  // string functions may be case (in)sensitive, see internalApi.isTextComparisonCaseSensitive()
11
11
  // if case is insensitive, we convert ALL involved strings to lower case
@@ -4,7 +4,7 @@ exports.observableExpressionFunctionNames = exports.observableExpressionFunction
4
4
  const tslib_1 = require("tslib");
5
5
  const rxjs_1 = require("rxjs");
6
6
  const operators_1 = require("rxjs/operators");
7
- const parseInt_1 = tslib_1.__importDefault(require("lodash/parseInt"));
7
+ const parseInt_1 = tslib_1.__importDefault(require("../utils/parseInt"));
8
8
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
9
9
  const expressionFunctionUtils_1 = require("./expressionFunctionUtils");
10
10
  const TypeExtensions_1 = require("../Extensions/TypeExtensions");
@@ -22,7 +22,7 @@ exports.IsNumeric = IsNumeric;
22
22
  exports.UnescapeHtmlEntities = UnescapeHtmlEntities;
23
23
  exports.ReplaceAllOccurencesExceptLastOne = ReplaceAllOccurencesExceptLastOne;
24
24
  const tslib_1 = require("tslib");
25
- const startCase_1 = tslib_1.__importDefault(require("lodash/startCase"));
25
+ const startCase_1 = tslib_1.__importDefault(require("../utils/startCase"));
26
26
  function IsNull(stringToCheck) {
27
27
  return stringToCheck == null || stringToCheck == undefined;
28
28
  }
@@ -9,8 +9,8 @@ exports.removeAdaptableObjectPrimitivesInline = removeAdaptableObjectPrimitivesI
9
9
  exports.removeAdaptableObjectPrimitives = removeAdaptableObjectPrimitives;
10
10
  exports.isAdaptableObject = isAdaptableObject;
11
11
  const tslib_1 = require("tslib");
12
- const cloneDeepWith_1 = tslib_1.__importDefault(require("lodash/cloneDeepWith"));
13
- const isPlainObject_1 = tslib_1.__importDefault(require("lodash/isPlainObject"));
12
+ const cloneDeepWith_1 = tslib_1.__importDefault(require("../utils/cloneDeepWith"));
13
+ const isPlainObject_1 = tslib_1.__importDefault(require("../utils/isPlainObject"));
14
14
  const Uuid_1 = require("../../AdaptableState/Uuid");
15
15
  const package_json_1 = tslib_1.__importDefault(require("../../../package.json"));
16
16
  const GET_CURRENT_VERSION = () => {
@@ -6,7 +6,7 @@ exports.StringFormatter = StringFormatter;
6
6
  const tslib_1 = require("tslib");
7
7
  // TODO inspect why the following is erroring on angular build
8
8
  const date_fns_1 = require("date-fns");
9
- const sentence_case_1 = require("sentence-case");
9
+ const sentenceCase_1 = tslib_1.__importDefault(require("../utils/sentenceCase"));
10
10
  const GeneralConstants_1 = require("../Constants/GeneralConstants");
11
11
  const Helper_1 = tslib_1.__importDefault(require("./Helper"));
12
12
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
@@ -175,7 +175,7 @@ function StringFormatter(input, options = {}, rowNode, column, api) {
175
175
  s = s.toUpperCase();
176
176
  }
177
177
  else if (options.Case == 'Sentence') {
178
- s = (0, sentence_case_1.sentenceCase)(s);
178
+ s = (0, sentenceCase_1.default)(s);
179
179
  }
180
180
  }
181
181
  if (options.Trim !== undefined && options.Trim == true) {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/InternalRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("lodash/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p||(exports.LicenseValidityType=p={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},_=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===s},I=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class O{adaptable;licenseKey;packageDetails;constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",()=>{requestAnimationFrame(()=>{this.adaptable.isDestroyed||this.init()})})}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}E()||_()||I()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){const t=new Date;t.setHours(0,0,0,0);let s=0;e instanceof Error||!e?.end||(s=Math.floor((e?.end?.getTime()-t.getTime())/d),s=(0,i.default)(s,0,1/0));let p="",h="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(p=e.appName,h=" for application [APP_NAME]");const E=(e,a=o.LicenseDocsLink,t=l,i=s,n=p)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",n).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(s<=c)this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(E(`Thank you for using a valid AdapTable license${h}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseDisablePersistence)())}destroy(){}}exports.LicenseService=O;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LicenseService=exports.LicenseValidityType=void 0;const e=require("tslib"),a=require("../../../Redux/ActionsReducers/InternalRedux"),t=require("../../../Redux/ActionsReducers/PopupRedux"),s=e.__importDefault(require("../../ObjectFactory")),i=e.__importDefault(require("../../utils/clamp")),o=require("../../Constants/DocumentationLinkConstants"),n=require("../../license/decode"),r=require("./shouldLogThankYouMessage"),l="sales@adaptabletools.com",c=10,d=864e5;var p;!function(e){e.INVALID_LICENSE="INVALID_LICENSE",e.NO_LICENSE="NO_LICENSE",e.NON_PRODUCTION_VALID="NON_PRODUCTION_VALID",e.NON_PRODUCTION_EXPIRED_IN_SCOPE="NON_PRODUCTION_EXPIRED_IN_SCOPE",e.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE="NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE",e.COMMERCIAL_VALID="COMMERCIAL_VALID",e.COMMERCIAL_EXPIRED_IN_SCOPE="COMMERCIAL_EXPIRED_IN_SCOPE",e.COMMERCIAL_EXPIRED_OUT_OF_SCOPE="COMMERCIAL_EXPIRED_OUT_OF_SCOPE"}(p||(exports.LicenseValidityType=p={}));const h=()=>"undefined"!=typeof window?window.location.origin:"",E=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\d+\-\d+\-\d+\-(sandpack\.codesandbox\.io)/g.exec(e)||[]);return"https"===t&&"sandpack.codesandbox.io"===s},_=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.csb\.app)/g.exec(e)||[]);return"https"===t&&".csb.app"===s},I=()=>{const e=h(),[a,t,s]=Array.from(/(https):\/\/\S+(\.adaptabletools\.com)/g.exec(e)||[]);return"https"===t&&".adaptabletools.com"===s};class O{adaptable;licenseKey;packageDetails;constructor(e,a,t){this.adaptable=e,this.licenseKey=a,this.packageDetails=t,this.adaptable=e,this.adaptable.api.eventApi.on("AdaptableReady",()=>{requestAnimationFrame(()=>{this.adaptable.isDestroyed||this.init()})})}init(){let e=null;if(this.licenseKey)try{e=(0,n.decode)(this.licenseKey)}catch(a){e=a}E()||_()||I()||this.handleLicenseValidation(e,this.getValidityType(e,this.packageDetails))}getValidityType(e,a){if(!e)return p.NO_LICENSE;if(e instanceof Error)return p.INVALID_LICENSE;const t=new Date(a.publishedAt),s=new Date(e.end),i=s<new Date,o=e.trial;let n=null;return n=i?s>t?o?p.NON_PRODUCTION_EXPIRED_IN_SCOPE:p.COMMERCIAL_EXPIRED_IN_SCOPE:o?p.NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE:p.COMMERCIAL_EXPIRED_OUT_OF_SCOPE:o?p.NON_PRODUCTION_VALID:p.COMMERCIAL_VALID,n}handleLicenseValidation(e,a){const t=new Date;t.setHours(0,0,0,0);let s=0;e instanceof Error||!e?.end||(s=Math.floor((e?.end?.getTime()-t.getTime())/d),s=(0,i.default)(s,0,1/0));let p="",h="";!e||e instanceof Error||!e.appName||e.appName==n.GENERIC_APP_NAME||(p=e.appName,h=" for application [APP_NAME]");const E=(e,a=o.LicenseDocsLink,t=l,i=s,n=p)=>e.replace("[LINK]",a).replace("[EMAIL]",t).replace("[APP_NAME]",n).replace("[DAYS]",`${i}`);switch(a){case"NO_LICENSE":case"NON_PRODUCTION_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable does not have a license, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("No AdapTable License found."),this.showWatermark("This instance of AdapTable does not have a license, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"INVALID_LICENSE":this.adaptable.logger.consoleLogByMessageType(E("This instance of AdapTable seems to use a corrupted License, and some functionality has therefore been removed. In order to use a fully-featured version of AdapTable, please contact [EMAIL]. You can learn more about the different AdapTable license options at [LINK]."),"Error"),this.showNotification("Corrupted AdapTable License found."),this.showWatermark("This instance of AdapTable has a corrupted License, and some functionality has therefore been removed."),this.disableStatePersistence();break;case"NON_PRODUCTION_VALID":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license expires in [DAYS] days. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Info");break;case"NON_PRODUCTION_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E("This AdapTable trial license has now expired. Please contact [EMAIL] to upgrade to a commercial version of AdapTable. You can learn more about the different AdapTable license options at [LINK]."),"Warning"),this.showWatermark("AdapTable License has expired");break;case"COMMERCIAL_VALID":if(s<=c)this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} expires in [DAYS] days. Please contact [EMAIL] to renew (giving you access to Support and Updates)`),"Info");else try{(0,r.shouldLogThankYouMessage)()&&this.adaptable.logger.consoleLogByMessageType(E(`Thank you for using a valid AdapTable license${h}. Your license will expire in [DAYS] days.`),"Info")}catch(e){}break;case"COMMERCIAL_EXPIRED_IN_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Please contact [EMAIL] if you wish to renew (giving you access to Support and Updates)`),"Warning");break;case"COMMERCIAL_EXPIRED_OUT_OF_SCOPE":this.adaptable.logger.consoleLogByMessageType(E(`This AdapTable license${h} has expired. Adaptable version was published after the license expired. Please contact [EMAIL] if you wish to renew your license.`),"Error"),this.showNotification("Adaptable License has expired"),this.showWatermark("Adaptable License has expired")}}showNotification(e){this.adaptable.api.internalApi.dispatchReduxAction((0,t.PopupShowAlert)({alertType:"generic",header:"License Error",message:e,alertDefinition:s.default.CreateInternalAlertDefinitionForMessages("Error")}))}showWatermark(e){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseShowWatermark)(e))}disableStatePersistence(){this.adaptable.api.internalApi.dispatchReduxAction((0,a.LicenseDisablePersistence)())}destroy(){}}exports.LicenseService=O;
@@ -19,7 +19,7 @@ export declare class RowSummaryService {
19
19
  *
20
20
  * @param colId optional to evaluate only one column
21
21
  */
22
- _throttledEvaluateRowSummary: import("lodash").DebouncedFuncLeading<(reason?: {
22
+ _throttledEvaluateRowSummary: import("../utils/debounce").DebouncedFunction<(reason?: {
23
23
  columnIds: string[];
24
24
  }) => void>;
25
25
  private evaluateRowSummary;
@@ -8,8 +8,8 @@ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/
8
8
  const Helper_1 = tslib_1.__importDefault(require("../Helpers/Helper"));
9
9
  const AggregatedScalarLiveValue_1 = require("./AggregatedScalarLiveValue");
10
10
  const ObjectExtensions_1 = require("../Extensions/ObjectExtensions");
11
- const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
12
- const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
11
+ const throttle_1 = tslib_1.__importDefault(require("../utils/throttle"));
12
+ const isEqual_1 = tslib_1.__importDefault(require("../utils/isEqual"));
13
13
  /**
14
14
  * The logic is extracted here to make it easier to follow
15
15
  */
@@ -21,7 +21,7 @@ const getScopeViewItems = (scope, api) => {
21
21
  values = scope.ColumnTypes;
22
22
  }
23
23
  return {
24
- label: 'Scope',
24
+ label: 'Columns',
25
25
  name: 'Target',
26
26
  values,
27
27
  };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Creates an array of elements split into groups the length of size.
3
+ * If array can't be split evenly, the final chunk will be the remaining elements.
4
+ * Drop-in replacement for lodash/chunk.
5
+ */
6
+ export default function chunk<T>(array: T[], size?: number): T[][];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = chunk;
4
+ /**
5
+ * Creates an array of elements split into groups the length of size.
6
+ * If array can't be split evenly, the final chunk will be the remaining elements.
7
+ * Drop-in replacement for lodash/chunk.
8
+ */
9
+ function chunk(array, size = 1) {
10
+ const length = array.length;
11
+ if (!length || !(size >= 1)) {
12
+ return [];
13
+ }
14
+ const chunkSize = Math.floor(size);
15
+ const result = [];
16
+ for (let i = 0; i < length; i += chunkSize) {
17
+ result.push(array.slice(i, i + chunkSize));
18
+ }
19
+ return result;
20
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Clamps number within the inclusive lower and upper bounds.
3
+ * Drop-in replacement for lodash/clamp.
4
+ */
5
+ export default function clamp(number: number, lower: number, upper: number): number;
@@ -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,5 @@
1
+ /**
2
+ * Flattens array a single level deep.
3
+ * Drop-in replacement for lodash/flatten.
4
+ */
5
+ export default function flatten<T>(array: (T | T[])[]): T[];