@elliemae/ds-shared 2.3.0-next.3 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +76 -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 +180 -0
- package/dist/cjs/FocusGroup/FocusGrid.js.map +7 -0
- package/dist/cjs/FocusGroup/FocusGroup.js +249 -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 +54 -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 +67 -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 +73 -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 +48 -0
- package/dist/cjs/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js +92 -0
- package/dist/cjs/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/cjs/createDataInstance/utils.js +99 -0
- package/dist/cjs/createDataInstance/utils.js.map +7 -0
- package/dist/cjs/defer-render-hoc/index.js +56 -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 +111 -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 +141 -0
- package/dist/cjs/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/cjs/useDataGrid/useDataGrid.js +194 -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 +93 -0
- package/dist/cjs/useDataList/useDataList.js.map +7 -0
- package/dist/cjs/utils.js +107 -0
- package/dist/cjs/utils.js.map +7 -0
- package/dist/cjs/virtualization/AutoHeightList.js +69 -0
- package/dist/cjs/virtualization/AutoHeightList.js.map +7 -0
- package/dist/cjs/virtualization/FluidHeightList.js +43 -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 +47 -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 +151 -0
- package/dist/esm/FocusGroup/FocusGrid.js.map +7 -0
- package/{esm → dist/esm}/FocusGroup/FocusGroup.js +56 -137
- 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 +25 -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 +38 -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 +44 -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 +19 -0
- package/dist/esm/createDataInstance/createInstancePlugin.js.map +7 -0
- package/dist/esm/createDataInstance/createInstanceRef.js +67 -0
- package/dist/esm/createDataInstance/createInstanceRef.js.map +7 -0
- package/dist/esm/createDataInstance/utils.js +70 -0
- package/dist/esm/createDataInstance/utils.js.map +7 -0
- package/dist/esm/defer-render-hoc/index.js +27 -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 +82 -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 +118 -0
- package/dist/esm/useDataGrid/initColumnDefinition.js.map +7 -0
- package/dist/esm/useDataGrid/useDataGrid.js +177 -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 +67 -0
- package/dist/esm/useDataList/useDataList.js.map +7 -0
- package/dist/esm/utils.js +78 -0
- package/dist/esm/utils.js.map +7 -0
- package/dist/esm/virtualization/AutoHeightList.js +40 -0
- package/dist/esm/virtualization/AutoHeightList.js.map +7 -0
- package/dist/esm/virtualization/FluidHeightList.js +14 -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/{types → dist/types}/Animations/BaseAnimation.d.ts +1 -0
- package/{types → dist/types}/Animations/Grow.d.ts +1 -0
- package/{types → dist/types}/Animations/GrowRight.d.ts +1 -0
- package/{types → dist/types}/Animations/GrowVertical.d.ts +0 -0
- package/{types → dist/types}/CheckableGroup.d.ts +1 -0
- package/dist/types/DeferRenderAfterComputation.d.ts +7 -0
- package/dist/types/FocusGroup/FocusGrid.d.ts +12 -0
- package/{types → dist/types}/FocusGroup/FocusGroup.d.ts +3 -1
- package/dist/types/FocusGroup/FocusGroupContext.d.ts +4 -0
- package/{types → dist/types}/FocusGroup/FocusGroupManager.d.ts +3 -1
- package/dist/types/FocusGroup/focusGroupManagerHoc.d.ts +9 -0
- package/dist/types/FocusGroup/index.d.ts +6 -0
- package/dist/types/FocusGroup/useFocusGroupItem.d.ts +4 -0
- package/{types → dist/types}/FocusGroup/utils/getNextCellPosition.d.ts +3 -1
- package/{types → dist/types}/GroupContext/Group.d.ts +1 -0
- package/{types → dist/types}/GroupContext/GroupContext.d.ts +0 -0
- package/{types → dist/types}/GroupContext/GroupItem.d.ts +1 -0
- package/dist/types/GroupContext/index.d.ts +3 -0
- package/{types → dist/types}/ScrollSync/ScrollSync.d.ts +4 -2
- package/dist/types/ScrollSync/ScrollSyncPane.d.ts +3 -0
- package/{types → dist/types}/ScrollSync/ScrollSyncProvider.d.ts +0 -0
- package/dist/types/ScrollSync/index.d.ts +2 -0
- package/dist/types/ScrollSync/useScrollSync.d.ts +7 -0
- package/{types → dist/types}/constants.d.ts +0 -0
- package/dist/types/createDataInstance/createInstancePlugin.d.ts +2 -0
- package/{types → dist/types}/createDataInstance/createInstanceRef.d.ts +3 -1
- package/{types → dist/types}/createDataInstance/tests/createInstanceRef.test.d.ts +0 -0
- package/{types → dist/types}/createDataInstance/utils.d.ts +0 -0
- package/dist/types/dimsum.config.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/{types → dist/types}/prop-types.d.ts +0 -0
- package/{types → dist/types}/react-spring/index.d.ts +0 -0
- package/{types → dist/types}/react-spring/renderprops.d.ts +0 -0
- package/dist/types/toolbar/ToolbarProvider.d.ts +5 -0
- package/dist/types/useDataGrid/VolatileRowsListener.d.ts +7 -0
- package/dist/types/useDataGrid/index.d.ts +1 -0
- package/{types → dist/types}/useDataGrid/initColumnDefinition.d.ts +2 -1
- package/dist/types/useDataGrid/useDataGrid.d.ts +9 -0
- package/dist/types/useDataList/index.d.ts +1 -0
- package/{types → dist/types}/useDataList/recordIterator.d.ts +0 -0
- package/{types → dist/types}/useDataList/useDataList.d.ts +3 -2
- package/{types → dist/types}/utils.d.ts +0 -0
- package/{types → dist/types}/virtualization/AutoHeightList.d.ts +0 -0
- package/{types → dist/types}/virtualization/FluidHeightList.d.ts +0 -0
- package/{types → dist/types}/virtualization/index.d.ts +0 -0
- package/package.json +115 -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/DeferRenderAfterComputation.d.ts +0 -6
- package/types/FocusGroup/FocusGrid.d.ts +0 -10
- package/types/FocusGroup/FocusGroupContext.d.ts +0 -3
- 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/GroupContext/index.d.ts +0 -3
- package/types/ScrollSync/ScrollSyncPane.d.ts +0 -3
- package/types/ScrollSync/index.d.ts +0 -2
- package/types/ScrollSync/useScrollSync.d.ts +0 -6
- package/types/createDataInstance/createInstancePlugin.d.ts +0 -1
- package/types/dimsum.config.d.ts +0 -4
- package/types/index.d.ts +0 -2
- 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/useDataGrid.d.ts +0 -8
- package/types/useDataList/index.d.ts +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
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 ScrollSyncProvider_exports = {};
|
|
29
|
+
__export(ScrollSyncProvider_exports, {
|
|
30
|
+
default: () => ScrollSyncProvider_default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_react = __toESM(require("react"));
|
|
34
|
+
var import_raf = __toESM(require("raf"));
|
|
35
|
+
const ScrollSyncContext = import_react.default.createContext();
|
|
36
|
+
const { Provider } = ScrollSyncContext;
|
|
37
|
+
function ScrollSyncProvider({ enabled, horizontal, vertical, children }) {
|
|
38
|
+
const panes = useRef();
|
|
39
|
+
const registerPane = (node, groups) => {
|
|
40
|
+
groups.forEach((group) => {
|
|
41
|
+
if (!this.panes[group]) {
|
|
42
|
+
this.panes[group] = [];
|
|
43
|
+
}
|
|
44
|
+
if (!this.findPane(node, group)) {
|
|
45
|
+
if (this.panes[group].length > 0) {
|
|
46
|
+
this.syncScrollPosition(this.panes[group][0], node);
|
|
47
|
+
}
|
|
48
|
+
this.panes[group].push(node);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
this.addEvents(node, groups);
|
|
52
|
+
};
|
|
53
|
+
const unregisterPane = (node, groups) => {
|
|
54
|
+
groups.forEach((group) => {
|
|
55
|
+
if (this.findPane(node, group)) {
|
|
56
|
+
this.removeEvents(node);
|
|
57
|
+
this.panes[group].splice(this.panes[group].indexOf(node), 1);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const addEvents = (node, groups) => {
|
|
62
|
+
node.onscroll = this.handlePaneScroll.bind(this, node, groups);
|
|
63
|
+
};
|
|
64
|
+
const removeEvents = (node) => {
|
|
65
|
+
node.onscroll = null;
|
|
66
|
+
};
|
|
67
|
+
const findPane = (node, group) => {
|
|
68
|
+
if (!this.panes[group]) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
return this.panes[group].find((pane) => pane === node);
|
|
72
|
+
};
|
|
73
|
+
const handlePaneScroll = (node, groups) => {
|
|
74
|
+
if (!enabled)
|
|
75
|
+
return;
|
|
76
|
+
window.requestAnimationFrame(() => {
|
|
77
|
+
this.syncScrollPositions(node, groups);
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
const syncScrollPositions = (scrolledPane, groups) => {
|
|
81
|
+
groups.forEach((group) => {
|
|
82
|
+
this.panes[group].forEach((pane) => {
|
|
83
|
+
if (scrolledPane !== pane) {
|
|
84
|
+
this.removeEvents(pane, group);
|
|
85
|
+
this.syncScrollPosition(scrolledPane, pane);
|
|
86
|
+
window.requestAnimationFrame(() => {
|
|
87
|
+
this.addEvents(pane, groups);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
const syncScrollPosition = (0, import_raf.default)((scrolledPane, pane) => {
|
|
94
|
+
const {
|
|
95
|
+
scrollTop,
|
|
96
|
+
scrollHeight,
|
|
97
|
+
clientHeight,
|
|
98
|
+
scrollLeft,
|
|
99
|
+
scrollWidth,
|
|
100
|
+
clientWidth
|
|
101
|
+
} = scrolledPane;
|
|
102
|
+
const scrollTopOffset = scrollHeight - clientHeight;
|
|
103
|
+
const scrollLeftOffset = scrollWidth - clientWidth;
|
|
104
|
+
const { proportional, vertical: vertical2, horizontal: horizontal2 } = this.props;
|
|
105
|
+
const paneHeight = pane.scrollHeight - clientHeight;
|
|
106
|
+
const paneWidth = pane.scrollWidth - clientWidth;
|
|
107
|
+
if (vertical2 && scrollTopOffset > 0) {
|
|
108
|
+
pane.scrollTop = proportional ? paneHeight * scrollTop / scrollTopOffset : scrollTop;
|
|
109
|
+
}
|
|
110
|
+
if (horizontal2 && scrollLeftOffset > 0) {
|
|
111
|
+
pane.scrollLeft = proportional ? paneWidth * scrollLeft / scrollLeftOffset : scrollLeft;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return /* @__PURE__ */ import_react.default.createElement(Provider, null, children);
|
|
115
|
+
}
|
|
116
|
+
ScrollSyncProvider.propTypes = {};
|
|
117
|
+
ScrollSyncProvider.defaultProps = {};
|
|
118
|
+
var ScrollSyncProvider_default = ScrollSyncProvider;
|
|
119
|
+
module.exports = __toCommonJS(ScrollSyncProvider_exports);
|
|
120
|
+
//# sourceMappingURL=ScrollSyncProvider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ScrollSync/ScrollSyncProvider.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport raf from 'raf';\nimport PropTypes from 'prop-types';\n\nconst ScrollSyncContext = React.createContext();\n\nconst { Provider } = ScrollSyncContext;\n\nfunction ScrollSyncProvider({ enabled, horizontal, vertical, children }) {\n const panes = useRef();\n\n const registerPane = (node, groups) => {\n groups.forEach(group => {\n if (!this.panes[group]) {\n this.panes[group] = [];\n }\n\n if (!this.findPane(node, group)) {\n if (this.panes[group].length > 0) {\n this.syncScrollPosition(this.panes[group][0], node);\n }\n this.panes[group].push(node);\n }\n });\n this.addEvents(node, groups);\n };\n const unregisterPane = (node, groups) => {\n groups.forEach(group => {\n if (this.findPane(node, group)) {\n this.removeEvents(node);\n this.panes[group].splice(this.panes[group].indexOf(node), 1);\n }\n });\n };\n const addEvents = (node, groups) => {\n /* For some reason element.addEventListener doesnt work with document.body */\n node.onscroll = this.handlePaneScroll.bind(this, node, groups); // eslint-disable-line\n };\n const removeEvents = node => {\n /* For some reason element.removeEventListener doesnt work with document.body */\n node.onscroll = null; // eslint-disable-line\n };\n const findPane = (node, group) => {\n if (!this.panes[group]) {\n return false;\n }\n\n return this.panes[group].find(pane => pane === node);\n };\n const handlePaneScroll = (node, groups) => {\n if (!enabled) return;\n\n window.requestAnimationFrame(() => {\n this.syncScrollPositions(node, groups);\n });\n };\n const syncScrollPositions = (scrolledPane, groups) => {\n groups.forEach(group => {\n this.panes[group].forEach(pane => {\n /* For all panes beside the currently scrolling one */\n if (scrolledPane !== pane) {\n /* Remove event listeners from the node that we'll manipulate */\n this.removeEvents(pane, group);\n this.syncScrollPosition(scrolledPane, pane);\n /* Re-attach event listeners after we're done scrolling */\n window.requestAnimationFrame(() => {\n this.addEvents(pane, groups);\n });\n }\n });\n });\n };\n const syncScrollPosition = raf((scrolledPane, pane) => {\n const {\n scrollTop,\n scrollHeight,\n clientHeight,\n scrollLeft,\n scrollWidth,\n clientWidth,\n } = scrolledPane;\n\n const scrollTopOffset = scrollHeight - clientHeight;\n const scrollLeftOffset = scrollWidth - clientWidth;\n\n const { proportional, vertical, horizontal } = this.props;\n\n /* Calculate the actual pane height */\n const paneHeight = pane.scrollHeight - clientHeight;\n const paneWidth = pane.scrollWidth - clientWidth;\n /* Adjust the scrollTop position of it accordingly */\n if (vertical && scrollTopOffset > 0) {\n pane.scrollTop = proportional\n ? (paneHeight * scrollTop) / scrollTopOffset\n : scrollTop; // eslint-disable-line\n }\n if (horizontal && scrollLeftOffset > 0) {\n pane.scrollLeft = proportional\n ? (paneWidth * scrollLeft) / scrollLeftOffset\n : scrollLeft; // eslint-disable-line\n }\n });\n\n return <Provider>{children}</Provider>;\n}\n\nScrollSyncProvider.propTypes = {};\nScrollSyncProvider.defaultProps = {};\n\nexport default ScrollSyncProvider;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,iBAAgB;AAGhB,MAAM,oBAAoB,qBAAM;AAEhC,MAAM,EAAE,aAAa;AAErB,4BAA4B,EAAE,SAAS,YAAY,UAAU,YAAY;AACvE,QAAM,QAAQ;AAEd,QAAM,eAAe,CAAC,MAAM,WAAW;AACrC,WAAO,QAAQ,WAAS;AACtB,UAAI,CAAC,KAAK,MAAM,QAAQ;AACtB,aAAK,MAAM,SAAS;AAAA;AAGtB,UAAI,CAAC,KAAK,SAAS,MAAM,QAAQ;AAC/B,YAAI,KAAK,MAAM,OAAO,SAAS,GAAG;AAChC,eAAK,mBAAmB,KAAK,MAAM,OAAO,IAAI;AAAA;AAEhD,aAAK,MAAM,OAAO,KAAK;AAAA;AAAA;AAG3B,SAAK,UAAU,MAAM;AAAA;AAEvB,QAAM,iBAAiB,CAAC,MAAM,WAAW;AACvC,WAAO,QAAQ,WAAS;AACtB,UAAI,KAAK,SAAS,MAAM,QAAQ;AAC9B,aAAK,aAAa;AAClB,aAAK,MAAM,OAAO,OAAO,KAAK,MAAM,OAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAIhE,QAAM,YAAY,CAAC,MAAM,WAAW;AAElC,SAAK,WAAW,KAAK,iBAAiB,KAAK,MAAM,MAAM;AAAA;AAEzD,QAAM,eAAe,UAAQ;AAE3B,SAAK,WAAW;AAAA;AAElB,QAAM,WAAW,CAAC,MAAM,UAAU;AAChC,QAAI,CAAC,KAAK,MAAM,QAAQ;AACtB,aAAO;AAAA;AAGT,WAAO,KAAK,MAAM,OAAO,KAAK,UAAQ,SAAS;AAAA;AAEjD,QAAM,mBAAmB,CAAC,MAAM,WAAW;AACzC,QAAI,CAAC;AAAS;AAEd,WAAO,sBAAsB,MAAM;AACjC,WAAK,oBAAoB,MAAM;AAAA;AAAA;AAGnC,QAAM,sBAAsB,CAAC,cAAc,WAAW;AACpD,WAAO,QAAQ,WAAS;AACtB,WAAK,MAAM,OAAO,QAAQ,UAAQ;AAEhC,YAAI,iBAAiB,MAAM;AAEzB,eAAK,aAAa,MAAM;AACxB,eAAK,mBAAmB,cAAc;AAEtC,iBAAO,sBAAsB,MAAM;AACjC,iBAAK,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAM/B,QAAM,qBAAqB,wBAAI,CAAC,cAAc,SAAS;AACrD,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACE;AAEJ,UAAM,kBAAkB,eAAe;AACvC,UAAM,mBAAmB,cAAc;AAEvC,UAAM,EAAE,cAAc,qBAAU,4BAAe,KAAK;AAGpD,UAAM,aAAa,KAAK,eAAe;AACvC,UAAM,YAAY,KAAK,cAAc;AAErC,QAAI,aAAY,kBAAkB,GAAG;AACnC,WAAK,YAAY,eACZ,aAAa,YAAa,kBAC3B;AAAA;AAEN,QAAI,eAAc,mBAAmB,GAAG;AACtC,WAAK,aAAa,eACb,YAAY,aAAc,mBAC3B;AAAA;AAAA;AAIR,SAAO,mDAAC,UAAD,MAAW;AAAA;AAGpB,mBAAmB,YAAY;AAC/B,mBAAmB,eAAe;AAElC,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 ScrollSync_exports = {};
|
|
29
|
+
__export(ScrollSync_exports, {
|
|
30
|
+
ScrollSync: () => import_ScrollSync.ScrollSync,
|
|
31
|
+
ScrollSyncPane: () => import_ScrollSyncPane.ScrollSyncPaneHOC
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_ScrollSync = require("./ScrollSync");
|
|
35
|
+
var import_ScrollSyncPane = require("./ScrollSyncPane");
|
|
36
|
+
module.exports = __toCommonJS(ScrollSync_exports);
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ScrollSync/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { ScrollSync } from './ScrollSync';\nexport { ScrollSyncPaneHOC as ScrollSyncPane } from './ScrollSyncPane';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA2B;AAC3B,4BAAoD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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 useScrollSync_exports = {};
|
|
29
|
+
__export(useScrollSync_exports, {
|
|
30
|
+
default: () => useScrollSync_default,
|
|
31
|
+
useScrollSync: () => useScrollSync
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
const useScrollSync = (props) => {
|
|
35
|
+
return {};
|
|
36
|
+
};
|
|
37
|
+
useScrollSync.propTypes = {};
|
|
38
|
+
useScrollSync.defaultProps = {};
|
|
39
|
+
var useScrollSync_default = useScrollSync;
|
|
40
|
+
module.exports = __toCommonJS(useScrollSync_exports);
|
|
41
|
+
//# sourceMappingURL=useScrollSync.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ScrollSync/useScrollSync.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst useScrollSync = (props) => {\n return {};\n}\n\nuseScrollSync.propTypes = {};\nuseScrollSync.defaultProps = {};\n\nexport { useScrollSync };\nexport default useScrollSync;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,MAAM,gBAAgB,CAAC,UAAU;AAC/B,SAAO;AAAA;AAGT,cAAc,YAAY;AAC1B,cAAc,eAAe;AAG7B,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 constants_exports = {};
|
|
29
|
+
__export(constants_exports, {
|
|
30
|
+
AM: () => AM,
|
|
31
|
+
ARROW_DOWN: () => ARROW_DOWN,
|
|
32
|
+
ARROW_UP: () => ARROW_UP,
|
|
33
|
+
BACKSPACE: () => BACKSPACE,
|
|
34
|
+
DEFAULT_DELAY_CLOSE: () => DEFAULT_DELAY_CLOSE,
|
|
35
|
+
DEFAULT_DELAY_OPEN: () => DEFAULT_DELAY_OPEN,
|
|
36
|
+
END: () => END,
|
|
37
|
+
ESCAPE: () => ESCAPE,
|
|
38
|
+
GENERAL_TIME_RANGE: () => GENERAL_TIME_RANGE,
|
|
39
|
+
HOME: () => HOME,
|
|
40
|
+
HOUR_RANGE_12: () => HOUR_RANGE_12,
|
|
41
|
+
HOUR_RANGE_24: () => HOUR_RANGE_24,
|
|
42
|
+
PLACEHOLDER_TIME: () => PLACEHOLDER_TIME,
|
|
43
|
+
PM: () => PM,
|
|
44
|
+
SHIFT: () => SHIFT,
|
|
45
|
+
sizeOptions: () => sizeOptions
|
|
46
|
+
});
|
|
47
|
+
var React = __toESM(require("react"));
|
|
48
|
+
const DEFAULT_DELAY_OPEN = 200;
|
|
49
|
+
const DEFAULT_DELAY_CLOSE = 300;
|
|
50
|
+
const sizeOptions = ["small", "medium", "large", "x-large"];
|
|
51
|
+
const AM = "am";
|
|
52
|
+
const PM = "pm";
|
|
53
|
+
const ARROW_UP = "ArrowUp";
|
|
54
|
+
const ARROW_DOWN = "ArrowDown";
|
|
55
|
+
const BACKSPACE = "Backspace";
|
|
56
|
+
const ESCAPE = "Escape";
|
|
57
|
+
const HOME = "Home";
|
|
58
|
+
const SHIFT = "Shift";
|
|
59
|
+
const END = "End";
|
|
60
|
+
const HOUR_RANGE_12 = { min: 0, max: 12 };
|
|
61
|
+
const HOUR_RANGE_24 = { min: 0, max: 24 };
|
|
62
|
+
const GENERAL_TIME_RANGE = { min: 0, max: 59 };
|
|
63
|
+
const PLACEHOLDER_TIME = {
|
|
64
|
+
hour: "hour",
|
|
65
|
+
minutes: "minutes",
|
|
66
|
+
seconds: "seconds",
|
|
67
|
+
meridiem: "meridiem"
|
|
68
|
+
};
|
|
69
|
+
module.exports = __toCommonJS(constants_exports);
|
|
70
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/constants.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const DEFAULT_DELAY_OPEN = 200;\nexport const DEFAULT_DELAY_CLOSE = 300;\nexport const sizeOptions = ['small', 'medium', 'large', 'x-large'];\nexport const AM = 'am';\nexport const PM = 'pm';\nexport const ARROW_UP = 'ArrowUp';\nexport const ARROW_DOWN = 'ArrowDown';\nexport const BACKSPACE = 'Backspace';\nexport const ESCAPE = 'Escape';\nexport const HOME = 'Home';\nexport const SHIFT = 'Shift';\nexport const END = 'End';\nexport const HOUR_RANGE_12 = { min: 0, max: 12 };\nexport const HOUR_RANGE_24 = { min: 0, max: 24 };\nexport const GENERAL_TIME_RANGE = { min: 0, max: 59 };\nexport const PLACEHOLDER_TIME = {\n hour: 'hour',\n minutes: 'minutes',\n seconds: 'seconds',\n meridiem: 'meridiem',\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,cAAc,CAAC,SAAS,UAAU,SAAS;AACjD,MAAM,KAAK;AACX,MAAM,KAAK;AACX,MAAM,WAAW;AACjB,MAAM,aAAa;AACnB,MAAM,YAAY;AAClB,MAAM,SAAS;AACf,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,gBAAgB,EAAE,KAAK,GAAG,KAAK;AACrC,MAAM,gBAAgB,EAAE,KAAK,GAAG,KAAK;AACrC,MAAM,qBAAqB,EAAE,KAAK,GAAG,KAAK;AAC1C,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 createInstancePlugin_exports = {};
|
|
29
|
+
__export(createInstancePlugin_exports, {
|
|
30
|
+
createInstancePlugin: () => createInstancePlugin,
|
|
31
|
+
default: () => createInstancePlugin_default
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
const getDecoratorsFromHooks = (hooks, decorators) => {
|
|
35
|
+
const nextDecorators = { ...decorators };
|
|
36
|
+
Object.keys(hooks).forEach((decorator) => {
|
|
37
|
+
if (Array.isArray(decorators[decorator])) {
|
|
38
|
+
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
39
|
+
} else {
|
|
40
|
+
nextDecorators[decorator] = hooks[decorator];
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return nextDecorators;
|
|
44
|
+
};
|
|
45
|
+
const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromHooks(hooks, decorators);
|
|
46
|
+
var createInstancePlugin_default = createInstancePlugin;
|
|
47
|
+
module.exports = __toCommonJS(createInstancePlugin_exports);
|
|
48
|
+
//# sourceMappingURL=createInstancePlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/createDataInstance/createInstancePlugin.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["const getDecoratorsFromHooks = (hooks, decorators) => {\n const nextDecorators = { ...decorators };\n\n Object.keys(hooks).forEach((decorator) => {\n if (Array.isArray(decorators[decorator])) {\n nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];\n } else {\n nextDecorators[decorator] = hooks[decorator];\n }\n });\n\n return nextDecorators;\n};\n\nexport const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromHooks(hooks, decorators);\n\nexport default createInstancePlugin;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,yBAAyB,CAAC,OAAO,eAAe;AACpD,QAAM,iBAAiB,KAAK;AAE5B,SAAO,KAAK,OAAO,QAAQ,CAAC,cAAc;AACxC,QAAI,MAAM,QAAQ,WAAW,aAAa;AACxC,qBAAe,aAAa,CAAC,GAAG,WAAW,YAAY,MAAM;AAAA,WACxD;AACL,qBAAe,aAAa,MAAM;AAAA;AAAA;AAItC,SAAO;AAAA;AAGF,MAAM,uBAAuB,CAAC,MAAM,UAAU,CAAC,eAAe,uBAAuB,OAAO;AAEnG,IAAO,+BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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 createInstanceRef_exports = {};
|
|
29
|
+
__export(createInstanceRef_exports, {
|
|
30
|
+
createDataInstanceRef: () => createDataInstanceRef,
|
|
31
|
+
default: () => createInstanceRef_default
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_uuid = require("uuid");
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_lodash = require("lodash");
|
|
37
|
+
var import_utils = require("./utils");
|
|
38
|
+
const defaultDecorators = {
|
|
39
|
+
instance: [],
|
|
40
|
+
state: [],
|
|
41
|
+
hotKeys: [],
|
|
42
|
+
renderers: [],
|
|
43
|
+
composeData: []
|
|
44
|
+
};
|
|
45
|
+
function createDataInstanceRef({
|
|
46
|
+
uuid: uuidProp,
|
|
47
|
+
data,
|
|
48
|
+
renderers,
|
|
49
|
+
plugins,
|
|
50
|
+
customDecorators,
|
|
51
|
+
...props
|
|
52
|
+
}) {
|
|
53
|
+
const instance = (0, import_react.useRef)();
|
|
54
|
+
const [uuid] = (0, import_react.useState)(uuidProp || (() => (0, import_uuid.v4)()));
|
|
55
|
+
instance.current = {
|
|
56
|
+
uuid,
|
|
57
|
+
state: {},
|
|
58
|
+
actions: {},
|
|
59
|
+
hotKeys: {},
|
|
60
|
+
originalData: data,
|
|
61
|
+
records: [],
|
|
62
|
+
renderers,
|
|
63
|
+
ref(key) {
|
|
64
|
+
return (node) => instance.current.refs[key] = node;
|
|
65
|
+
},
|
|
66
|
+
getInstance() {
|
|
67
|
+
return instance.current;
|
|
68
|
+
},
|
|
69
|
+
props
|
|
70
|
+
};
|
|
71
|
+
const decorators = (0, import_react.useMemo)(() => {
|
|
72
|
+
let nextDecorators = { ...defaultDecorators, ...customDecorators };
|
|
73
|
+
plugins.forEach((plugin) => {
|
|
74
|
+
if (!plugin)
|
|
75
|
+
return;
|
|
76
|
+
nextDecorators = plugin(nextDecorators);
|
|
77
|
+
});
|
|
78
|
+
Object.keys(nextDecorators).forEach((key) => {
|
|
79
|
+
if (Array.isArray(nextDecorators[key]))
|
|
80
|
+
nextDecorators[key] = (0, import_lodash.orderBy)(nextDecorators[key], (item) => item.order);
|
|
81
|
+
});
|
|
82
|
+
return nextDecorators;
|
|
83
|
+
}, []);
|
|
84
|
+
instance.current = decorators.instance.reduce(import_utils.mergeInstance, instance.current);
|
|
85
|
+
instance.current = decorators.state.reduce(import_utils.registerStateHookToInstance, instance.current);
|
|
86
|
+
instance.current = decorators.hotKeys.reduce(import_utils.registerHotKeysHookToInstance, instance.current);
|
|
87
|
+
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
88
|
+
return { instance, decorators };
|
|
89
|
+
}
|
|
90
|
+
var createInstanceRef_default = createDataInstanceRef;
|
|
91
|
+
module.exports = __toCommonJS(createInstanceRef_exports);
|
|
92
|
+
//# sourceMappingURL=createInstanceRef.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/createDataInstance/createInstanceRef.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { v4 as uuidv4 } from 'uuid';\nimport { useMemo, useRef, useState } from 'react';\nimport { orderBy } from 'lodash';\nimport {\n mergeInstance,\n registerHotKeysHookToInstance,\n registerStateHookToInstance,\n} from './utils';\n\nconst defaultDecorators = {\n instance: [],\n state: [],\n hotKeys: [],\n renderers: [],\n composeData: [],\n};\n\nfunction createDataInstanceRef({\n uuid: uuidProp,\n data,\n renderers,\n plugins,\n customDecorators,\n ...props\n}) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const instance = useRef();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const [uuid] = useState(uuidProp || (() => uuidv4()));\n\n instance.current = {\n uuid,\n state: {},\n actions: {},\n hotKeys: {}, // keyboard hotkeys to run specific actions\n originalData: data,\n records: [], // item abstraction with meta data for originalData\n renderers,\n ref(key) {\n // eslint-disable-next-line no-return-assign\n return (node) => (instance.current.refs[key] = node);\n },\n getInstance() {\n return instance.current;\n },\n props,\n };\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const decorators = useMemo(() => {\n let nextDecorators = { ...defaultDecorators, ...customDecorators };\n\n plugins.forEach((plugin) => {\n if (!plugin) return;\n nextDecorators = plugin(nextDecorators);\n });\n\n Object.keys(nextDecorators).forEach((key) => {\n if (Array.isArray(nextDecorators[key]))\n nextDecorators[key] = orderBy(\n nextDecorators[key],\n (item) => item.order,\n );\n });\n\n return nextDecorators;\n }, []); // the plugins are defined on creation, but not changed at runtime\n\n // todo: test if getting the hooks without registering them\n // here would be beneficial to memoize instance and squeeze performance\n instance.current = decorators.instance.reduce(\n mergeInstance,\n instance.current,\n );\n instance.current = decorators.state.reduce(\n registerStateHookToInstance,\n instance.current,\n );\n instance.current = decorators.hotKeys.reduce(\n registerHotKeysHookToInstance,\n instance.current,\n );\n instance.current.renderers = decorators.renderers.reduce(\n (result, decorator) => decorator(result, instance.current),\n renderers,\n );\n\n return { instance, decorators };\n}\n\nexport { createDataInstanceRef };\nexport default createDataInstanceRef;", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kBAA6B;AAC7B,mBAA0C;AAC1C,oBAAwB;AACxB,mBAIO;AAEP,MAAM,oBAAoB;AAAA,EACxB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,WAAW;AAAA,EACX,aAAa;AAAA;AAGf,+BAA+B;AAAA,EAC7B,MAAM;AAAA,EACN;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,KACG;AAAA,GACF;AAED,QAAM,WAAW;AAEjB,QAAM,CAAC,QAAQ,2BAAS,YAAa,OAAM;AAE3C,WAAS,UAAU;AAAA,IACjB;AAAA,IACA,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,cAAc;AAAA,IACd,SAAS;AAAA,IACT;AAAA,IACA,IAAI,KAAK;AAEP,aAAO,CAAC,SAAU,SAAS,QAAQ,KAAK,OAAO;AAAA;AAAA,IAEjD,cAAc;AACZ,aAAO,SAAS;AAAA;AAAA,IAElB;AAAA;AAIF,QAAM,aAAa,0BAAQ,MAAM;AAC/B,QAAI,iBAAiB,KAAK,sBAAsB;AAEhD,YAAQ,QAAQ,CAAC,WAAW;AAC1B,UAAI,CAAC;AAAQ;AACb,uBAAiB,OAAO;AAAA;AAG1B,WAAO,KAAK,gBAAgB,QAAQ,CAAC,QAAQ;AAC3C,UAAI,MAAM,QAAQ,eAAe;AAC/B,uBAAe,OAAO,2BACpB,eAAe,MACf,CAAC,SAAS,KAAK;AAAA;AAIrB,WAAO;AAAA,KACN;AAIH,WAAS,UAAU,WAAW,SAAS,OACrC,4BACA,SAAS;AAEX,WAAS,UAAU,WAAW,MAAM,OAClC,0CACA,SAAS;AAEX,WAAS,UAAU,WAAW,QAAQ,OACpC,4CACA,SAAS;AAEX,WAAS,QAAQ,YAAY,WAAW,UAAU,OAChD,CAAC,QAAQ,cAAc,UAAU,QAAQ,SAAS,UAClD;AAGF,SAAO,EAAE,UAAU;AAAA;AAIrB,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
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 utils_exports = {};
|
|
29
|
+
__export(utils_exports, {
|
|
30
|
+
applyDecorators: () => applyDecorators,
|
|
31
|
+
composeFormatters: () => composeFormatters,
|
|
32
|
+
decorateColumns: () => decorateColumns,
|
|
33
|
+
evaluateFormatters: () => evaluateFormatters,
|
|
34
|
+
evaluateTransforms: () => evaluateTransforms,
|
|
35
|
+
mergeInstance: () => mergeInstance,
|
|
36
|
+
reducePropsGetter: () => reducePropsGetter,
|
|
37
|
+
registerHotKeysHookToInstance: () => registerHotKeysHookToInstance,
|
|
38
|
+
registerStateHookToInstance: () => registerStateHookToInstance
|
|
39
|
+
});
|
|
40
|
+
var React = __toESM(require("react"));
|
|
41
|
+
const reducePropsGetter = (decorators = [], grid) => (props = {}, extraParams) => {
|
|
42
|
+
let nextProps = props;
|
|
43
|
+
decorators.forEach((decorator) => {
|
|
44
|
+
nextProps = decorator(nextProps, grid, extraParams);
|
|
45
|
+
});
|
|
46
|
+
return nextProps;
|
|
47
|
+
};
|
|
48
|
+
function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
|
|
49
|
+
let nextProps = props;
|
|
50
|
+
transforms.forEach((transform) => {
|
|
51
|
+
nextProps = transform(value, extraParams, nextProps, grid);
|
|
52
|
+
});
|
|
53
|
+
return nextProps;
|
|
54
|
+
}
|
|
55
|
+
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
56
|
+
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
57
|
+
}
|
|
58
|
+
function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
|
|
59
|
+
return (props) => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
60
|
+
}
|
|
61
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
62
|
+
const decorateColumns = (columns, decorators, grid) => {
|
|
63
|
+
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
64
|
+
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
65
|
+
};
|
|
66
|
+
const mergeInstance = (instance, instanceHook) => ({
|
|
67
|
+
...instance,
|
|
68
|
+
...instanceHook(instance)
|
|
69
|
+
});
|
|
70
|
+
const registerStateHookToInstance = (instance, stateHook) => {
|
|
71
|
+
const { state, actions } = stateHook(instance);
|
|
72
|
+
return {
|
|
73
|
+
...instance,
|
|
74
|
+
state: {
|
|
75
|
+
...instance.state,
|
|
76
|
+
...state
|
|
77
|
+
},
|
|
78
|
+
actions: {
|
|
79
|
+
...instance.actions,
|
|
80
|
+
...actions
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
const reduceHotKey = (instance, { key, handler, options, allowDocumentHandler }) => ({
|
|
85
|
+
...instance,
|
|
86
|
+
hotKeys: {
|
|
87
|
+
...instance.hotKeys,
|
|
88
|
+
[key]: { handler, options, allowDocumentHandler }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
92
|
+
const hotKeys = hotKeysHook(instance);
|
|
93
|
+
if (Array.isArray(hotKeys)) {
|
|
94
|
+
return hotKeys.reduce(reduceHotKey, instance);
|
|
95
|
+
}
|
|
96
|
+
return reduceHotKey(instance, hotKeys);
|
|
97
|
+
};
|
|
98
|
+
module.exports = __toCommonJS(utils_exports);
|
|
99
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/createDataInstance/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export const reducePropsGetter = (decorators = [], grid) => (\n props = {},\n extraParams,\n) => {\n let nextProps = props;\n decorators.forEach((decorator) => {\n nextProps = decorator(nextProps, grid, extraParams);\n });\n return nextProps;\n};\n\n/* eslint-disable-next-line max-params */\nexport function evaluateTransforms(\n transforms,\n value,\n extraParams = {},\n props = {},\n grid,\n) {\n let nextProps = props;\n transforms.forEach((transform) => {\n nextProps = transform(value, extraParams, nextProps, grid);\n });\n return nextProps;\n}\n\n/* eslint-disable-next-line max-params */\nexport function evaluateFormatters(formatters, value, extraParams = {}, grid) {\n return formatters.reduce(\n (result, formatter) => formatter(result, extraParams, grid),\n value,\n );\n}\n\nexport function composeFormatters(\n formatters,\n instance,\n getItemValue = (record) => record.data.name,\n) {\n // todo: make the formatters subscribe to the item props instead of getting the whole instance\n // todo: addd should formatter update to memoize specific ones\n return (props) =>\n formatters.reduce(\n (result, formatter) => formatter(result, props, instance),\n getItemValue(props.record),\n );\n}\n\nexport const applyDecorators = (subject, decorators = [], ...args) =>\n decorators.reduce(\n (nextSubject, decorator) => decorator(nextSubject, ...args),\n subject,\n );\n\nexport const decorateColumns = (columns, decorators, grid) => {\n const nextColumns = applyDecorators(\n columns,\n decorators.decorateColumns,\n grid,\n );\n return nextColumns.map((column, index) =>\n applyDecorators(column, decorators.decorateColumn, grid, index),\n );\n};\n\nexport const mergeInstance = (instance, instanceHook) => ({\n ...instance,\n ...instanceHook(instance),\n});\n\nexport const registerStateHookToInstance = (instance, stateHook) => {\n const { state, actions } = stateHook(instance);\n return {\n ...instance,\n state: {\n ...instance.state,\n ...state,\n },\n actions: {\n ...instance.actions,\n ...actions,\n },\n };\n};\n\nconst reduceHotKey = (\n instance,\n { key, handler, options, allowDocumentHandler },\n) => ({\n ...instance,\n hotKeys: {\n ...instance.hotKeys,\n [key]: { handler, options, allowDocumentHandler },\n },\n});\n\nexport const registerHotKeysHookToInstance = (instance, hotKeysHook) => {\n const hotKeys = hotKeysHook(instance);\n if (Array.isArray(hotKeys)) {\n return hotKeys.reduce(reduceHotKey, instance);\n }\n return reduceHotKey(instance, hotKeys);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,oBAAoB,CAAC,aAAa,IAAI,SAAS,CAC1D,QAAQ,IACR,gBACG;AACH,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,WAAW,MAAM;AAAA;AAEzC,SAAO;AAAA;AAIF,4BACL,YACA,OACA,cAAc,IACd,QAAQ,IACR,MACA;AACA,MAAI,YAAY;AAChB,aAAW,QAAQ,CAAC,cAAc;AAChC,gBAAY,UAAU,OAAO,aAAa,WAAW;AAAA;AAEvD,SAAO;AAAA;AAIF,4BAA4B,YAAY,OAAO,cAAc,IAAI,MAAM;AAC5E,SAAO,WAAW,OAChB,CAAC,QAAQ,cAAc,UAAU,QAAQ,aAAa,OACtD;AAAA;AAIG,2BACL,YACA,UACA,eAAe,CAAC,WAAW,OAAO,KAAK,MACvC;AAGA,SAAO,CAAC,UACN,WAAW,OACT,CAAC,QAAQ,cAAc,UAAU,QAAQ,OAAO,WAChD,aAAa,MAAM;AAAA;AAIlB,MAAM,kBAAkB,CAAC,SAAS,aAAa,OAAO,SAC3D,WAAW,OACT,CAAC,aAAa,cAAc,UAAU,aAAa,GAAG,OACtD;AAGG,MAAM,kBAAkB,CAAC,SAAS,YAAY,SAAS;AAC5D,QAAM,cAAc,gBAClB,SACA,WAAW,iBACX;AAEF,SAAO,YAAY,IAAI,CAAC,QAAQ,UAC9B,gBAAgB,QAAQ,WAAW,gBAAgB,MAAM;AAAA;AAItD,MAAM,gBAAgB,CAAC,UAAU,iBAAkB;AAAA,KACrD;AAAA,KACA,aAAa;AAAA;AAGX,MAAM,8BAA8B,CAAC,UAAU,cAAc;AAClE,QAAM,EAAE,OAAO,YAAY,UAAU;AACrC,SAAO;AAAA,OACF;AAAA,IACH,OAAO;AAAA,SACF,SAAS;AAAA,SACT;AAAA;AAAA,IAEL,SAAS;AAAA,SACJ,SAAS;AAAA,SACT;AAAA;AAAA;AAAA;AAKT,MAAM,eAAe,CACnB,UACA,EAAE,KAAK,SAAS,SAAS,2BACrB;AAAA,KACD;AAAA,EACH,SAAS;AAAA,OACJ,SAAS;AAAA,KACX,MAAM,EAAE,SAAS,SAAS;AAAA;AAAA;AAIxB,MAAM,gCAAgC,CAAC,UAAU,gBAAgB;AACtE,QAAM,UAAU,YAAY;AAC5B,MAAI,MAAM,QAAQ,UAAU;AAC1B,WAAO,QAAQ,OAAO,cAAc;AAAA;AAEtC,SAAO,aAAa,UAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|