@elliemae/ds-shared 2.2.0-next.3 → 2.3.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/cjs/Animations/BaseAnimation.js +55 -35
- package/cjs/Animations/BaseAnimation.js.map +7 -0
- package/cjs/Animations/Grow.js +54 -41
- package/cjs/Animations/Grow.js.map +7 -0
- package/cjs/Animations/GrowRight.js +63 -41
- package/cjs/Animations/GrowRight.js.map +7 -0
- package/cjs/Animations/GrowVertical.js +47 -7
- package/cjs/Animations/GrowVertical.js.map +7 -0
- package/cjs/CheckableGroup.js +67 -65
- package/cjs/CheckableGroup.js.map +7 -0
- package/cjs/DeferRenderAfterComputation.js +48 -24
- package/cjs/DeferRenderAfterComputation.js.map +7 -0
- package/cjs/FocusGroup/FocusGrid.js +108 -143
- package/cjs/FocusGroup/FocusGrid.js.map +7 -0
- package/cjs/FocusGroup/FocusGroup.js +88 -147
- package/cjs/FocusGroup/FocusGroup.js.map +7 -0
- package/cjs/FocusGroup/FocusGroupContext.js +38 -11
- package/cjs/FocusGroup/FocusGroupContext.js.map +7 -0
- package/cjs/FocusGroup/FocusGroupManager.js +56 -47
- package/cjs/FocusGroup/FocusGroupManager.js.map +7 -0
- package/cjs/FocusGroup/focusGroupManagerHoc.js +52 -42
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/cjs/FocusGroup/index.js +47 -21
- package/cjs/FocusGroup/index.js.map +7 -0
- package/cjs/FocusGroup/useFocusGroupItem.js +59 -51
- package/cjs/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/cjs/FocusGroup/utils/getNextCellPosition.js +47 -27
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/cjs/GroupContext/Group.js +64 -73
- package/cjs/GroupContext/Group.js.map +7 -0
- package/cjs/GroupContext/GroupContext.js +36 -13
- package/cjs/GroupContext/GroupContext.js.map +7 -0
- package/cjs/GroupContext/GroupItem.js +39 -21
- package/cjs/GroupContext/GroupItem.js.map +7 -0
- package/cjs/GroupContext/index.js +39 -13
- package/cjs/GroupContext/index.js.map +7 -0
- package/cjs/ScrollSync/ScrollSync.js +60 -75
- package/cjs/ScrollSync/ScrollSync.js.map +7 -0
- package/cjs/ScrollSync/ScrollSyncPane.js +52 -60
- package/cjs/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/cjs/ScrollSync/ScrollSyncProvider.js +103 -50
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/cjs/ScrollSync/index.js +37 -11
- package/cjs/ScrollSync/index.js.map +7 -0
- package/cjs/ScrollSync/useScrollSync.js +38 -7
- package/cjs/ScrollSync/useScrollSync.js.map +7 -0
- package/cjs/constants.js +65 -46
- package/cjs/constants.js.map +7 -0
- package/cjs/createDataInstance/createInstancePlugin.js +41 -29
- package/cjs/createDataInstance/createInstancePlugin.js.map +7 -0
- package/cjs/createDataInstance/createInstanceRef.js +66 -71
- package/cjs/createDataInstance/createInstanceRef.js.map +7 -0
- package/cjs/createDataInstance/utils.js +76 -100
- package/cjs/createDataInstance/utils.js.map +7 -0
- package/cjs/defer-render-hoc/index.js +48 -41
- package/cjs/defer-render-hoc/index.js.map +7 -0
- package/cjs/dimsum.config.js +38 -6
- package/cjs/dimsum.config.js.map +7 -0
- package/cjs/index.js +40 -17
- package/cjs/index.js.map +7 -0
- package/cjs/prop-types.js +106 -49
- package/cjs/prop-types.js.map +7 -0
- package/cjs/react-spring/index.js +28 -14
- package/cjs/react-spring/index.js.map +7 -0
- package/cjs/react-spring/renderprops.js +28 -14
- package/cjs/react-spring/renderprops.js.map +7 -0
- package/cjs/toolbar/ToolbarProvider.js +82 -94
- package/cjs/toolbar/ToolbarProvider.js.map +7 -0
- package/cjs/useDataGrid/VolatileRowsListener.js +38 -13
- package/cjs/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/cjs/useDataGrid/index.js +36 -7
- package/cjs/useDataGrid/index.js.map +7 -0
- package/cjs/useDataGrid/initColumnDefinition.js +105 -110
- package/cjs/useDataGrid/initColumnDefinition.js.map +7 -0
- package/cjs/useDataGrid/useDataGrid.js +122 -148
- package/cjs/useDataGrid/useDataGrid.js.map +7 -0
- package/cjs/useDataList/index.js +36 -7
- package/cjs/useDataList/index.js.map +7 -0
- package/cjs/useDataList/recordIterator.js +42 -18
- package/cjs/useDataList/recordIterator.js.map +7 -0
- package/cjs/useDataList/useDataList.js +74 -83
- package/cjs/useDataList/useDataList.js.map +7 -0
- package/cjs/utils.js +71 -80
- package/cjs/utils.js.map +7 -0
- package/cjs/virtualization/AutoHeightList.js +62 -54
- package/cjs/virtualization/AutoHeightList.js.map +7 -0
- package/cjs/virtualization/FluidHeightList.js +42 -48
- package/cjs/virtualization/FluidHeightList.js.map +7 -0
- package/cjs/virtualization/index.js +48 -20
- package/cjs/virtualization/index.js.map +7 -0
- package/esm/Animations/BaseAnimation.js +26 -29
- package/esm/Animations/BaseAnimation.js.map +7 -0
- package/esm/Animations/Grow.js +25 -35
- package/esm/Animations/Grow.js.map +7 -0
- package/esm/Animations/GrowRight.js +34 -35
- package/esm/Animations/GrowRight.js.map +7 -0
- package/esm/Animations/GrowVertical.js +29 -4
- package/esm/Animations/GrowVertical.js.map +7 -0
- package/esm/CheckableGroup.js +35 -52
- package/esm/CheckableGroup.js.map +7 -0
- package/esm/DeferRenderAfterComputation.js +16 -15
- package/esm/DeferRenderAfterComputation.js.map +7 -0
- package/esm/FocusGroup/FocusGrid.js +64 -117
- package/esm/FocusGroup/FocusGrid.js.map +7 -0
- package/esm/FocusGroup/FocusGroup.js +56 -137
- package/esm/FocusGroup/FocusGroup.js.map +7 -0
- package/esm/FocusGroup/FocusGroupContext.js +9 -5
- package/esm/FocusGroup/FocusGroupContext.js.map +7 -0
- package/esm/FocusGroup/FocusGroupManager.js +24 -38
- package/esm/FocusGroup/FocusGroupManager.js.map +7 -0
- package/esm/FocusGroup/focusGroupManagerHoc.js +24 -36
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +7 -0
- package/esm/FocusGroup/index.js +18 -6
- package/esm/FocusGroup/index.js.map +7 -0
- package/esm/FocusGroup/useFocusGroupItem.js +28 -40
- package/esm/FocusGroup/useFocusGroupItem.js.map +7 -0
- package/esm/FocusGroup/utils/getNextCellPosition.js +18 -25
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +7 -0
- package/esm/GroupContext/Group.js +34 -66
- package/esm/GroupContext/Group.js.map +7 -0
- package/esm/GroupContext/GroupContext.js +7 -5
- package/esm/GroupContext/GroupContext.js.map +7 -0
- package/esm/GroupContext/GroupItem.js +10 -15
- package/esm/GroupContext/GroupItem.js.map +7 -0
- package/esm/GroupContext/index.js +10 -3
- package/esm/GroupContext/index.js.map +7 -0
- package/esm/ScrollSync/ScrollSync.js +30 -64
- package/esm/ScrollSync/ScrollSync.js.map +7 -0
- package/esm/ScrollSync/ScrollSyncPane.js +22 -52
- package/esm/ScrollSync/ScrollSyncPane.js.map +7 -0
- package/esm/ScrollSync/ScrollSyncProvider.js +74 -42
- package/esm/ScrollSync/ScrollSyncProvider.js.map +7 -0
- package/esm/ScrollSync/index.js +8 -2
- package/esm/ScrollSync/index.js.map +7 -0
- package/esm/ScrollSync/useScrollSync.js +9 -5
- package/esm/ScrollSync/useScrollSync.js.map +7 -0
- package/esm/constants.js +37 -28
- package/esm/constants.js.map +7 -0
- package/esm/createDataInstance/createInstancePlugin.js +12 -23
- package/esm/createDataInstance/createInstancePlugin.js.map +7 -0
- package/esm/createDataInstance/createInstanceRef.js +36 -59
- package/esm/createDataInstance/createInstanceRef.js.map +7 -0
- package/esm/createDataInstance/utils.js +48 -85
- package/esm/createDataInstance/utils.js.map +7 -0
- package/esm/defer-render-hoc/index.js +17 -31
- package/esm/defer-render-hoc/index.js.map +7 -0
- package/esm/dimsum.config.js +9 -4
- package/esm/dimsum.config.js.map +7 -0
- package/esm/index.js +11 -5
- package/esm/index.js.map +7 -0
- package/esm/prop-types.js +75 -31
- package/esm/prop-types.js.map +7 -0
- package/esm/react-spring/index.js +3 -1
- package/esm/react-spring/index.js.map +7 -0
- package/esm/react-spring/renderprops.js +3 -1
- package/esm/react-spring/renderprops.js.map +7 -0
- package/esm/toolbar/ToolbarProvider.js +45 -74
- package/esm/toolbar/ToolbarProvider.js.map +7 -0
- package/esm/useDataGrid/VolatileRowsListener.js +9 -11
- package/esm/useDataGrid/VolatileRowsListener.js.map +7 -0
- package/esm/useDataGrid/index.js +7 -1
- package/esm/useDataGrid/index.js.map +7 -0
- package/esm/useDataGrid/initColumnDefinition.js +78 -94
- package/esm/useDataGrid/initColumnDefinition.js.map +7 -0
- package/esm/useDataGrid/useDataGrid.js +82 -99
- package/esm/useDataGrid/useDataGrid.js.map +7 -0
- package/esm/useDataList/index.js +7 -1
- package/esm/useDataList/index.js.map +7 -0
- package/esm/useDataList/recordIterator.js +13 -14
- package/esm/useDataList/recordIterator.js.map +7 -0
- package/esm/useDataList/useDataList.js +44 -67
- package/esm/useDataList/useDataList.js.map +7 -0
- package/esm/utils.js +42 -59
- package/esm/utils.js.map +7 -0
- package/esm/virtualization/AutoHeightList.js +28 -40
- package/esm/virtualization/AutoHeightList.js.map +7 -0
- package/esm/virtualization/FluidHeightList.js +14 -38
- package/esm/virtualization/FluidHeightList.js.map +7 -0
- package/esm/virtualization/index.js +19 -16
- package/esm/virtualization/index.js.map +7 -0
- package/package.json +3 -3
- package/types/Animations/BaseAnimation.d.ts +1 -0
- package/types/Animations/Grow.d.ts +1 -0
- package/types/Animations/GrowRight.d.ts +1 -0
- package/types/CheckableGroup.d.ts +1 -0
- package/types/DeferRenderAfterComputation.d.ts +3 -2
- package/types/FocusGroup/FocusGrid.d.ts +5 -3
- package/types/FocusGroup/FocusGroup.d.ts +3 -1
- package/types/FocusGroup/FocusGroupContext.d.ts +3 -2
- package/types/FocusGroup/FocusGroupManager.d.ts +3 -1
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +3 -1
- package/types/FocusGroup/index.d.ts +6 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +3 -1
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +3 -1
- package/types/GroupContext/Group.d.ts +1 -0
- package/types/GroupContext/GroupItem.d.ts +1 -0
- package/types/GroupContext/index.d.ts +3 -3
- package/types/ScrollSync/ScrollSync.d.ts +4 -2
- package/types/ScrollSync/ScrollSyncPane.d.ts +2 -2
- package/types/ScrollSync/index.d.ts +2 -2
- package/types/ScrollSync/useScrollSync.d.ts +6 -5
- package/types/createDataInstance/createInstancePlugin.d.ts +2 -1
- package/types/createDataInstance/createInstanceRef.d.ts +3 -1
- package/types/dimsum.config.d.ts +3 -2
- package/types/index.d.ts +2 -2
- package/types/toolbar/ToolbarProvider.d.ts +3 -8
- package/types/useDataGrid/VolatileRowsListener.d.ts +3 -1
- package/types/useDataGrid/index.d.ts +1 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +2 -1
- package/types/useDataGrid/useDataGrid.d.ts +3 -2
- package/types/useDataList/index.d.ts +1 -1
- package/types/useDataList/useDataList.d.ts +3 -2
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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");
|
|
28
38
|
const defaultDecorators = {
|
|
29
39
|
instance: [],
|
|
30
40
|
state: [],
|
|
@@ -32,66 +42,51 @@ const defaultDecorators = {
|
|
|
32
42
|
renderers: [],
|
|
33
43
|
composeData: []
|
|
34
44
|
};
|
|
35
|
-
function createDataInstanceRef(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
46
|
-
const instance = React.useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
47
|
-
|
|
48
|
-
const [uuid$1] = React.useState(uuidProp || (() => uuid.v4()));
|
|
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)()));
|
|
49
55
|
instance.current = {
|
|
50
|
-
uuid
|
|
56
|
+
uuid,
|
|
51
57
|
state: {},
|
|
52
58
|
actions: {},
|
|
53
59
|
hotKeys: {},
|
|
54
|
-
// keyboard hotkeys to run specific actions
|
|
55
60
|
originalData: data,
|
|
56
61
|
records: [],
|
|
57
|
-
// item abstraction with meta data for originalData
|
|
58
62
|
renderers,
|
|
59
|
-
|
|
60
63
|
ref(key) {
|
|
61
|
-
|
|
62
|
-
return node => instance.current.refs[key] = node;
|
|
64
|
+
return (node) => instance.current.refs[key] = node;
|
|
63
65
|
},
|
|
64
|
-
|
|
65
66
|
getInstance() {
|
|
66
67
|
return instance.current;
|
|
67
68
|
},
|
|
68
|
-
|
|
69
69
|
props
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!plugin) return;
|
|
70
|
+
};
|
|
71
|
+
const decorators = (0, import_react.useMemo)(() => {
|
|
72
|
+
let nextDecorators = { ...defaultDecorators, ...customDecorators };
|
|
73
|
+
plugins.forEach((plugin) => {
|
|
74
|
+
if (!plugin)
|
|
75
|
+
return;
|
|
77
76
|
nextDecorators = plugin(nextDecorators);
|
|
78
77
|
});
|
|
79
|
-
Object.keys(nextDecorators).forEach(key => {
|
|
80
|
-
if (Array.isArray(nextDecorators[key]))
|
|
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
81
|
});
|
|
82
82
|
return nextDecorators;
|
|
83
|
-
}, []);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
instance.current = decorators.instance.reduce(utils.mergeInstance, instance.current);
|
|
88
|
-
instance.current = decorators.state.reduce(utils.registerStateHookToInstance, instance.current);
|
|
89
|
-
instance.current = decorators.hotKeys.reduce(utils.registerHotKeysHookToInstance, instance.current);
|
|
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);
|
|
90
87
|
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
91
|
-
return {
|
|
92
|
-
instance,
|
|
93
|
-
decorators
|
|
94
|
-
};
|
|
88
|
+
return { instance, decorators };
|
|
95
89
|
}
|
|
96
|
-
|
|
97
|
-
module.exports =
|
|
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
|
+
}
|
|
@@ -1,123 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let grid = arguments.length > 1 ? arguments[1] : undefined;
|
|
27
|
-
return function () {
|
|
28
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
29
|
-
let extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
|
-
let nextProps = props;
|
|
31
|
-
decorators.forEach(decorator => {
|
|
32
|
-
nextProps = decorator(nextProps, grid, extraParams);
|
|
33
|
-
});
|
|
34
|
-
return nextProps;
|
|
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);
|
|
35
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;
|
|
36
47
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
function evaluateTransforms(transforms, value) {
|
|
40
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41
|
-
let props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
42
|
-
let grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
48
|
+
function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
|
|
43
49
|
let nextProps = props;
|
|
44
|
-
transforms.forEach(transform => {
|
|
50
|
+
transforms.forEach((transform) => {
|
|
45
51
|
nextProps = transform(value, extraParams, nextProps, grid);
|
|
46
52
|
});
|
|
47
53
|
return nextProps;
|
|
48
54
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
function evaluateFormatters(formatters, value) {
|
|
52
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
53
|
-
let grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
55
|
+
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
54
56
|
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
55
57
|
}
|
|
56
|
-
function composeFormatters(formatters, instance) {
|
|
57
|
-
|
|
58
|
-
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
59
|
-
// todo: addd should formatter update to memoize specific ones
|
|
60
|
-
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
58
|
+
function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
|
|
59
|
+
return (props) => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
61
60
|
}
|
|
62
|
-
const applyDecorators =
|
|
63
|
-
let decorators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
64
|
-
|
|
65
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
66
|
-
args[_key - 2] = arguments[_key];
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
70
|
-
};
|
|
61
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
71
62
|
const decorateColumns = (columns, decorators, grid) => {
|
|
72
63
|
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
73
64
|
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
74
65
|
};
|
|
75
|
-
const mergeInstance = (instance, instanceHook) =>
|
|
66
|
+
const mergeInstance = (instance, instanceHook) => ({
|
|
67
|
+
...instance,
|
|
68
|
+
...instanceHook(instance)
|
|
69
|
+
});
|
|
76
70
|
const registerStateHookToInstance = (instance, stateHook) => {
|
|
77
|
-
const {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
key,
|
|
90
|
-
handler,
|
|
91
|
-
options,
|
|
92
|
-
allowDocumentHandler
|
|
93
|
-
} = _ref;
|
|
94
|
-
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
95
|
-
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
96
|
-
[key]: {
|
|
97
|
-
handler,
|
|
98
|
-
options,
|
|
99
|
-
allowDocumentHandler
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
});
|
|
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
|
+
};
|
|
103
83
|
};
|
|
104
|
-
|
|
84
|
+
const reduceHotKey = (instance, { key, handler, options, allowDocumentHandler }) => ({
|
|
85
|
+
...instance,
|
|
86
|
+
hotKeys: {
|
|
87
|
+
...instance.hotKeys,
|
|
88
|
+
[key]: { handler, options, allowDocumentHandler }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
105
91
|
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
106
92
|
const hotKeys = hotKeysHook(instance);
|
|
107
|
-
|
|
108
93
|
if (Array.isArray(hotKeys)) {
|
|
109
94
|
return hotKeys.reduce(reduceHotKey, instance);
|
|
110
95
|
}
|
|
111
|
-
|
|
112
96
|
return reduceHotKey(instance, hotKeys);
|
|
113
97
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
exports.composeFormatters = composeFormatters;
|
|
117
|
-
exports.decorateColumns = decorateColumns;
|
|
118
|
-
exports.evaluateFormatters = evaluateFormatters;
|
|
119
|
-
exports.evaluateTransforms = evaluateTransforms;
|
|
120
|
-
exports.mergeInstance = mergeInstance;
|
|
121
|
-
exports.reducePropsGetter = reducePropsGetter;
|
|
122
|
-
exports.registerHotKeysHookToInstance = registerHotKeysHookToInstance;
|
|
123
|
-
exports.registerStateHookToInstance = registerStateHookToInstance;
|
|
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
|
+
}
|
|
@@ -1,49 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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 defer_render_hoc_exports = {};
|
|
29
|
+
__export(defer_render_hoc_exports, {
|
|
30
|
+
default: () => defer_render_hoc_default,
|
|
31
|
+
deferComponentRender: () => deferComponentRender
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react = __toESM(require("react"));
|
|
35
|
+
var import_raf = __toESM(require("raf"));
|
|
36
|
+
var import_hoist_non_react_statics = __toESM(require("hoist-non-react-statics"));
|
|
37
|
+
const deferComponentRender = (WrappedComponent, fallback) => {
|
|
38
|
+
class DeferredRenderWrapper extends import_react.PureComponent {
|
|
26
39
|
constructor() {
|
|
27
40
|
super(...arguments);
|
|
28
|
-
this.state = {
|
|
29
|
-
shouldRender: false
|
|
30
|
-
};
|
|
41
|
+
this.state = { shouldRender: false };
|
|
31
42
|
}
|
|
32
|
-
|
|
33
43
|
componentDidMount() {
|
|
34
|
-
|
|
35
|
-
shouldRender: true
|
|
36
|
-
})));
|
|
44
|
+
(0, import_raf.default)(() => (0, import_raf.default)(() => this.setState({ shouldRender: true })));
|
|
37
45
|
}
|
|
38
|
-
|
|
39
46
|
render() {
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
return this.state.shouldRender ? /* @__PURE__ */ import_react.default.createElement(WrappedComponent, {
|
|
48
|
+
...this.props
|
|
49
|
+
}) : fallback;
|
|
42
50
|
}
|
|
43
|
-
|
|
44
51
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
52
|
+
return (0, import_hoist_non_react_statics.default)(DeferredRenderWrapper, WrappedComponent);
|
|
53
|
+
};
|
|
54
|
+
var defer_render_hoc_default = deferComponentRender;
|
|
55
|
+
module.exports = __toCommonJS(defer_render_hoc_exports);
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/defer-render-hoc/index.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import React, { PureComponent } from 'react';\nimport raf from 'raf';\nimport hoistNonReactStatic from 'hoist-non-react-statics';\n\n/**\n * Allows two animation frames to complete to allow other components to update\n * and re-render before mounting and rendering an expensive `WrappedComponent`.\n *\n * @param WrappedComponent\n * @param fallback\n */\nexport const deferComponentRender = (WrappedComponent, fallback) => {\n class DeferredRenderWrapper extends PureComponent {\n state = { shouldRender: false };\n\n componentDidMount() {\n raf(() => raf(() => this.setState({ shouldRender: true })));\n }\n\n render() {\n // eslint-disable-next-line react/destructuring-assignment\n return this.state.shouldRender ? (\n <WrappedComponent {...this.props} />\n ) : (\n fallback\n );\n }\n }\n\n return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);\n};\n\nexport default deferComponentRender;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAqC;AACrC,iBAAgB;AAChB,qCAAgC;AASzB,MAAM,uBAAuB,CAAC,kBAAkB,aAAa;AAClE,sCAAoC,2BAAc;AAAA,IAAlD,cAZF;AAYE;AACE,mBAAQ,EAAE,cAAc;AAAA;AAAA,IAExB,oBAAoB;AAClB,8BAAI,MAAM,wBAAI,MAAM,KAAK,SAAS,EAAE,cAAc;AAAA;AAAA,IAGpD,SAAS;AAEP,aAAO,KAAK,MAAM,eAChB,mDAAC,kBAAD;AAAA,WAAsB,KAAK;AAAA,WAE3B;AAAA;AAAA;AAKN,SAAO,4CAAoB,uBAAuB;AAAA;AAGpD,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/dimsum.config.js
CHANGED
|
@@ -1,7 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
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 });
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
|
|
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 dimsum_config_exports = {};
|
|
29
|
+
__export(dimsum_config_exports, {
|
|
30
|
+
default: () => dimsum_config_default,
|
|
31
|
+
dimsumConfig: () => dimsumConfig
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
const dimsumConfig = {
|
|
35
|
+
classNamePrefix: "em-ds"
|
|
36
|
+
};
|
|
37
|
+
var dimsum_config_default = dimsumConfig;
|
|
38
|
+
module.exports = __toCommonJS(dimsum_config_exports);
|
|
39
|
+
//# sourceMappingURL=dimsum.config.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/dimsum.config.ts", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["const dimsumConfig = {\n classNamePrefix: 'em-ds',\n};\n\nexport { dimsumConfig };\nexport default dimsumConfig;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,eAAe;AAAA,EACnB,iBAAiB;AAAA;AAInB,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,17 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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 src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
Group: () => import_GroupContext.Group,
|
|
31
|
+
GroupContext: () => import_GroupContext.GroupContext,
|
|
32
|
+
GroupItem: () => import_GroupContext.GroupItem,
|
|
33
|
+
ScrollSync: () => import_ScrollSync.ScrollSync,
|
|
34
|
+
ScrollSyncPane: () => import_ScrollSync.ScrollSyncPane
|
|
35
|
+
});
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_ScrollSync = require("./ScrollSync");
|
|
38
|
+
var import_GroupContext = require("./GroupContext");
|
|
39
|
+
module.exports = __toCommonJS(src_exports);
|
|
40
|
+
//# sourceMappingURL=index.js.map
|