@elliemae/ds-shared 2.3.0-rc.1 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Animations/BaseAnimation.js +56 -0
- package/dist/cjs/Animations/BaseAnimation.js.map +7 -0
- package/dist/cjs/Animations/Grow.js +55 -0
- package/dist/cjs/Animations/Grow.js.map +7 -0
- package/dist/cjs/Animations/GrowRight.js +64 -0
- package/dist/cjs/Animations/GrowRight.js.map +7 -0
- package/dist/cjs/Animations/GrowVertical.js +47 -0
- package/dist/cjs/Animations/GrowVertical.js.map +7 -0
- package/dist/cjs/CheckableGroup.js +92 -0
- package/dist/cjs/CheckableGroup.js.map +7 -0
- package/dist/cjs/DeferRenderAfterComputation.js +52 -0
- package/dist/cjs/DeferRenderAfterComputation.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGrid.js +193 -0
- package/dist/cjs/FocusGroup/FocusGrid.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroup.js +262 -0
- package/dist/cjs/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js +38 -0
- package/dist/cjs/FocusGroup/FocusGroupContext.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js +126 -0
- package/dist/cjs/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js +82 -0
- package/dist/cjs/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/cjs/FocusGroup/index.js +47 -0
- package/dist/cjs/FocusGroup/index.js.map +7 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js +81 -0
- package/dist/cjs/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js +80 -0
- package/dist/cjs/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/cjs/GroupContext/Group.js +115 -0
- package/dist/cjs/GroupContext/Group.js.map +7 -0
- package/dist/cjs/GroupContext/GroupContext.js +36 -0
- package/dist/cjs/GroupContext/GroupContext.js.map +7 -0
- package/dist/cjs/GroupContext/GroupItem.js +40 -0
- package/dist/cjs/GroupContext/GroupItem.js.map +7 -0
- package/dist/cjs/GroupContext/index.js +39 -0
- package/dist/cjs/GroupContext/index.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSync.js +138 -0
- package/dist/cjs/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js +89 -0
- package/dist/cjs/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js +120 -0
- package/dist/cjs/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/cjs/ScrollSync/index.js +37 -0
- package/dist/cjs/ScrollSync/index.js.map +7 -0
- package/dist/cjs/ScrollSync/useScrollSync.js +41 -0
- package/dist/cjs/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/cjs/constants.js +70 -0
- package/dist/cjs/constants.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js +62 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js +124 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +104 -0
- package/dist/cjs/createDataInstance/utils.js.map +7 -0
- package/dist/cjs/defer-render-hoc/index.js +68 -0
- package/dist/cjs/defer-render-hoc/index.js.map +7 -0
- package/dist/cjs/dimsum.config.js +39 -0
- package/dist/cjs/dimsum.config.js.map +7 -0
- package/dist/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/prop-types.js +116 -0
- package/dist/cjs/prop-types.js.map +7 -0
- package/dist/cjs/react-spring/index.js +28 -0
- package/dist/cjs/react-spring/index.js.map +7 -0
- package/dist/cjs/react-spring/renderprops.js +28 -0
- package/dist/cjs/react-spring/renderprops.js.map +7 -0
- package/dist/cjs/toolbar/ToolbarProvider.js +126 -0
- package/dist/cjs/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js +49 -0
- package/dist/cjs/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/cjs/useDataGrid/index.js +36 -0
- package/dist/cjs/useDataGrid/index.js.map +7 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js +147 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/cjs/useDataGrid/useDataGrid.js +216 -0
- package/dist/cjs/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/cjs/useDataList/index.js +36 -0
- package/dist/cjs/useDataList/index.js.map +7 -0
- package/dist/cjs/useDataList/recordIterator.js +55 -0
- package/dist/cjs/useDataList/recordIterator.js.map +7 -0
- package/dist/cjs/useDataList/useDataList.js +126 -0
- package/dist/cjs/useDataList/useDataList.js.map +7 -0
- package/dist/cjs/utils.js +123 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/virtualization/AutoHeightList.js +106 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +7 -0
- package/dist/cjs/virtualization/FluidHeightList.js +74 -0
- package/dist/cjs/virtualization/FluidHeightList.js.map +7 -0
- package/dist/cjs/virtualization/index.js +50 -0
- package/dist/cjs/virtualization/index.js.map +7 -0
- package/dist/esm/Animations/BaseAnimation.js +27 -0
- package/dist/esm/Animations/BaseAnimation.js.map +7 -0
- package/dist/esm/Animations/Grow.js +26 -0
- package/dist/esm/Animations/Grow.js.map +7 -0
- package/dist/esm/Animations/GrowRight.js +35 -0
- package/dist/esm/Animations/GrowRight.js.map +7 -0
- package/dist/esm/Animations/GrowVertical.js +29 -0
- package/dist/esm/Animations/GrowVertical.js.map +7 -0
- package/dist/esm/CheckableGroup.js +65 -0
- package/dist/esm/CheckableGroup.js.map +7 -0
- package/dist/esm/DeferRenderAfterComputation.js +23 -0
- package/dist/esm/DeferRenderAfterComputation.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGrid.js +166 -0
- package/dist/esm/FocusGroup/FocusGrid.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroup.js +70 -136
- package/dist/esm/FocusGroup/FocusGroup.js.map +7 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js +9 -0
- package/dist/esm/FocusGroup/FocusGroupContext.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroupManager.js +24 -38
- package/dist/esm/FocusGroup/FocusGroupManager.js.map +7 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js +55 -0
- package/dist/esm/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/dist/esm/FocusGroup/index.js +18 -0
- package/dist/esm/FocusGroup/index.js.map +7 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js +53 -0
- package/dist/esm/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/utils/getNextCellPosition.js +18 -25
- package/dist/esm/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/dist/esm/GroupContext/Group.js +86 -0
- package/dist/esm/GroupContext/Group.js.map +7 -0
- package/dist/esm/GroupContext/GroupContext.js +7 -0
- package/dist/esm/GroupContext/GroupContext.js.map +7 -0
- package/dist/esm/GroupContext/GroupItem.js +11 -0
- package/dist/esm/GroupContext/GroupItem.js.map +7 -0
- package/dist/esm/GroupContext/index.js +10 -0
- package/dist/esm/GroupContext/index.js.map +7 -0
- package/{esm → dist/esm}/ScrollSync/ScrollSync.js +30 -64
- package/dist/esm/ScrollSync/ScrollSync.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js +62 -0
- package/dist/esm/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js +91 -0
- package/dist/esm/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/dist/esm/ScrollSync/index.js +8 -0
- package/dist/esm/ScrollSync/index.js.map +7 -0
- package/dist/esm/ScrollSync/useScrollSync.js +12 -0
- package/dist/esm/ScrollSync/useScrollSync.js.map +7 -0
- package/dist/esm/constants.js +41 -0
- package/dist/esm/constants.js.map +7 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js +35 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/esm/createDataInstance/createInstanceRef.js +101 -0
- package/dist/esm/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js +77 -0
- package/dist/esm/createDataInstance/utils.js.map +7 -0
- package/dist/esm/defer-render-hoc/index.js +41 -0
- package/dist/esm/defer-render-hoc/index.js.map +7 -0
- package/dist/esm/dimsum.config.js +10 -0
- package/dist/esm/dimsum.config.js.map +7 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/prop-types.js +87 -0
- package/dist/esm/prop-types.js.map +7 -0
- package/dist/esm/react-spring/index.js +3 -0
- package/dist/esm/react-spring/index.js.map +7 -0
- package/dist/esm/react-spring/renderprops.js +3 -0
- package/dist/esm/react-spring/renderprops.js.map +7 -0
- package/dist/esm/toolbar/ToolbarProvider.js +99 -0
- package/dist/esm/toolbar/ToolbarProvider.js.map +7 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js +20 -0
- package/dist/esm/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/dist/esm/useDataGrid/index.js +7 -0
- package/dist/esm/useDataGrid/index.js.map +7 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js +126 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/esm/useDataGrid/useDataGrid.js +201 -0
- package/dist/esm/useDataGrid/useDataGrid.js.map +7 -0
- package/dist/esm/useDataList/index.js +7 -0
- package/dist/esm/useDataList/index.js.map +7 -0
- package/dist/esm/useDataList/recordIterator.js +26 -0
- package/dist/esm/useDataList/recordIterator.js.map +7 -0
- package/dist/esm/useDataList/useDataList.js +102 -0
- package/dist/esm/useDataList/useDataList.js.map +7 -0
- package/dist/esm/utils.js +96 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/virtualization/AutoHeightList.js +79 -0
- package/dist/esm/virtualization/AutoHeightList.js.map +7 -0
- package/dist/esm/virtualization/FluidHeightList.js +47 -0
- package/dist/esm/virtualization/FluidHeightList.js.map +7 -0
- package/dist/esm/virtualization/index.js +21 -0
- package/dist/esm/virtualization/index.js.map +7 -0
- package/package.json +116 -107
- package/cjs/Animations/BaseAnimation.js +0 -36
- package/cjs/Animations/Grow.js +0 -42
- package/cjs/Animations/GrowRight.js +0 -42
- package/cjs/Animations/GrowVertical.js +0 -7
- package/cjs/CheckableGroup.js +0 -74
- package/cjs/DeferRenderAfterComputation.js +0 -28
- package/cjs/FocusGroup/FocusGrid.js +0 -215
- package/cjs/FocusGroup/FocusGroup.js +0 -308
- package/cjs/FocusGroup/FocusGroupContext.js +0 -11
- package/cjs/FocusGroup/FocusGroupManager.js +0 -117
- package/cjs/FocusGroup/focusGroupManagerHoc.js +0 -44
- package/cjs/FocusGroup/index.js +0 -21
- package/cjs/FocusGroup/useFocusGroupItem.js +0 -59
- package/cjs/FocusGroup/utils/getNextCellPosition.js +0 -60
- package/cjs/GroupContext/Group.js +0 -124
- package/cjs/GroupContext/GroupContext.js +0 -13
- package/cjs/GroupContext/GroupItem.js +0 -22
- package/cjs/GroupContext/index.js +0 -13
- package/cjs/ScrollSync/ScrollSync.js +0 -153
- package/cjs/ScrollSync/ScrollSyncPane.js +0 -81
- package/cjs/ScrollSync/ScrollSyncProvider.js +0 -67
- package/cjs/ScrollSync/index.js +0 -11
- package/cjs/ScrollSync/useScrollSync.js +0 -10
- package/cjs/constants.js +0 -51
- package/cjs/createDataInstance/createInstancePlugin.js +0 -36
- package/cjs/createDataInstance/createInstanceRef.js +0 -97
- package/cjs/createDataInstance/utils.js +0 -123
- package/cjs/defer-render-hoc/index.js +0 -49
- package/cjs/dimsum.config.js +0 -7
- package/cjs/index.js +0 -17
- package/cjs/prop-types.js +0 -59
- package/cjs/react-spring/index.js +0 -14
- package/cjs/react-spring/renderprops.js +0 -14
- package/cjs/toolbar/ToolbarProvider.js +0 -123
- package/cjs/useDataGrid/VolatileRowsListener.js +0 -24
- package/cjs/useDataGrid/index.js +0 -7
- package/cjs/useDataGrid/initColumnDefinition.js +0 -146
- package/cjs/useDataGrid/useDataGrid.js +0 -220
- package/cjs/useDataList/index.js +0 -7
- package/cjs/useDataList/recordIterator.js +0 -31
- package/cjs/useDataList/useDataList.js +0 -102
- package/cjs/utils.js +0 -116
- package/cjs/virtualization/AutoHeightList.js +0 -61
- package/cjs/virtualization/FluidHeightList.js +0 -49
- package/cjs/virtualization/index.js +0 -22
- package/esm/Animations/BaseAnimation.js +0 -30
- package/esm/Animations/Grow.js +0 -36
- package/esm/Animations/GrowRight.js +0 -36
- package/esm/Animations/GrowVertical.js +0 -4
- package/esm/CheckableGroup.js +0 -64
- package/esm/DeferRenderAfterComputation.js +0 -22
- package/esm/FocusGroup/FocusGrid.js +0 -204
- package/esm/FocusGroup/FocusGroupContext.js +0 -5
- package/esm/FocusGroup/focusGroupManagerHoc.js +0 -37
- package/esm/FocusGroup/index.js +0 -6
- package/esm/FocusGroup/useFocusGroupItem.js +0 -50
- package/esm/GroupContext/Group.js +0 -118
- package/esm/GroupContext/GroupContext.js +0 -5
- package/esm/GroupContext/GroupItem.js +0 -16
- package/esm/GroupContext/index.js +0 -3
- package/esm/ScrollSync/ScrollSyncPane.js +0 -74
- package/esm/ScrollSync/ScrollSyncProvider.js +0 -59
- package/esm/ScrollSync/index.js +0 -2
- package/esm/ScrollSync/useScrollSync.js +0 -8
- package/esm/constants.js +0 -32
- package/esm/createDataInstance/createInstancePlugin.js +0 -30
- package/esm/createDataInstance/createInstanceRef.js +0 -90
- package/esm/createDataInstance/utils.js +0 -107
- package/esm/defer-render-hoc/index.js +0 -41
- package/esm/dimsum.config.js +0 -5
- package/esm/index.js +0 -5
- package/esm/prop-types.js +0 -43
- package/esm/react-spring/index.js +0 -1
- package/esm/react-spring/renderprops.js +0 -1
- package/esm/toolbar/ToolbarProvider.js +0 -111
- package/esm/useDataGrid/VolatileRowsListener.js +0 -22
- package/esm/useDataGrid/index.js +0 -1
- package/esm/useDataGrid/initColumnDefinition.js +0 -134
- package/esm/useDataGrid/useDataGrid.js +0 -194
- package/esm/useDataList/index.js +0 -1
- package/esm/useDataList/recordIterator.js +0 -27
- package/esm/useDataList/useDataList.js +0 -90
- package/esm/utils.js +0 -95
- package/esm/virtualization/AutoHeightList.js +0 -52
- package/esm/virtualization/FluidHeightList.js +0 -38
- package/esm/virtualization/index.js +0 -18
- package/types/Animations/BaseAnimation.d.ts +0 -12
- package/types/Animations/Grow.d.ts +0 -11
- package/types/Animations/GrowRight.d.ts +0 -11
- package/types/Animations/GrowVertical.d.ts +0 -1
- package/types/CheckableGroup.d.ts +0 -20
- package/types/DeferRenderAfterComputation.d.ts +0 -6
- package/types/FocusGroup/FocusGrid.d.ts +0 -10
- package/types/FocusGroup/FocusGroup.d.ts +0 -36
- package/types/FocusGroup/FocusGroupContext.d.ts +0 -3
- package/types/FocusGroup/FocusGroupManager.d.ts +0 -24
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +0 -7
- package/types/FocusGroup/index.d.ts +0 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +0 -2
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +0 -12
- package/types/GroupContext/Group.d.ts +0 -14
- package/types/GroupContext/GroupContext.d.ts +0 -2
- package/types/GroupContext/GroupItem.d.ts +0 -5
- package/types/GroupContext/index.d.ts +0 -3
- package/types/ScrollSync/ScrollSync.d.ts +0 -21
- package/types/ScrollSync/ScrollSyncPane.d.ts +0 -3
- package/types/ScrollSync/ScrollSyncProvider.d.ts +0 -12
- package/types/ScrollSync/index.d.ts +0 -2
- package/types/ScrollSync/useScrollSync.d.ts +0 -6
- package/types/constants.d.ts +0 -30
- package/types/createDataInstance/createInstancePlugin.d.ts +0 -1
- package/types/createDataInstance/createInstanceRef.d.ts +0 -12
- package/types/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/types/createDataInstance/utils.d.ts +0 -9
- package/types/dimsum.config.d.ts +0 -4
- package/types/index.d.ts +0 -2
- package/types/prop-types.d.ts +0 -41
- package/types/react-spring/index.d.ts +0 -1
- package/types/react-spring/renderprops.d.ts +0 -1
- package/types/toolbar/ToolbarProvider.d.ts +0 -10
- package/types/useDataGrid/VolatileRowsListener.d.ts +0 -5
- package/types/useDataGrid/index.d.ts +0 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +0 -5
- package/types/useDataGrid/useDataGrid.d.ts +0 -8
- package/types/useDataList/index.d.ts +0 -1
- package/types/useDataList/recordIterator.d.ts +0 -1
- package/types/useDataList/useDataList.d.ts +0 -13
- package/types/utils.d.ts +0 -22
- package/types/virtualization/AutoHeightList.d.ts +0 -2
- package/types/virtualization/FluidHeightList.d.ts +0 -2
- package/types/virtualization/index.d.ts +0 -9
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var VolatileRowsListener_exports = {};
|
|
29
|
+
__export(VolatileRowsListener_exports, {
|
|
30
|
+
VolatileRowsListener: () => VolatileRowsListener,
|
|
31
|
+
default: () => VolatileRowsListener_default
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
|
+
class VolatileRowsListener {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.observers = [];
|
|
38
|
+
}
|
|
39
|
+
observe(listener) {
|
|
40
|
+
this.observers.push(listener);
|
|
41
|
+
}
|
|
42
|
+
notify(nextRows) {
|
|
43
|
+
this.observers.forEach((observer) => (0, import_ds_utilities.safeCall)(observer, nextRows));
|
|
44
|
+
this.observers = [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
var VolatileRowsListener_default = VolatileRowsListener;
|
|
48
|
+
module.exports = __toCommonJS(VolatileRowsListener_exports);
|
|
49
|
+
//# sourceMappingURL=VolatileRowsListener.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataGrid/VolatileRowsListener.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { safeCall } from '@elliemae/ds-utilities';\n\nclass VolatileRowsListener {\n observers = [];\n\n observe(listener) {\n this.observers.push(listener);\n }\n\n notify(nextRows) {\n this.observers.forEach(observer => safeCall(observer, nextRows));\n this.observers = [];\n }\n}\n\nexport { VolatileRowsListener };\nexport default VolatileRowsListener;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAAyB;AAEzB,2BAA2B;AAAA,EAA3B,cAFA;AAGE,qBAAY;AAAA;AAAA,EAEZ,QAAQ,UAAU;AAChB,SAAK,UAAU,KAAK;AAAA;AAAA,EAGtB,OAAO,UAAU;AACf,SAAK,UAAU,QAAQ,cAAY,kCAAS,UAAU;AACtD,SAAK,YAAY;AAAA;AAAA;AAKrB,IAAO,+BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useDataGrid_exports = {};
|
|
29
|
+
__export(useDataGrid_exports, {
|
|
30
|
+
default: () => import_useDataGrid.default,
|
|
31
|
+
useDataGrid: () => import_useDataGrid.default
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_useDataGrid = __toESM(require("./useDataGrid"));
|
|
35
|
+
module.exports = __toCommonJS(useDataGrid_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataGrid/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { default, default as useDataGrid } from './useDataGrid';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAgD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
30
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(module2))
|
|
32
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
33
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (module2, isNodeMode) => {
|
|
38
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
39
|
+
};
|
|
40
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
+
return (module2, temp) => {
|
|
42
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
+
};
|
|
44
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
45
|
+
var initColumnDefinition_exports = {};
|
|
46
|
+
__export(initColumnDefinition_exports, {
|
|
47
|
+
appendCellFormatter: () => appendCellFormatter,
|
|
48
|
+
appendHeaderFormatter: () => appendHeaderFormatter,
|
|
49
|
+
default: () => initColumnDefinition_default,
|
|
50
|
+
initColumnDefinition: () => initColumnDefinition,
|
|
51
|
+
mergeClassNameToColumnHeader: () => mergeClassNameToColumnHeader
|
|
52
|
+
});
|
|
53
|
+
var React = __toESM(require("react"));
|
|
54
|
+
var import_react = __toESM(require("react"));
|
|
55
|
+
var import_uuid = require("uuid");
|
|
56
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
57
|
+
const appendHeaderFormatter = (0, import_ds_utilities.curry)((formatter, column) => __spreadProps(__spreadValues({}, column), {
|
|
58
|
+
header: __spreadProps(__spreadValues({}, column.header), {
|
|
59
|
+
formatters: [...(0, import_ds_utilities.get)(column, "header.formatters", []), formatter]
|
|
60
|
+
})
|
|
61
|
+
}));
|
|
62
|
+
const appendCellFormatter = (0, import_ds_utilities.curry)((formatter, column, path = "formatters") => {
|
|
63
|
+
const nextColumn = (0, import_ds_utilities.cloneDeep)(column);
|
|
64
|
+
const formatters = (0, import_ds_utilities.get)(nextColumn, ["cell", path], []);
|
|
65
|
+
const scrollingFormatters = (0, import_ds_utilities.get)(nextColumn, "cell.scrollingFormatters", []);
|
|
66
|
+
if (Array.isArray(formatter)) {
|
|
67
|
+
if (formatter[1])
|
|
68
|
+
scrollingFormatters.push(formatter[1]);
|
|
69
|
+
formatters.push(formatter[0]);
|
|
70
|
+
} else {
|
|
71
|
+
formatters.push(formatter);
|
|
72
|
+
scrollingFormatters.push(formatter);
|
|
73
|
+
}
|
|
74
|
+
(0, import_ds_utilities.set)(nextColumn, ["cell", path], formatters);
|
|
75
|
+
(0, import_ds_utilities.set)(nextColumn, "cell.scrollingFormatters", scrollingFormatters);
|
|
76
|
+
return nextColumn;
|
|
77
|
+
});
|
|
78
|
+
const defaultColumnDefinitionOptions = {
|
|
79
|
+
normalize: false,
|
|
80
|
+
useTextTruncation: true,
|
|
81
|
+
isUserColumn: true,
|
|
82
|
+
visible: true
|
|
83
|
+
};
|
|
84
|
+
const mergeClassNameToColumnHeader = (0, import_ds_utilities.curry)((className, column) => {
|
|
85
|
+
const headerProps = (0, import_ds_utilities.get)(column, ["header", "props"], {});
|
|
86
|
+
const headerClassName = headerProps.className || "";
|
|
87
|
+
return __spreadProps(__spreadValues({}, column), {
|
|
88
|
+
header: __spreadProps(__spreadValues({}, column.header), {
|
|
89
|
+
props: __spreadProps(__spreadValues({}, headerProps), {
|
|
90
|
+
className: `${headerClassName} ${className}`
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
const initColumnDefinition = (options = {}) => {
|
|
96
|
+
return (column) => {
|
|
97
|
+
if (column.type === "number") {
|
|
98
|
+
column.cellStyle = {
|
|
99
|
+
textAlign: "right"
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const { useTextTruncation = true, isUserColumn, visible, normalize } = __spreadValues(__spreadValues({}, defaultColumnDefinitionOptions), options);
|
|
103
|
+
if (normalize) {
|
|
104
|
+
column.originalProperty = column.property;
|
|
105
|
+
column.property = column.property.replace(/\s+/g, "");
|
|
106
|
+
}
|
|
107
|
+
column.props = __spreadProps(__spreadValues({}, column.props), {
|
|
108
|
+
style: {}
|
|
109
|
+
});
|
|
110
|
+
column.header = __spreadProps(__spreadValues({}, column.header), {
|
|
111
|
+
label: column.label,
|
|
112
|
+
formatters: [...(0, import_ds_utilities.get)(column, ["header", "formatters"], [])],
|
|
113
|
+
props: {
|
|
114
|
+
style: column.headerStyle || {}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
if (useTextTruncation && !((0, import_ds_utilities.isFunction)(column.customHeaderRenderer) || column.header.formatters.length)) {
|
|
118
|
+
column.header.formatters.push((value) => /* @__PURE__ */ import_react.default.createElement("span", {
|
|
119
|
+
className: "cell-value"
|
|
120
|
+
}, value));
|
|
121
|
+
}
|
|
122
|
+
column.cell = __spreadProps(__spreadValues({}, column.cell), {
|
|
123
|
+
transforms: [],
|
|
124
|
+
formatters: [...(0, import_ds_utilities.get)(column, ["cell", "formatters"], [])],
|
|
125
|
+
scrollingFormatters: [...(0, import_ds_utilities.get)(column, ["cell", "formatters"], [])],
|
|
126
|
+
props: {
|
|
127
|
+
style: column.cellStyle || {}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
if (useTextTruncation && !((0, import_ds_utilities.isFunction)(column.customRenderer) || column.cell.formatters.length)) {
|
|
131
|
+
column.cell.formatters.push((value) => /* @__PURE__ */ import_react.default.createElement("span", {
|
|
132
|
+
className: "cell-value",
|
|
133
|
+
style: {
|
|
134
|
+
justifyContent: column.type === "number" ? "flex-end" : "flex-start"
|
|
135
|
+
}
|
|
136
|
+
}, value));
|
|
137
|
+
}
|
|
138
|
+
column.uuid = column.uuid || (0, import_uuid.v4)();
|
|
139
|
+
column.visible = column.visible === void 0 ? visible : column.visible;
|
|
140
|
+
column.isUserColumn = column.isUserColumn || isUserColumn;
|
|
141
|
+
column.headerHookEffects = [];
|
|
142
|
+
return column;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
var initColumnDefinition_default = initColumnDefinition;
|
|
146
|
+
module.exports = __toCommonJS(initColumnDefinition_exports);
|
|
147
|
+
//# sourceMappingURL=initColumnDefinition.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataGrid/initColumnDefinition.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable react/display-name */\nimport React from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport {\n get,\n curry,\n set,\n cloneDeep,\n isFunction,\n} from '@elliemae/ds-utilities';\n\n// TODO: use lenses to access nested fields\n\nexport const appendHeaderFormatter = curry((formatter, column) => ({\n ...column,\n header: {\n ...column.header,\n formatters: [...get(column, 'header.formatters', []), formatter],\n },\n}));\n\nexport const appendCellFormatter = curry(\n (formatter, column, path = 'formatters') => {\n const nextColumn = cloneDeep(column);\n const formatters = get(nextColumn, ['cell', path], []);\n const scrollingFormatters = get(nextColumn, 'cell.scrollingFormatters', []);\n if (Array.isArray(formatter)) {\n if (formatter[1]) scrollingFormatters.push(formatter[1]);\n formatters.push(formatter[0]);\n } else {\n formatters.push(formatter);\n scrollingFormatters.push(formatter);\n }\n set(nextColumn, ['cell', path], formatters);\n set(nextColumn, 'cell.scrollingFormatters', scrollingFormatters);\n return nextColumn;\n },\n);\n\nconst defaultColumnDefinitionOptions = {\n normalize: false,\n useTextTruncation: true,\n isUserColumn: true,\n visible: true,\n};\n\nexport const mergeClassNameToColumnHeader = curry((className, column) => {\n const headerProps = get(column, ['header', 'props'], {});\n const headerClassName = headerProps.className || '';\n return {\n ...column,\n header: {\n ...column.header,\n props: {\n ...headerProps,\n className: `${headerClassName} ${className}`,\n },\n },\n };\n});\n\nexport const initColumnDefinition = (options = {}) => {\n // eslint-disable-next-line complexity\n return (column) => {\n // todo: clean this\n if (column.type === 'number') {\n // eslint-disable-next-line no-param-reassign\n column.cellStyle = {\n textAlign: 'right',\n };\n }\n const { useTextTruncation = true, isUserColumn, visible, normalize } = {\n ...defaultColumnDefinitionOptions,\n ...options,\n };\n\n if (normalize) {\n // eslint-disable-next-line no-param-reassign\n column.originalProperty = column.property;\n // eslint-disable-next-line no-param-reassign\n column.property = column.property.replace(/\\s+/g, '');\n }\n\n // eslint-disable-next-line no-param-reassign\n column.props = {\n ...column.props,\n style: {},\n };\n // eslint-disable-next-line no-param-reassign\n column.header = {\n ...column.header,\n label: column.label,\n formatters: [...get(column, ['header', 'formatters'], [])],\n props: {\n style: column.headerStyle || {},\n },\n };\n if (\n useTextTruncation &&\n !(\n isFunction(column.customHeaderRenderer) ||\n column.header.formatters.length\n )\n ) {\n column.header.formatters.push((value) => (\n <span className=\"cell-value\">{value}</span>\n ));\n }\n\n // eslint-disable-next-line no-param-reassign\n column.cell = {\n ...column.cell,\n transforms: [],\n formatters: [...get(column, ['cell', 'formatters'], [])],\n scrollingFormatters: [...get(column, ['cell', 'formatters'], [])],\n props: {\n style: column.cellStyle || {},\n },\n };\n\n if (\n useTextTruncation &&\n !(isFunction(column.customRenderer) || column.cell.formatters.length)\n ) {\n column.cell.formatters.push((value) => (\n <span\n className=\"cell-value\"\n style={{\n justifyContent:\n column.type === 'number' ? 'flex-end' : 'flex-start',\n }}\n >\n {value}\n </span>\n ));\n }\n // eslint-disable-next-line no-param-reassign\n column.uuid = column.uuid || uuidv4();\n // eslint-disable-next-line no-param-reassign\n column.visible = column.visible === undefined ? visible : column.visible;\n // eslint-disable-next-line no-param-reassign, max-lines\n column.isUserColumn = column.isUserColumn || isUserColumn;\n // eslint-disable-next-line no-param-reassign\n column.headerHookEffects = [];\n return column;\n };\n};\n\nexport default initColumnDefinition;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA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@@ -0,0 +1,216 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
|
+
var __objRest = (source, exclude) => {
|
|
26
|
+
var target = {};
|
|
27
|
+
for (var prop in source)
|
|
28
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
if (source != null && __getOwnPropSymbols)
|
|
31
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __export = (target, all) => {
|
|
38
|
+
for (var name in all)
|
|
39
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
+
};
|
|
41
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
42
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
43
|
+
for (let key of __getOwnPropNames(module2))
|
|
44
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
45
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
46
|
+
}
|
|
47
|
+
return target;
|
|
48
|
+
};
|
|
49
|
+
var __toESM = (module2, isNodeMode) => {
|
|
50
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
51
|
+
};
|
|
52
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
53
|
+
return (module2, temp) => {
|
|
54
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
55
|
+
};
|
|
56
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
57
|
+
var useDataGrid_exports = {};
|
|
58
|
+
__export(useDataGrid_exports, {
|
|
59
|
+
default: () => useDataGrid_default,
|
|
60
|
+
useDataGrid: () => useDataGrid
|
|
61
|
+
});
|
|
62
|
+
var React = __toESM(require("react"));
|
|
63
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
64
|
+
var import_react = require("react");
|
|
65
|
+
var import_uuid = require("uuid");
|
|
66
|
+
var resolve = __toESM(require("table-resolver"));
|
|
67
|
+
var import_initColumnDefinition = require("./initColumnDefinition");
|
|
68
|
+
var import_utils = require("../createDataInstance/utils");
|
|
69
|
+
var import_VolatileRowsListener = require("./VolatileRowsListener");
|
|
70
|
+
var import_utils2 = require("../utils");
|
|
71
|
+
const IS_INTERNET_EXPLORER = (0, import_utils2.isInternetExplorer)();
|
|
72
|
+
const useDataGrid = (_a) => {
|
|
73
|
+
var _b = _a, {
|
|
74
|
+
uuid: uuidProp,
|
|
75
|
+
plugins: pluginsFromProps,
|
|
76
|
+
rows,
|
|
77
|
+
columns,
|
|
78
|
+
renderers = {}
|
|
79
|
+
} = _b, props = __objRest(_b, [
|
|
80
|
+
"uuid",
|
|
81
|
+
"plugins",
|
|
82
|
+
"rows",
|
|
83
|
+
"columns",
|
|
84
|
+
"renderers"
|
|
85
|
+
]);
|
|
86
|
+
const plugins = pluginsFromProps;
|
|
87
|
+
const instance = (0, import_react.useRef)();
|
|
88
|
+
const tableRef = (0, import_react.useRef)();
|
|
89
|
+
const headerRef = (0, import_react.useRef)();
|
|
90
|
+
const bodyRef = (0, import_react.useRef)();
|
|
91
|
+
const bodyInnerRef = (0, import_react.useRef)();
|
|
92
|
+
const [uuid] = (0, import_react.useState)(uuidProp || (() => (0, import_uuid.v4)()));
|
|
93
|
+
const [hasScroll, setHasScroll] = (0, import_react.useState)(false);
|
|
94
|
+
const [isRowDragging, setIsRowDragging] = (0, import_react.useState)(false);
|
|
95
|
+
const isScrolling = (0, import_react.useRef)();
|
|
96
|
+
const shouldRefocus = (0, import_react.useRef)();
|
|
97
|
+
const [RowsObserver] = (0, import_react.useState)(() => new import_VolatileRowsListener.VolatileRowsListener());
|
|
98
|
+
const [originalRows, updateRows] = (0, import_ds_utilities.useDerivedStateFromProps)(rows, {
|
|
99
|
+
onUpdate: resolve.resolve({
|
|
100
|
+
columns,
|
|
101
|
+
method: (extra) => (0, import_ds_utilities.compose)(resolve.byFunction("valueTransformation")(extra), resolve.nested(extra))
|
|
102
|
+
}),
|
|
103
|
+
updateOnStateChange: true
|
|
104
|
+
});
|
|
105
|
+
instance.current = {
|
|
106
|
+
decoratedRenderers: (0, import_ds_utilities.cloneDeep)(renderers),
|
|
107
|
+
decoratedColumns: columns,
|
|
108
|
+
columns,
|
|
109
|
+
rows,
|
|
110
|
+
composedRows: originalRows,
|
|
111
|
+
getRowProps: [],
|
|
112
|
+
getHeaderRowProps: [],
|
|
113
|
+
getBodyProps: [],
|
|
114
|
+
getTableProps: [],
|
|
115
|
+
effects: [],
|
|
116
|
+
uuid,
|
|
117
|
+
props,
|
|
118
|
+
refs: {
|
|
119
|
+
table: tableRef,
|
|
120
|
+
body: bodyRef,
|
|
121
|
+
header: headerRef,
|
|
122
|
+
innerBody: bodyInnerRef
|
|
123
|
+
},
|
|
124
|
+
state: {
|
|
125
|
+
hasScroll
|
|
126
|
+
},
|
|
127
|
+
actions: {
|
|
128
|
+
updateRows
|
|
129
|
+
},
|
|
130
|
+
updateRows,
|
|
131
|
+
enableEvents: () => document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? "" : null,
|
|
132
|
+
disableEvents: () => document.body.style.pointerEvents = "none",
|
|
133
|
+
observeRows: (observer) => RowsObserver.observe(observer),
|
|
134
|
+
hotKeys: {},
|
|
135
|
+
shouldRefocus,
|
|
136
|
+
isScrolling,
|
|
137
|
+
setHasScroll,
|
|
138
|
+
setIsRowDragging,
|
|
139
|
+
isRowDragging,
|
|
140
|
+
plugins
|
|
141
|
+
};
|
|
142
|
+
instance.current.getState = () => instance.current.state;
|
|
143
|
+
instance.current.getInstance = () => instance.current;
|
|
144
|
+
const defaultDecorators = {
|
|
145
|
+
decorateGrid: [],
|
|
146
|
+
registerStateHook: [],
|
|
147
|
+
registerHotKeys: [],
|
|
148
|
+
decorateColumn: [],
|
|
149
|
+
decorateColumns: [
|
|
150
|
+
(cols) => cols.map((col) => (0, import_initColumnDefinition.initColumnDefinition)({
|
|
151
|
+
useTextTruncation: col.useTextTruncation,
|
|
152
|
+
wrapText: props.wrapText,
|
|
153
|
+
normalize: props.normalizeDataKeys
|
|
154
|
+
})(col))
|
|
155
|
+
],
|
|
156
|
+
decorateRenderers: [],
|
|
157
|
+
getRowProps: [],
|
|
158
|
+
getHeaderRowProps: [],
|
|
159
|
+
getBodyProps: [],
|
|
160
|
+
getTableProps: [],
|
|
161
|
+
getHeaderProps: [],
|
|
162
|
+
composeRows: []
|
|
163
|
+
};
|
|
164
|
+
const decorators = (0, import_react.useMemo)(() => {
|
|
165
|
+
let nextDecorators = defaultDecorators;
|
|
166
|
+
plugins.forEach((plugin) => nextDecorators = plugin(nextDecorators));
|
|
167
|
+
return nextDecorators;
|
|
168
|
+
}, [plugins]);
|
|
169
|
+
instance.current = decorators.decorateGrid.reduce((nextInstance, decorator) => __spreadValues(__spreadValues({}, nextInstance), decorator(instance.current)), instance.current);
|
|
170
|
+
instance.current = decorators.registerStateHook.reduce((nextInstance, decorator) => {
|
|
171
|
+
const { state, actions } = decorator(instance.current);
|
|
172
|
+
return __spreadProps(__spreadValues({}, nextInstance), {
|
|
173
|
+
state: __spreadValues(__spreadValues({}, nextInstance.state), state),
|
|
174
|
+
actions: __spreadValues(__spreadValues({}, nextInstance.actions), actions)
|
|
175
|
+
});
|
|
176
|
+
}, instance.current);
|
|
177
|
+
const reduceHotKey = (nextInstance, { key, handler, options }) => __spreadProps(__spreadValues({}, nextInstance), {
|
|
178
|
+
hotKeys: __spreadProps(__spreadValues({}, nextInstance.hotKeys), {
|
|
179
|
+
[key]: { handler, options }
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
instance.current = decorators.registerHotKeys.reduce((nextInstance, decorator) => {
|
|
183
|
+
const hotKeys = decorator(nextInstance);
|
|
184
|
+
if (Array.isArray(hotKeys)) {
|
|
185
|
+
return hotKeys.reduce(reduceHotKey, nextInstance);
|
|
186
|
+
}
|
|
187
|
+
return reduceHotKey(nextInstance, hotKeys);
|
|
188
|
+
}, instance.current);
|
|
189
|
+
instance.current.decoratedRenderers = (0, import_utils.applyDecorators)(instance.current.decoratedRenderers, decorators.decorateRenderers, instance.current);
|
|
190
|
+
instance.current.decoratedColumns = (0, import_react.useMemo)(() => {
|
|
191
|
+
const visibleColumns = (0, import_ds_utilities.cloneDeep)(columns).filter((column) => typeof column.visible === "undefined" || column.visible);
|
|
192
|
+
return visibleColumns.length ? (0, import_utils.decorateColumns)(visibleColumns, decorators, instance.current) : [];
|
|
193
|
+
}, [columns]);
|
|
194
|
+
instance.current.getBodyProps = (0, import_utils.reducePropsGetter)(decorators.getBodyProps, instance.current);
|
|
195
|
+
instance.current.getHeaderProps = (0, import_utils.reducePropsGetter)(decorators.getHeaderProps, instance.current);
|
|
196
|
+
instance.current.getRowProps = (0, import_utils.reducePropsGetter)(decorators.getRowProps, instance.current);
|
|
197
|
+
instance.current.getHeaderRowProps = (0, import_utils.reducePropsGetter)(decorators.getHeaderRowProps, instance.current);
|
|
198
|
+
instance.current.getTableProps = (0, import_utils.reducePropsGetter)(decorators.getTableProps, instance.current);
|
|
199
|
+
instance.current.composedRows = decorators.composeRows.reduce((nextRows, getter) => getter(nextRows, instance.current), instance.current.composedRows);
|
|
200
|
+
RowsObserver.notify(instance.current.composedRows);
|
|
201
|
+
const currentShouldRefocus = instance.current.shouldRefocus.current;
|
|
202
|
+
const prevState = (0, import_ds_utilities.usePrevious)(instance.current.state);
|
|
203
|
+
if ((0, import_ds_utilities.isObject)(currentShouldRefocus) && currentShouldRefocus.forced) {
|
|
204
|
+
instance.current.shouldRefocus.current = currentShouldRefocus.value;
|
|
205
|
+
} else {
|
|
206
|
+
instance.current.shouldRefocus.current = !(0, import_ds_utilities.isEqual)(prevState, instance.current.state);
|
|
207
|
+
}
|
|
208
|
+
if (props.instanceRef)
|
|
209
|
+
(0, import_ds_utilities.setRef)(props.instanceRef, instance.current);
|
|
210
|
+
return __spreadProps(__spreadValues({}, instance.current), {
|
|
211
|
+
decorators
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
var useDataGrid_default = useDataGrid;
|
|
215
|
+
module.exports = __toCommonJS(useDataGrid_exports);
|
|
216
|
+
//# sourceMappingURL=useDataGrid.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataGrid/useDataGrid.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport {\n cloneDeep,\n compose,\n isEqual,\n isObject,\n setRef, \n usePrevious, \n useDerivedStateFromProps \n} from '@elliemae/ds-utilities';\nimport { useMemo, useRef, useState } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport * as resolve from 'table-resolver';\nimport { initColumnDefinition } from './initColumnDefinition';\nimport {\n applyDecorators,\n decorateColumns,\n reducePropsGetter,\n} from '../createDataInstance/utils';\nimport { VolatileRowsListener } from './VolatileRowsListener';\nimport { isInternetExplorer } from '../utils';\n\nconst IS_INTERNET_EXPLORER = isInternetExplorer();\n\n// TODO: Reuse createDataInstance for the grid the same\n// way as the list does ex: packages/ds-shared/src/useDataList/useDataList.js\n// eslint-disable-next-line max-statements\nexport const useDataGrid = ({\n uuid: uuidProp,\n plugins: pluginsFromProps,\n rows,\n columns,\n renderers = {},\n ...props\n}) => {\n const plugins = pluginsFromProps;\n const instance = useRef();\n const tableRef = useRef();\n const headerRef = useRef();\n const bodyRef = useRef();\n const bodyInnerRef = useRef();\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n const [hasScroll, setHasScroll] = useState(false);\n const [isRowDragging, setIsRowDragging] = useState(false);\n const isScrolling = useRef();\n const shouldRefocus = useRef(); // todo: we probably need a plugin for focus related stuff\n const [RowsObserver] = useState(() => new VolatileRowsListener());\n\n // todo move this with rows composition\n const [originalRows, updateRows] = useDerivedStateFromProps(rows, {\n onUpdate: resolve.resolve({\n columns,\n method: (extra) =>\n compose(\n resolve.byFunction('valueTransformation')(extra),\n resolve.nested(extra),\n ),\n }),\n updateOnStateChange: true,\n });\n\n instance.current = {\n decoratedRenderers: cloneDeep(renderers),\n decoratedColumns: columns,\n columns,\n rows,\n composedRows: originalRows,\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n effects: [],\n uuid,\n props,\n refs: {\n table: tableRef,\n body: bodyRef,\n header: headerRef,\n innerBody: bodyInnerRef,\n },\n state: {\n hasScroll,\n },\n actions: {\n updateRows,\n },\n updateRows,\n // eslint-disable-next-line no-return-assign\n enableEvents: () =>\n (document.body.style.pointerEvents = IS_INTERNET_EXPLORER ? '' : null),\n // eslint-disable-next-line no-return-assign\n disableEvents: () => (document.body.style.pointerEvents = 'none'),\n observeRows: (observer) => RowsObserver.observe(observer),\n hotKeys: {},\n shouldRefocus,\n isScrolling,\n setHasScroll,\n setIsRowDragging,\n isRowDragging,\n plugins,\n };\n instance.current.getState = () => instance.current.state;\n instance.current.getInstance = () => instance.current;\n\n const defaultDecorators = {\n decorateGrid: [],\n registerStateHook: [],\n registerHotKeys: [],\n decorateColumn: [],\n decorateColumns: [\n (cols) =>\n cols.map((col) =>\n initColumnDefinition({\n useTextTruncation: col.useTextTruncation,\n wrapText: props.wrapText,\n normalize: props.normalizeDataKeys,\n })(col),\n ),\n ],\n decorateRenderers: [],\n getRowProps: [],\n getHeaderRowProps: [],\n getBodyProps: [],\n getTableProps: [],\n getHeaderProps: [],\n composeRows: [],\n };\n\n const decorators = useMemo(() => {\n let nextDecorators = defaultDecorators;\n // eslint-disable-next-line no-return-assign\n plugins.forEach((plugin) => (nextDecorators = plugin(nextDecorators)));\n return nextDecorators;\n }, [plugins]);\n\n instance.current = decorators.decorateGrid.reduce(\n (nextInstance, decorator) => ({\n ...nextInstance,\n ...decorator(instance.current),\n }),\n instance.current,\n );\n\n instance.current = decorators.registerStateHook.reduce(\n (nextInstance, decorator) => {\n const { state, actions } = decorator(instance.current);\n return {\n ...nextInstance,\n state: {\n ...nextInstance.state,\n ...state,\n },\n actions: {\n ...nextInstance.actions,\n ...actions,\n },\n };\n },\n instance.current,\n );\n\n const reduceHotKey = (nextInstance, { key, handler, options }) => ({\n ...nextInstance,\n hotKeys: {\n ...nextInstance.hotKeys,\n [key]: { handler, options },\n },\n });\n instance.current = decorators.registerHotKeys.reduce(\n (nextInstance, decorator) => {\n const hotKeys = decorator(nextInstance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, nextInstance);\n }\n return reduceHotKey(nextInstance, hotKeys);\n },\n instance.current,\n );\n\n instance.current.decoratedRenderers = applyDecorators(\n instance.current.decoratedRenderers,\n decorators.decorateRenderers,\n instance.current,\n );\n\n instance.current.decoratedColumns = useMemo(() => {\n const visibleColumns = cloneDeep(columns).filter(\n (column) => typeof column.visible === 'undefined' || column.visible,\n );\n return visibleColumns.length\n ? decorateColumns(visibleColumns, decorators, instance.current)\n : [];\n }, [columns]);\n\n instance.current.getBodyProps = reducePropsGetter(\n decorators.getBodyProps,\n instance.current,\n );\n instance.current.getHeaderProps = reducePropsGetter(\n decorators.getHeaderProps,\n instance.current,\n );\n instance.current.getRowProps = reducePropsGetter(\n decorators.getRowProps,\n instance.current,\n );\n instance.current.getHeaderRowProps = reducePropsGetter(\n decorators.getHeaderRowProps,\n instance.current,\n );\n instance.current.getTableProps = reducePropsGetter(\n decorators.getTableProps,\n instance.current,\n );\n\n instance.current.composedRows = decorators.composeRows.reduce(\n (nextRows, getter) => getter(nextRows, instance.current),\n instance.current.composedRows,\n );\n\n RowsObserver.notify(instance.current.composedRows);\n\n const currentShouldRefocus = instance.current.shouldRefocus.current;\n const prevState = usePrevious(instance.current.state);\n if (isObject(currentShouldRefocus) && currentShouldRefocus.forced) {\n instance.current.shouldRefocus.current = currentShouldRefocus.value;\n } else {\n instance.current.shouldRefocus.current = !isEqual(\n prevState,\n instance.current.state,\n );\n }\n\n if (props.instanceRef) setRef(props.instanceRef, instance.current);\n\n return {\n ...instance.current,\n decorators,\n };\n};\n\nexport default useDataGrid;\n\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACL,aAAS,QAAQ,cAAc,UAAU,CAAC,iCACxC,WACA,SAAS,QAAQ;AAAA;AAIrB,MAAI,MAAM;AAAa,oCAAO,MAAM,aAAa,SAAS;AAE1D,SAAO,iCACF,SAAS,UADP;AAAA,IAEL;AAAA;AAAA;AAIJ,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var useDataList_exports = {};
|
|
29
|
+
__export(useDataList_exports, {
|
|
30
|
+
default: () => import_useDataList.default,
|
|
31
|
+
useDataList: () => import_useDataList.default
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_useDataList = __toESM(require("./useDataList"));
|
|
35
|
+
module.exports = __toCommonJS(useDataList_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataList/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { default, default as useDataList } from './useDataList';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yBAAgD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var recordIterator_exports = {};
|
|
29
|
+
__export(recordIterator_exports, {
|
|
30
|
+
recordIterator: () => recordIterator
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
const defaultStrategy = () => {
|
|
34
|
+
throw Error("Implement an iterator strategy for record iterator");
|
|
35
|
+
};
|
|
36
|
+
function recordIterator(records, strategy = defaultStrategy, decorators = [], instance) {
|
|
37
|
+
const nextRows = [];
|
|
38
|
+
strategy({
|
|
39
|
+
data: records,
|
|
40
|
+
cb: (row) => {
|
|
41
|
+
let nextRow = row;
|
|
42
|
+
for (let i = 0; i < decorators.length; i++) {
|
|
43
|
+
nextRow = decorators[i](nextRow, instance);
|
|
44
|
+
if (!nextRow)
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
if (nextRow)
|
|
48
|
+
nextRows.push(nextRow);
|
|
49
|
+
},
|
|
50
|
+
instance
|
|
51
|
+
});
|
|
52
|
+
return nextRows;
|
|
53
|
+
}
|
|
54
|
+
module.exports = __toCommonJS(recordIterator_exports);
|
|
55
|
+
//# sourceMappingURL=recordIterator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/useDataList/recordIterator.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["const defaultStrategy = () => {\n throw Error('Implement an iterator strategy for record iterator');\n};\n\nexport function recordIterator(\n records,\n strategy = defaultStrategy,\n decorators = [],\n instance,\n) {\n const nextRows = [];\n\n strategy({\n data: records,\n cb: row => {\n let nextRow = row;\n\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < decorators.length; i++) {\n nextRow = decorators[i](nextRow, instance);\n if (!nextRow) break;\n }\n\n if (nextRow) nextRows.push(nextRow);\n },\n instance,\n });\n\n return nextRows;\n}\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,kBAAkB,MAAM;AAC5B,QAAM,MAAM;AAAA;AAGP,wBACL,SACA,WAAW,iBACX,aAAa,IACb,UACA;AACA,QAAM,WAAW;AAEjB,WAAS;AAAA,IACP,MAAM;AAAA,IACN,IAAI,SAAO;AACT,UAAI,UAAU;AAGd,eAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,KAAK;AAC1C,kBAAU,WAAW,GAAG,SAAS;AACjC,YAAI,CAAC;AAAS;AAAA;AAGhB,UAAI;AAAS,iBAAS,KAAK;AAAA;AAAA,IAE7B;AAAA;AAGF,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|