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

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 (106) hide show
  1. package/index.css +0 -12
  2. package/index.css.map +1 -1
  3. package/package.json +1 -4
  4. package/src/AdaptableState/Common/AdaptableForm.d.ts +1 -1
  5. package/src/AdaptableState/UserInterfaceState.d.ts +1 -1
  6. package/src/Api/Implementation/LayoutHelpers.js +1 -1
  7. package/src/Api/Internal/ColumnInternalApi.js +1 -1
  8. package/src/Api/Internal/EventInternalApi.js +1 -1
  9. package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
  10. package/src/Redux/Store/AdaptableReduxMerger.js +5 -6
  11. package/src/Strategy/LayoutModule.js +1 -1
  12. package/src/Strategy/TeamSharingModule.js +2 -2
  13. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +1 -1
  14. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
  15. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +1 -1
  16. package/src/Utilities/Extensions/StringExtensions.js +1 -1
  17. package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
  18. package/src/Utilities/Helpers/FormatHelper.js +2 -2
  19. package/src/Utilities/Services/LicenseService/index.js +1 -1
  20. package/src/Utilities/Services/RowSummaryService.d.ts +1 -1
  21. package/src/Utilities/Services/RowSummaryService.js +2 -2
  22. package/src/Utilities/utils/chunk.d.ts +6 -0
  23. package/src/Utilities/utils/chunk.js +20 -0
  24. package/src/Utilities/utils/clamp.d.ts +5 -0
  25. package/src/Utilities/utils/clamp.js +10 -0
  26. package/src/Utilities/utils/cloneDeepWith.d.ts +9 -0
  27. package/src/Utilities/utils/cloneDeepWith.js +70 -0
  28. package/src/Utilities/utils/debounce.d.ts +20 -0
  29. package/src/Utilities/utils/debounce.js +124 -0
  30. package/src/Utilities/utils/flatten.d.ts +5 -0
  31. package/src/Utilities/utils/flatten.js +10 -0
  32. package/src/Utilities/utils/flattenDeep.d.ts +5 -0
  33. package/src/Utilities/utils/flattenDeep.js +10 -0
  34. package/src/Utilities/utils/get.d.ts +6 -0
  35. package/src/Utilities/utils/get.js +38 -0
  36. package/src/Utilities/utils/index.d.ts +22 -0
  37. package/src/Utilities/utils/index.js +48 -0
  38. package/src/Utilities/utils/isArray.d.ts +6 -0
  39. package/src/Utilities/utils/isArray.js +8 -0
  40. package/src/Utilities/utils/isEqual.d.ts +5 -0
  41. package/src/Utilities/utils/isEqual.js +127 -0
  42. package/src/Utilities/utils/isObject.d.ts +6 -0
  43. package/src/Utilities/utils/isObject.js +12 -0
  44. package/src/Utilities/utils/isPlainObject.d.ts +6 -0
  45. package/src/Utilities/utils/isPlainObject.js +20 -0
  46. package/src/Utilities/utils/kebabCase.d.ts +5 -0
  47. package/src/Utilities/utils/kebabCase.js +12 -0
  48. package/src/Utilities/utils/merge.d.ts +11 -0
  49. package/src/Utilities/utils/merge.js +44 -0
  50. package/src/Utilities/utils/mergeWith.d.ts +7 -0
  51. package/src/Utilities/utils/mergeWith.js +50 -0
  52. package/src/Utilities/utils/orderBy.d.ts +8 -0
  53. package/src/Utilities/utils/orderBy.js +33 -0
  54. package/src/Utilities/utils/parseInt.d.ts +6 -0
  55. package/src/Utilities/utils/parseInt.js +12 -0
  56. package/src/Utilities/utils/sentenceCase.d.ts +6 -0
  57. package/src/Utilities/utils/sentenceCase.js +19 -0
  58. package/src/Utilities/utils/startCase.d.ts +5 -0
  59. package/src/Utilities/utils/startCase.js +15 -0
  60. package/src/Utilities/utils/throttle.d.ts +17 -0
  61. package/src/Utilities/utils/throttle.js +23 -0
  62. package/src/Utilities/utils/toNumber.d.ts +5 -0
  63. package/src/Utilities/utils/toNumber.js +42 -0
  64. package/src/Utilities/utils/uniq.d.ts +7 -0
  65. package/src/Utilities/utils/uniq.js +12 -0
  66. package/src/Utilities/utils/uniqBy.d.ts +8 -0
  67. package/src/Utilities/utils/uniqBy.js +25 -0
  68. package/src/Utilities/utils/words.d.ts +7 -0
  69. package/src/Utilities/utils/words.js +13 -0
  70. package/src/Utilities/weightedAverage.js +1 -1
  71. package/src/View/AdaptableComputedCSSVarsContext.js +1 -1
  72. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +1 -1
  73. package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
  74. package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
  75. package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +1 -1
  76. package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +2 -2
  77. package/src/View/Components/ColumnFilter/components/FloatingFilterInputList.js +2 -2
  78. package/src/View/Components/RangesComponent.js +1 -1
  79. package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
  80. package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
  81. package/src/View/Dashboard/CustomDashboardButton.js +1 -1
  82. package/src/View/Dashboard/Dashboard.js +1 -1
  83. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +1 -1
  84. package/src/View/DataSet/DataSetViewPanel.d.ts +1 -1
  85. package/src/View/Filter/FilterViewPanel.d.ts +1 -1
  86. package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
  87. package/src/View/GridFilter/GridFilterViewPanel.js +3 -3
  88. package/src/View/Layout/LayoutViewPanel.js +1 -1
  89. package/src/View/Note/NoteEditor.js +1 -1
  90. package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
  91. package/src/View/SpecialColumnSettingsWizardStep.js +1 -1
  92. package/src/View/SystemStatus/SystemStatusViewPanel.d.ts +1 -1
  93. package/src/View/Theme/ThemeEditor.js +1 -1
  94. package/src/View/Theme/ThemeField.js +1 -1
  95. package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
  96. package/src/agGrid/AdaptableAgGrid.js +2 -2
  97. package/src/agGrid/AgGridColumnAdapter.js +2 -2
  98. package/src/agGrid/cellRenderers/PercentBarRenderer.js +1 -1
  99. package/src/components/ColorPicker/ColorPicker.js +1 -1
  100. package/src/components/DropdownButton/renderItem.js +1 -1
  101. package/src/components/FormLayout/index.js +1 -1
  102. package/src/components/OverlayTrigger/index.js +1 -1
  103. package/src/env.js +2 -2
  104. package/src/layout-manager/src/isLayoutEqual.js +1 -1
  105. package/src/migration/VersionUpgrade22.js +1 -0
  106. package/tsconfig.cjs.tsbuildinfo +1 -1
@@ -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
  */
@@ -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[];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = flatten;
4
+ /**
5
+ * Flattens array a single level deep.
6
+ * Drop-in replacement for lodash/flatten.
7
+ */
8
+ function flatten(array) {
9
+ return array.flat();
10
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Recursively flattens array.
3
+ * Drop-in replacement for lodash/flattenDeep.
4
+ */
5
+ export default function flattenDeep<T>(array: any[]): T[];
@@ -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,6 @@
1
+ /**
2
+ * Gets the value at path of object. If the resolved value is undefined,
3
+ * the defaultValue is returned in its place.
4
+ * Drop-in replacement for lodash/get.
5
+ */
6
+ export default function get(object: any, path: string | string[], defaultValue?: any): any;
@@ -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,6 @@
1
+ /**
2
+ * Checks if value is classified as an Array object.
3
+ * Drop-in replacement for lodash/isArray.
4
+ */
5
+ declare const isArray: (value: any) => value is any[];
6
+ export default isArray;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Checks if value is classified as an Array object.
5
+ * Drop-in replacement for lodash/isArray.
6
+ */
7
+ const isArray = Array.isArray;
8
+ exports.default = isArray;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Performs a deep comparison between two values to determine if they are equivalent.
3
+ * Drop-in replacement for lodash/isEqual.
4
+ */
5
+ export default function isEqual(value: any, other: any): boolean;
@@ -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,6 @@
1
+ /**
2
+ * Checks if value is the language type of Object.
3
+ * (e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))
4
+ * Drop-in replacement for lodash/isObject.
5
+ */
6
+ export default function isObject(value: any): value is object;
@@ -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
+ }