@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,19 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
-
|
|
9
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
|
-
|
|
11
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
|
-
function getDecoratorsFromHooks(hooks, decorators) {
|
|
14
|
-
const nextDecorators = _objectSpread({}, decorators);
|
|
15
|
-
|
|
16
|
-
Object.keys(hooks).forEach(decorator => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const getDecoratorsFromHooks = (hooks, decorators) => {
|
|
3
|
+
const nextDecorators = { ...decorators };
|
|
4
|
+
Object.keys(hooks).forEach((decorator) => {
|
|
17
5
|
if (Array.isArray(decorators[decorator])) {
|
|
18
6
|
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
19
7
|
} else {
|
|
@@ -21,10 +9,11 @@ function getDecoratorsFromHooks(hooks, decorators) {
|
|
|
21
9
|
}
|
|
22
10
|
});
|
|
23
11
|
return nextDecorators;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
};
|
|
13
|
+
const createInstancePlugin = (name, hooks) => (decorators) => getDecoratorsFromHooks(hooks, decorators);
|
|
14
|
+
var createInstancePlugin_default = createInstancePlugin;
|
|
15
|
+
export {
|
|
16
|
+
createInstancePlugin,
|
|
17
|
+
createInstancePlugin_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=createInstancePlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstancePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA,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
|
+
}
|
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
11
|
-
import { v4 } from 'uuid';
|
|
12
|
-
import { useRef, useState, useMemo } from 'react';
|
|
13
|
-
import { orderBy } from 'lodash';
|
|
14
|
-
import { mergeInstance, registerStateHookToInstance, registerHotKeysHookToInstance } from './utils.js';
|
|
15
|
-
|
|
16
|
-
const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { v4 as uuidv4 } from "uuid";
|
|
3
|
+
import { useMemo, useRef, useState } from "react";
|
|
4
|
+
import { orderBy } from "lodash";
|
|
5
|
+
import {
|
|
6
|
+
mergeInstance,
|
|
7
|
+
registerHotKeysHookToInstance,
|
|
8
|
+
registerStateHookToInstance
|
|
9
|
+
} from "./utils";
|
|
21
10
|
const defaultDecorators = {
|
|
22
11
|
instance: [],
|
|
23
12
|
state: [],
|
|
@@ -25,66 +14,54 @@ const defaultDecorators = {
|
|
|
25
14
|
renderers: [],
|
|
26
15
|
composeData: []
|
|
27
16
|
};
|
|
28
|
-
function createDataInstanceRef(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
39
|
-
const instance = useRef(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
40
|
-
|
|
41
|
-
const [uuid] = useState(uuidProp || (() => v4()));
|
|
17
|
+
function createDataInstanceRef({
|
|
18
|
+
uuid: uuidProp,
|
|
19
|
+
data,
|
|
20
|
+
renderers,
|
|
21
|
+
plugins,
|
|
22
|
+
customDecorators,
|
|
23
|
+
...props
|
|
24
|
+
}) {
|
|
25
|
+
const instance = useRef();
|
|
26
|
+
const [uuid] = useState(uuidProp || (() => uuidv4()));
|
|
42
27
|
instance.current = {
|
|
43
28
|
uuid,
|
|
44
29
|
state: {},
|
|
45
30
|
actions: {},
|
|
46
31
|
hotKeys: {},
|
|
47
|
-
// keyboard hotkeys to run specific actions
|
|
48
32
|
originalData: data,
|
|
49
33
|
records: [],
|
|
50
|
-
// item abstraction with meta data for originalData
|
|
51
34
|
renderers,
|
|
52
|
-
|
|
53
35
|
ref(key) {
|
|
54
|
-
|
|
55
|
-
return node => instance.current.refs[key] = node;
|
|
36
|
+
return (node) => instance.current.refs[key] = node;
|
|
56
37
|
},
|
|
57
|
-
|
|
58
38
|
getInstance() {
|
|
59
39
|
return instance.current;
|
|
60
40
|
},
|
|
61
|
-
|
|
62
41
|
props
|
|
63
|
-
};
|
|
64
|
-
|
|
42
|
+
};
|
|
65
43
|
const decorators = useMemo(() => {
|
|
66
|
-
let nextDecorators =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
44
|
+
let nextDecorators = { ...defaultDecorators, ...customDecorators };
|
|
45
|
+
plugins.forEach((plugin) => {
|
|
46
|
+
if (!plugin)
|
|
47
|
+
return;
|
|
70
48
|
nextDecorators = plugin(nextDecorators);
|
|
71
49
|
});
|
|
72
|
-
Object.keys(nextDecorators).forEach(key => {
|
|
73
|
-
if (Array.isArray(nextDecorators[key]))
|
|
50
|
+
Object.keys(nextDecorators).forEach((key) => {
|
|
51
|
+
if (Array.isArray(nextDecorators[key]))
|
|
52
|
+
nextDecorators[key] = orderBy(nextDecorators[key], (item) => item.order);
|
|
74
53
|
});
|
|
75
54
|
return nextDecorators;
|
|
76
|
-
}, []);
|
|
77
|
-
// todo: test if getting the hooks without registering them
|
|
78
|
-
// here would be beneficial to memoize instance and squeeze performance
|
|
79
|
-
|
|
55
|
+
}, []);
|
|
80
56
|
instance.current = decorators.instance.reduce(mergeInstance, instance.current);
|
|
81
57
|
instance.current = decorators.state.reduce(registerStateHookToInstance, instance.current);
|
|
82
58
|
instance.current = decorators.hotKeys.reduce(registerHotKeysHookToInstance, instance.current);
|
|
83
59
|
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
84
|
-
return {
|
|
85
|
-
instance,
|
|
86
|
-
decorators
|
|
87
|
-
};
|
|
60
|
+
return { instance, decorators };
|
|
88
61
|
}
|
|
89
|
-
|
|
90
|
-
export {
|
|
62
|
+
var createInstanceRef_default = createDataInstanceRef;
|
|
63
|
+
export {
|
|
64
|
+
createDataInstanceRef,
|
|
65
|
+
createInstanceRef_default as default
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=createInstanceRef.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/createInstanceRef.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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;"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,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,SAAS,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,QAAQ,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,QACpB,eAAe,MACf,CAAC,SAAS,KAAK;AAAA;AAIrB,WAAO;AAAA,KACN;AAIH,WAAS,UAAU,WAAW,SAAS,OACrC,eACA,SAAS;AAEX,WAAS,UAAU,WAAW,MAAM,OAClC,6BACA,SAAS;AAEX,WAAS,UAAU,WAAW,QAAQ,OACpC,+BACA,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,107 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
10
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
11
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
const reducePropsGetter = function () {
|
|
17
|
-
let decorators = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
18
|
-
let grid = arguments.length > 1 ? arguments[1] : undefined;
|
|
19
|
-
return function () {
|
|
20
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
21
|
-
let extraParams = arguments.length > 1 ? arguments[1] : undefined;
|
|
22
|
-
let nextProps = props;
|
|
23
|
-
decorators.forEach(decorator => {
|
|
24
|
-
nextProps = decorator(nextProps, grid, extraParams);
|
|
25
|
-
});
|
|
26
|
-
return nextProps;
|
|
27
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const reducePropsGetter = (decorators = [], grid) => (props = {}, extraParams) => {
|
|
3
|
+
let nextProps = props;
|
|
4
|
+
decorators.forEach((decorator) => {
|
|
5
|
+
nextProps = decorator(nextProps, grid, extraParams);
|
|
6
|
+
});
|
|
7
|
+
return nextProps;
|
|
28
8
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function evaluateTransforms(transforms, value) {
|
|
32
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
33
|
-
let props = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
34
|
-
let grid = arguments.length > 4 ? arguments[4] : undefined;
|
|
9
|
+
function evaluateTransforms(transforms, value, extraParams = {}, props = {}, grid) {
|
|
35
10
|
let nextProps = props;
|
|
36
|
-
transforms.forEach(transform => {
|
|
11
|
+
transforms.forEach((transform) => {
|
|
37
12
|
nextProps = transform(value, extraParams, nextProps, grid);
|
|
38
13
|
});
|
|
39
14
|
return nextProps;
|
|
40
15
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function evaluateFormatters(formatters, value) {
|
|
44
|
-
let extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
45
|
-
let grid = arguments.length > 3 ? arguments[3] : undefined;
|
|
16
|
+
function evaluateFormatters(formatters, value, extraParams = {}, grid) {
|
|
46
17
|
return formatters.reduce((result, formatter) => formatter(result, extraParams, grid), value);
|
|
47
18
|
}
|
|
48
|
-
function composeFormatters(formatters, instance) {
|
|
49
|
-
|
|
50
|
-
// todo: make the formatters subscribe to the item props instead of getting the whole instance
|
|
51
|
-
// todo: addd should formatter update to memoize specific ones
|
|
52
|
-
return props => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
19
|
+
function composeFormatters(formatters, instance, getItemValue = (record) => record.data.name) {
|
|
20
|
+
return (props) => formatters.reduce((result, formatter) => formatter(result, props, instance), getItemValue(props.record));
|
|
53
21
|
}
|
|
54
|
-
const applyDecorators =
|
|
55
|
-
let decorators = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
56
|
-
|
|
57
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
58
|
-
args[_key - 2] = arguments[_key];
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
62
|
-
};
|
|
22
|
+
const applyDecorators = (subject, decorators = [], ...args) => decorators.reduce((nextSubject, decorator) => decorator(nextSubject, ...args), subject);
|
|
63
23
|
const decorateColumns = (columns, decorators, grid) => {
|
|
64
24
|
const nextColumns = applyDecorators(columns, decorators.decorateColumns, grid);
|
|
65
25
|
return nextColumns.map((column, index) => applyDecorators(column, decorators.decorateColumn, grid, index));
|
|
66
26
|
};
|
|
67
|
-
const mergeInstance = (instance, instanceHook) =>
|
|
27
|
+
const mergeInstance = (instance, instanceHook) => ({
|
|
28
|
+
...instance,
|
|
29
|
+
...instanceHook(instance)
|
|
30
|
+
});
|
|
68
31
|
const registerStateHookToInstance = (instance, stateHook) => {
|
|
69
|
-
const {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
key,
|
|
82
|
-
handler,
|
|
83
|
-
options,
|
|
84
|
-
allowDocumentHandler
|
|
85
|
-
} = _ref;
|
|
86
|
-
return _objectSpread(_objectSpread({}, instance), {}, {
|
|
87
|
-
hotKeys: _objectSpread(_objectSpread({}, instance.hotKeys), {}, {
|
|
88
|
-
[key]: {
|
|
89
|
-
handler,
|
|
90
|
-
options,
|
|
91
|
-
allowDocumentHandler
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
});
|
|
32
|
+
const { state, actions } = stateHook(instance);
|
|
33
|
+
return {
|
|
34
|
+
...instance,
|
|
35
|
+
state: {
|
|
36
|
+
...instance.state,
|
|
37
|
+
...state
|
|
38
|
+
},
|
|
39
|
+
actions: {
|
|
40
|
+
...instance.actions,
|
|
41
|
+
...actions
|
|
42
|
+
}
|
|
43
|
+
};
|
|
95
44
|
};
|
|
96
|
-
|
|
45
|
+
const reduceHotKey = (instance, { key, handler, options, allowDocumentHandler }) => ({
|
|
46
|
+
...instance,
|
|
47
|
+
hotKeys: {
|
|
48
|
+
...instance.hotKeys,
|
|
49
|
+
[key]: { handler, options, allowDocumentHandler }
|
|
50
|
+
}
|
|
51
|
+
});
|
|
97
52
|
const registerHotKeysHookToInstance = (instance, hotKeysHook) => {
|
|
98
53
|
const hotKeys = hotKeysHook(instance);
|
|
99
|
-
|
|
100
54
|
if (Array.isArray(hotKeys)) {
|
|
101
55
|
return hotKeys.reduce(reduceHotKey, instance);
|
|
102
56
|
}
|
|
103
|
-
|
|
104
57
|
return reduceHotKey(instance, hotKeys);
|
|
105
58
|
};
|
|
106
|
-
|
|
107
|
-
|
|
59
|
+
export {
|
|
60
|
+
applyDecorators,
|
|
61
|
+
composeFormatters,
|
|
62
|
+
decorateColumns,
|
|
63
|
+
evaluateFormatters,
|
|
64
|
+
evaluateTransforms,
|
|
65
|
+
mergeInstance,
|
|
66
|
+
reducePropsGetter,
|
|
67
|
+
registerHotKeysHookToInstance,
|
|
68
|
+
registerStateHookToInstance
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/createDataInstance/utils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAO,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,41 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
-
import { PureComponent } from 'react';
|
|
9
|
-
import raf from 'raf';
|
|
10
|
-
import hoistNonReactStatic from 'hoist-non-react-statics';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
-
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
-
function deferComponentRender(WrappedComponent, fallback) {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { PureComponent } from "react";
|
|
3
|
+
import raf from "raf";
|
|
4
|
+
import hoistNonReactStatic from "hoist-non-react-statics";
|
|
5
|
+
const deferComponentRender = (WrappedComponent, fallback) => {
|
|
17
6
|
class DeferredRenderWrapper extends PureComponent {
|
|
18
7
|
constructor() {
|
|
19
8
|
super(...arguments);
|
|
20
|
-
this.state = {
|
|
21
|
-
shouldRender: false
|
|
22
|
-
};
|
|
9
|
+
this.state = { shouldRender: false };
|
|
23
10
|
}
|
|
24
|
-
|
|
25
11
|
componentDidMount() {
|
|
26
|
-
raf(() => raf(() => this.setState({
|
|
27
|
-
shouldRender: true
|
|
28
|
-
})));
|
|
12
|
+
raf(() => raf(() => this.setState({ shouldRender: true })));
|
|
29
13
|
}
|
|
30
|
-
|
|
31
14
|
render() {
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
return this.state.shouldRender ? /* @__PURE__ */ React2.createElement(WrappedComponent, {
|
|
16
|
+
...this.props
|
|
17
|
+
}) : fallback;
|
|
34
18
|
}
|
|
35
|
-
|
|
36
19
|
}
|
|
37
|
-
|
|
38
20
|
return hoistNonReactStatic(DeferredRenderWrapper, WrappedComponent);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export {
|
|
21
|
+
};
|
|
22
|
+
var defer_render_hoc_default = deferComponentRender;
|
|
23
|
+
export {
|
|
24
|
+
defer_render_hoc_default as default,
|
|
25
|
+
deferComponentRender
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/defer-render-hoc/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AASO,MAAM,uBAAuB,CAAC,kBAAkB,aAAa;AAClE,sCAAoC,cAAc;AAAA,IAAlD,cAZF;AAYE;AACE,mBAAQ,EAAE,cAAc;AAAA;AAAA,IAExB,oBAAoB;AAClB,UAAI,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,cAAc;AAAA;AAAA,IAGpD,SAAS;AAEP,aAAO,KAAK,MAAM,eAChB,qCAAC,kBAAD;AAAA,WAAsB,KAAK;AAAA,WAE3B;AAAA;AAAA;AAKN,SAAO,oBAAoB,uBAAuB;AAAA;AAGpD,IAAO,2BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/dimsum.config.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const dimsumConfig = {
|
|
3
|
+
classNamePrefix: "em-ds"
|
|
3
4
|
};
|
|
4
|
-
|
|
5
|
-
export {
|
|
5
|
+
var dimsum_config_default = dimsumConfig;
|
|
6
|
+
export {
|
|
7
|
+
dimsum_config_default as default,
|
|
8
|
+
dimsumConfig
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=dimsum.config.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/dimsum.config.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "const dimsumConfig = {\n classNamePrefix: 'em-ds',\n};\n\nexport { dimsumConfig };\nexport default dimsumConfig;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA,MAAM,eAAe;AAAA,EACnB,iBAAiB;AAAA;AAInB,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ScrollSync, ScrollSyncPane } from "./ScrollSync";
|
|
3
|
+
import { Group, GroupContext, GroupItem } from "./GroupContext";
|
|
4
|
+
export {
|
|
5
|
+
Group,
|
|
6
|
+
GroupContext,
|
|
7
|
+
GroupItem,
|
|
8
|
+
ScrollSync,
|
|
9
|
+
ScrollSyncPane
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ScrollSync, ScrollSyncPane } from './ScrollSync';\nexport { Group, GroupContext, GroupItem } from './GroupContext';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/prop-types.js
CHANGED
|
@@ -1,43 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const dsBasicSizes = ["s", "m", "l"];
|
|
3
|
+
const sizes = ["xsmall", "small", "medium", "large", "xlarge"];
|
|
4
|
+
const iconSizes = [
|
|
5
|
+
"xxs",
|
|
6
|
+
"xs",
|
|
7
|
+
"s",
|
|
8
|
+
"m",
|
|
9
|
+
"l",
|
|
10
|
+
"xl",
|
|
11
|
+
"xxl"
|
|
12
|
+
];
|
|
13
|
+
const iconColors = [
|
|
14
|
+
["neutral", "900"],
|
|
15
|
+
["neutral", "0"],
|
|
16
|
+
["danger", "900"],
|
|
17
|
+
["warning", "500"],
|
|
18
|
+
["success", "900"],
|
|
19
|
+
["brand-primary", "600"]
|
|
20
|
+
];
|
|
5
21
|
const CHECKBOX_VARIANT = {
|
|
6
|
-
DEFAULT:
|
|
7
|
-
FOCUS:
|
|
8
|
-
ACTIVE:
|
|
9
|
-
DISABLED:
|
|
10
|
-
ERROR:
|
|
22
|
+
DEFAULT: "variant-default",
|
|
23
|
+
FOCUS: "variant-focus",
|
|
24
|
+
ACTIVE: "variant-active",
|
|
25
|
+
DISABLED: "variant-disabled",
|
|
26
|
+
ERROR: "variant-error"
|
|
11
27
|
};
|
|
12
|
-
const checkboxVariants = [
|
|
28
|
+
const checkboxVariants = [
|
|
29
|
+
CHECKBOX_VARIANT.DEFAULT,
|
|
30
|
+
CHECKBOX_VARIANT.FOCUS,
|
|
31
|
+
CHECKBOX_VARIANT.ACTIVE,
|
|
32
|
+
CHECKBOX_VARIANT.DISABLED,
|
|
33
|
+
CHECKBOX_VARIANT.ERROR
|
|
34
|
+
];
|
|
13
35
|
const COMBOBOX_VARIANT = {
|
|
14
|
-
DEFAULT:
|
|
15
|
-
FOCUS:
|
|
16
|
-
FOCUS_ICON:
|
|
17
|
-
ACTIVE:
|
|
18
|
-
ACTIVE_ICON:
|
|
19
|
-
DISABLED:
|
|
20
|
-
ERROR:
|
|
36
|
+
DEFAULT: "variant-default",
|
|
37
|
+
FOCUS: "variant-focus-input",
|
|
38
|
+
FOCUS_ICON: "variant-focus-icon",
|
|
39
|
+
ACTIVE: "variant-active-input",
|
|
40
|
+
ACTIVE_ICON: "variant-active-icon",
|
|
41
|
+
DISABLED: "variant-disabled",
|
|
42
|
+
ERROR: "variant-error"
|
|
21
43
|
};
|
|
22
|
-
const comboBoxVariants = [
|
|
44
|
+
const comboBoxVariants = [
|
|
45
|
+
COMBOBOX_VARIANT.DEFAULT,
|
|
46
|
+
COMBOBOX_VARIANT.FOCUS,
|
|
47
|
+
COMBOBOX_VARIANT.FOCUS_ICON,
|
|
48
|
+
COMBOBOX_VARIANT.ACTIVE,
|
|
49
|
+
COMBOBOX_VARIANT.ACTIVE_ICON,
|
|
50
|
+
COMBOBOX_VARIANT.DISABLED,
|
|
51
|
+
COMBOBOX_VARIANT.ERROR
|
|
52
|
+
];
|
|
23
53
|
const sizeVariants = {
|
|
24
|
-
S:
|
|
25
|
-
M:
|
|
26
|
-
L:
|
|
54
|
+
S: "s",
|
|
55
|
+
M: "m",
|
|
56
|
+
L: "l"
|
|
27
57
|
};
|
|
28
58
|
const position = {
|
|
29
|
-
LEFT:
|
|
30
|
-
RIGHT:
|
|
31
|
-
CENTER:
|
|
59
|
+
LEFT: "left",
|
|
60
|
+
RIGHT: "right",
|
|
61
|
+
CENTER: "center"
|
|
32
62
|
};
|
|
33
63
|
const fontColor = {
|
|
34
|
-
NEUTRAL500:
|
|
35
|
-
NEUTRAL700:
|
|
64
|
+
NEUTRAL500: "neutral500",
|
|
65
|
+
NEUTRAL700: "neutral700"
|
|
36
66
|
};
|
|
37
|
-
const orientation = [
|
|
67
|
+
const orientation = ["horizontal", "vertical"];
|
|
38
68
|
const orientationVariants = {
|
|
39
|
-
HORIZONTAL:
|
|
40
|
-
VERTICAL:
|
|
69
|
+
HORIZONTAL: "horizontal",
|
|
70
|
+
VERTICAL: "vertical"
|
|
41
71
|
};
|
|
42
|
-
|
|
43
|
-
|
|
72
|
+
export {
|
|
73
|
+
CHECKBOX_VARIANT,
|
|
74
|
+
COMBOBOX_VARIANT,
|
|
75
|
+
checkboxVariants,
|
|
76
|
+
comboBoxVariants,
|
|
77
|
+
dsBasicSizes,
|
|
78
|
+
fontColor,
|
|
79
|
+
iconColors,
|
|
80
|
+
iconSizes,
|
|
81
|
+
orientation,
|
|
82
|
+
orientationVariants,
|
|
83
|
+
position,
|
|
84
|
+
sizeVariants,
|
|
85
|
+
sizes
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const dsBasicSizes = ['s' as const, 'm' as const, 'l' as const];\n\nexport const sizes = ['xsmall' as const, 'small' as const, 'medium' as const, 'large' as const, 'xlarge' as const];\n\nexport const iconSizes = [\n 'xxs' as const,\n 'xs' as const,\n 's' as const,\n 'm' as const,\n 'l' as const,\n 'xl' as const,\n 'xxl' as const,\n];\n\nexport const iconColors = [\n ['neutral', '900'] as const,\n ['neutral', '0'] as const,\n ['danger', '900'] as const,\n ['warning', '500'] as const,\n ['success', '900'] as const,\n ['brand-primary', '600'] as const,\n] as const;\n\nexport const CHECKBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus' as const,\n ACTIVE: 'variant-active' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\nexport const checkboxVariants = [\n CHECKBOX_VARIANT.DEFAULT,\n CHECKBOX_VARIANT.FOCUS,\n CHECKBOX_VARIANT.ACTIVE,\n CHECKBOX_VARIANT.DISABLED,\n CHECKBOX_VARIANT.ERROR,\n] as const;\n\nexport const COMBOBOX_VARIANT = {\n DEFAULT: 'variant-default' as const,\n FOCUS: 'variant-focus-input' as const,\n FOCUS_ICON: 'variant-focus-icon' as const,\n ACTIVE: 'variant-active-input' as const,\n ACTIVE_ICON: 'variant-active-icon' as const,\n DISABLED: 'variant-disabled' as const,\n ERROR: 'variant-error' as const,\n};\n\nexport const comboBoxVariants = [\n COMBOBOX_VARIANT.DEFAULT,\n COMBOBOX_VARIANT.FOCUS,\n COMBOBOX_VARIANT.FOCUS_ICON,\n COMBOBOX_VARIANT.ACTIVE,\n COMBOBOX_VARIANT.ACTIVE_ICON,\n COMBOBOX_VARIANT.DISABLED,\n COMBOBOX_VARIANT.ERROR,\n] as const;\n\nexport const sizeVariants = {\n S: 's' as const,\n M: 'm' as const,\n L: 'l' as const,\n};\n\nexport const position = {\n LEFT: 'left' as const,\n RIGHT: 'right' as const,\n CENTER: 'center' as const,\n};\n\nexport const fontColor = {\n NEUTRAL500: 'neutral500' as const,\n NEUTRAL700: 'neutral700' as const,\n};\n\nexport const orientation = ['horizontal' as const, 'vertical' as const] as const;\n\nexport const orientationVariants = {\n HORIZONTAL: 'horizontal' as const,\n VERTICAL: 'vertical' as const,\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,eAAe,CAAC,KAAc,KAAc;AAElD,MAAM,QAAQ,CAAC,UAAmB,SAAkB,UAAmB,SAAkB;AAEzF,MAAM,YAAY;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAGK,MAAM,aAAa;AAAA,EACxB,CAAC,WAAW;AAAA,EACZ,CAAC,WAAW;AAAA,EACZ,CAAC,UAAU;AAAA,EACX,CAAC,WAAW;AAAA,EACZ,CAAC,WAAW;AAAA,EACZ,CAAC,iBAAiB;AAAA;AAGb,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA;AAEF,MAAM,mBAAmB;AAAA,EAC9B,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA;AAGZ,MAAM,mBAAmB;AAAA,EAC9B,SAAS;AAAA,EACT,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,UAAU;AAAA,EACV,OAAO;AAAA;AAGF,MAAM,mBAAmB;AAAA,EAC9B,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,iBAAiB;AAAA;AAGZ,MAAM,eAAe;AAAA,EAC1B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA;AAGE,MAAM,WAAW;AAAA,EACtB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA;AAGH,MAAM,YAAY;AAAA,EACvB,YAAY;AAAA,EACZ,YAAY;AAAA;AAGP,MAAM,cAAc,CAAC,cAAuB;AAE5C,MAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,UAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|