@elliemae/ds-shared 2.2.0-alpha.4 → 3.0.0-next.2
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 +35 -55
- package/cjs/Animations/Grow.js +41 -54
- package/cjs/Animations/GrowRight.js +41 -63
- package/cjs/Animations/GrowVertical.js +7 -47
- package/cjs/CheckableGroup.js +65 -67
- package/cjs/DeferRenderAfterComputation.js +24 -48
- package/cjs/FocusGroup/FocusGrid.js +143 -108
- package/cjs/FocusGroup/FocusGroup.js +147 -88
- package/cjs/FocusGroup/FocusGroupContext.js +11 -38
- package/cjs/FocusGroup/FocusGroupManager.js +47 -56
- package/cjs/FocusGroup/focusGroupManagerHoc.js +42 -52
- package/cjs/FocusGroup/index.js +21 -47
- package/cjs/FocusGroup/useFocusGroupItem.js +51 -59
- package/cjs/FocusGroup/utils/getNextCellPosition.js +27 -47
- package/cjs/GroupContext/Group.js +73 -64
- package/cjs/GroupContext/GroupContext.js +13 -36
- package/cjs/GroupContext/GroupItem.js +21 -39
- package/cjs/GroupContext/index.js +13 -39
- package/cjs/ScrollSync/ScrollSync.js +75 -60
- package/cjs/ScrollSync/ScrollSyncPane.js +60 -52
- package/cjs/ScrollSync/ScrollSyncProvider.js +50 -103
- package/cjs/ScrollSync/index.js +11 -37
- package/cjs/ScrollSync/useScrollSync.js +7 -38
- package/cjs/constants.js +46 -65
- package/cjs/createDataInstance/createInstancePlugin.js +29 -41
- package/cjs/createDataInstance/createInstanceRef.js +71 -66
- package/cjs/createDataInstance/utils.js +100 -76
- package/cjs/defer-render-hoc/index.js +41 -48
- package/cjs/dimsum.config.js +6 -38
- package/cjs/index.js +17 -40
- package/cjs/prop-types.js +49 -106
- package/cjs/react-spring/index.js +14 -28
- package/cjs/react-spring/renderprops.js +14 -28
- package/cjs/toolbar/ToolbarProvider.js +94 -82
- package/cjs/useDataGrid/VolatileRowsListener.js +13 -38
- package/cjs/useDataGrid/index.js +7 -36
- package/cjs/useDataGrid/initColumnDefinition.js +110 -105
- package/cjs/useDataGrid/useDataGrid.js +148 -122
- package/cjs/useDataList/index.js +7 -36
- package/cjs/useDataList/recordIterator.js +18 -42
- package/cjs/useDataList/useDataList.js +83 -74
- package/cjs/utils.js +80 -71
- package/cjs/virtualization/AutoHeightList.js +54 -62
- package/cjs/virtualization/FluidHeightList.js +48 -42
- package/cjs/virtualization/index.js +20 -48
- package/esm/Animations/BaseAnimation.js +29 -26
- package/esm/Animations/Grow.js +35 -25
- package/esm/Animations/GrowRight.js +35 -34
- package/esm/Animations/GrowVertical.js +4 -29
- package/esm/CheckableGroup.js +52 -35
- package/esm/DeferRenderAfterComputation.js +15 -16
- package/esm/FocusGroup/FocusGrid.js +117 -64
- package/esm/FocusGroup/FocusGroup.js +137 -56
- package/esm/FocusGroup/FocusGroupContext.js +5 -9
- package/esm/FocusGroup/FocusGroupManager.js +38 -24
- package/esm/FocusGroup/focusGroupManagerHoc.js +36 -24
- package/esm/FocusGroup/index.js +6 -18
- package/esm/FocusGroup/useFocusGroupItem.js +40 -28
- package/esm/FocusGroup/utils/getNextCellPosition.js +25 -18
- package/esm/GroupContext/Group.js +66 -34
- package/esm/GroupContext/GroupContext.js +5 -7
- package/esm/GroupContext/GroupItem.js +15 -10
- package/esm/GroupContext/index.js +3 -10
- package/esm/ScrollSync/ScrollSync.js +64 -30
- package/esm/ScrollSync/ScrollSyncPane.js +52 -22
- package/esm/ScrollSync/ScrollSyncProvider.js +42 -74
- package/esm/ScrollSync/index.js +2 -8
- package/esm/ScrollSync/useScrollSync.js +5 -9
- package/esm/constants.js +28 -37
- package/esm/createDataInstance/createInstancePlugin.js +23 -12
- package/esm/createDataInstance/createInstanceRef.js +59 -36
- package/esm/createDataInstance/utils.js +85 -48
- package/esm/defer-render-hoc/index.js +31 -17
- package/esm/dimsum.config.js +4 -9
- package/esm/index.js +5 -11
- package/esm/prop-types.js +31 -75
- package/esm/react-spring/index.js +1 -3
- package/esm/react-spring/renderprops.js +1 -3
- package/esm/toolbar/ToolbarProvider.js +74 -45
- package/esm/useDataGrid/VolatileRowsListener.js +11 -9
- package/esm/useDataGrid/index.js +1 -7
- package/esm/useDataGrid/initColumnDefinition.js +94 -78
- package/esm/useDataGrid/useDataGrid.js +99 -82
- package/esm/useDataList/index.js +1 -7
- package/esm/useDataList/recordIterator.js +14 -13
- package/esm/useDataList/useDataList.js +67 -44
- package/esm/utils.js +59 -42
- package/esm/virtualization/AutoHeightList.js +40 -28
- package/esm/virtualization/FluidHeightList.js +38 -14
- package/esm/virtualization/index.js +16 -19
- package/package.json +3 -3
- package/types/Animations/BaseAnimation.d.ts +0 -1
- package/types/Animations/Grow.d.ts +0 -1
- package/types/Animations/GrowRight.d.ts +0 -1
- package/types/CheckableGroup.d.ts +0 -1
- package/types/DeferRenderAfterComputation.d.ts +2 -3
- package/types/FocusGroup/FocusGrid.d.ts +3 -5
- package/types/FocusGroup/FocusGroup.d.ts +1 -3
- package/types/FocusGroup/FocusGroupContext.d.ts +2 -3
- package/types/FocusGroup/FocusGroupManager.d.ts +1 -3
- package/types/FocusGroup/focusGroupManagerHoc.d.ts +1 -3
- package/types/FocusGroup/index.d.ts +6 -6
- package/types/FocusGroup/useFocusGroupItem.d.ts +1 -3
- package/types/FocusGroup/utils/getNextCellPosition.d.ts +1 -3
- package/types/GroupContext/Group.d.ts +0 -1
- package/types/GroupContext/GroupItem.d.ts +0 -1
- package/types/GroupContext/index.d.ts +3 -3
- package/types/ScrollSync/ScrollSync.d.ts +2 -4
- package/types/ScrollSync/ScrollSyncPane.d.ts +2 -2
- package/types/ScrollSync/index.d.ts +2 -2
- package/types/ScrollSync/useScrollSync.d.ts +5 -6
- package/types/createDataInstance/createInstancePlugin.d.ts +1 -2
- package/types/createDataInstance/createInstanceRef.d.ts +1 -3
- package/types/dimsum.config.d.ts +2 -3
- package/types/index.d.ts +2 -2
- package/types/toolbar/ToolbarProvider.d.ts +8 -3
- package/types/useDataGrid/VolatileRowsListener.d.ts +1 -3
- package/types/useDataGrid/index.d.ts +1 -1
- package/types/useDataGrid/initColumnDefinition.d.ts +1 -2
- package/types/useDataGrid/useDataGrid.d.ts +2 -3
- package/types/useDataList/index.d.ts +1 -1
- package/types/useDataList/useDataList.d.ts +2 -3
- package/cjs/Animations/BaseAnimation.js.map +0 -7
- package/cjs/Animations/Grow.js.map +0 -7
- package/cjs/Animations/GrowRight.js.map +0 -7
- package/cjs/Animations/GrowVertical.js.map +0 -7
- package/cjs/CheckableGroup.js.map +0 -7
- package/cjs/DeferRenderAfterComputation.js.map +0 -7
- package/cjs/FocusGroup/FocusGrid.js.map +0 -7
- package/cjs/FocusGroup/FocusGroup.js.map +0 -7
- package/cjs/FocusGroup/FocusGroupContext.js.map +0 -7
- package/cjs/FocusGroup/FocusGroupManager.js.map +0 -7
- package/cjs/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/cjs/FocusGroup/index.js.map +0 -7
- package/cjs/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/cjs/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/cjs/GroupContext/Group.js.map +0 -7
- package/cjs/GroupContext/GroupContext.js.map +0 -7
- package/cjs/GroupContext/GroupItem.js.map +0 -7
- package/cjs/GroupContext/index.js.map +0 -7
- package/cjs/ScrollSync/ScrollSync.js.map +0 -7
- package/cjs/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/cjs/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/cjs/ScrollSync/index.js.map +0 -7
- package/cjs/ScrollSync/useScrollSync.js.map +0 -7
- package/cjs/constants.js.map +0 -7
- package/cjs/createDataInstance/createInstancePlugin.js.map +0 -7
- package/cjs/createDataInstance/createInstanceRef.js.map +0 -7
- package/cjs/createDataInstance/utils.js.map +0 -7
- package/cjs/defer-render-hoc/index.js.map +0 -7
- package/cjs/dimsum.config.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/prop-types.js.map +0 -7
- package/cjs/react-spring/index.js.map +0 -7
- package/cjs/react-spring/renderprops.js.map +0 -7
- package/cjs/toolbar/ToolbarProvider.js.map +0 -7
- package/cjs/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/cjs/useDataGrid/index.js.map +0 -7
- package/cjs/useDataGrid/initColumnDefinition.js.map +0 -7
- package/cjs/useDataGrid/useDataGrid.js.map +0 -7
- package/cjs/useDataList/index.js.map +0 -7
- package/cjs/useDataList/recordIterator.js.map +0 -7
- package/cjs/useDataList/useDataList.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/cjs/virtualization/AutoHeightList.js.map +0 -7
- package/cjs/virtualization/FluidHeightList.js.map +0 -7
- package/cjs/virtualization/index.js.map +0 -7
- package/esm/Animations/BaseAnimation.js.map +0 -7
- package/esm/Animations/Grow.js.map +0 -7
- package/esm/Animations/GrowRight.js.map +0 -7
- package/esm/Animations/GrowVertical.js.map +0 -7
- package/esm/CheckableGroup.js.map +0 -7
- package/esm/DeferRenderAfterComputation.js.map +0 -7
- package/esm/FocusGroup/FocusGrid.js.map +0 -7
- package/esm/FocusGroup/FocusGroup.js.map +0 -7
- package/esm/FocusGroup/FocusGroupContext.js.map +0 -7
- package/esm/FocusGroup/FocusGroupManager.js.map +0 -7
- package/esm/FocusGroup/focusGroupManagerHoc.js.map +0 -7
- package/esm/FocusGroup/index.js.map +0 -7
- package/esm/FocusGroup/useFocusGroupItem.js.map +0 -7
- package/esm/FocusGroup/utils/getNextCellPosition.js.map +0 -7
- package/esm/GroupContext/Group.js.map +0 -7
- package/esm/GroupContext/GroupContext.js.map +0 -7
- package/esm/GroupContext/GroupItem.js.map +0 -7
- package/esm/GroupContext/index.js.map +0 -7
- package/esm/ScrollSync/ScrollSync.js.map +0 -7
- package/esm/ScrollSync/ScrollSyncPane.js.map +0 -7
- package/esm/ScrollSync/ScrollSyncProvider.js.map +0 -7
- package/esm/ScrollSync/index.js.map +0 -7
- package/esm/ScrollSync/useScrollSync.js.map +0 -7
- package/esm/constants.js.map +0 -7
- package/esm/createDataInstance/createInstancePlugin.js.map +0 -7
- package/esm/createDataInstance/createInstanceRef.js.map +0 -7
- package/esm/createDataInstance/utils.js.map +0 -7
- package/esm/defer-render-hoc/index.js.map +0 -7
- package/esm/dimsum.config.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/prop-types.js.map +0 -7
- package/esm/react-spring/index.js.map +0 -7
- package/esm/react-spring/renderprops.js.map +0 -7
- package/esm/toolbar/ToolbarProvider.js.map +0 -7
- package/esm/useDataGrid/VolatileRowsListener.js.map +0 -7
- package/esm/useDataGrid/index.js.map +0 -7
- package/esm/useDataGrid/initColumnDefinition.js.map +0 -7
- package/esm/useDataGrid/useDataGrid.js.map +0 -7
- package/esm/useDataList/index.js.map +0 -7
- package/esm/useDataList/recordIterator.js.map +0 -7
- package/esm/useDataList/useDataList.js.map +0 -7
- package/esm/utils.js.map +0 -7
- package/esm/virtualization/AutoHeightList.js.map +0 -7
- package/esm/virtualization/FluidHeightList.js.map +0 -7
- package/esm/virtualization/index.js.map +0 -7
package/cjs/ScrollSync/index.js
CHANGED
|
@@ -1,37 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var ScrollSync = require('./ScrollSync.js');
|
|
6
|
+
var ScrollSyncPane = require('./ScrollSyncPane.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.ScrollSync = ScrollSync["default"];
|
|
11
|
+
exports.ScrollSyncPane = ScrollSyncPane;
|
|
@@ -1,41 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function useScrollSync(props) {
|
|
35
4
|
return {};
|
|
36
|
-
}
|
|
5
|
+
}
|
|
6
|
+
|
|
37
7
|
useScrollSync.propTypes = {};
|
|
38
8
|
useScrollSync.defaultProps = {};
|
|
39
|
-
|
|
40
|
-
module.exports =
|
|
41
|
-
//# sourceMappingURL=useScrollSync.js.map
|
|
9
|
+
|
|
10
|
+
module.exports = useScrollSync;
|
package/cjs/constants.js
CHANGED
|
@@ -1,70 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const DEFAULT_DELAY_OPEN = 200;
|
|
6
|
+
const DEFAULT_DELAY_CLOSE = 300;
|
|
7
|
+
const sizeOptions = ['small', 'medium', 'large', 'x-large'];
|
|
8
|
+
const AM = 'am';
|
|
9
|
+
const PM = 'pm';
|
|
10
|
+
const ARROW_UP = 'ArrowUp';
|
|
11
|
+
const ARROW_DOWN = 'ArrowDown';
|
|
12
|
+
const BACKSPACE = 'Backspace';
|
|
13
|
+
const ESCAPE = 'Escape';
|
|
14
|
+
const HOME = 'Home';
|
|
15
|
+
const SHIFT = 'Shift';
|
|
16
|
+
const END = 'End';
|
|
17
|
+
const HOUR_RANGE_12 = {
|
|
18
|
+
min: 0,
|
|
19
|
+
max: 12
|
|
11
20
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
21
|
+
const HOUR_RANGE_24 = {
|
|
22
|
+
min: 0,
|
|
23
|
+
max: 24
|
|
19
24
|
};
|
|
20
|
-
|
|
21
|
-
|
|
25
|
+
const GENERAL_TIME_RANGE = {
|
|
26
|
+
min: 0,
|
|
27
|
+
max: 59
|
|
22
28
|
};
|
|
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
29
|
const PLACEHOLDER_TIME = {
|
|
64
|
-
hour:
|
|
65
|
-
minutes:
|
|
66
|
-
seconds:
|
|
67
|
-
meridiem:
|
|
30
|
+
hour: 'hour',
|
|
31
|
+
minutes: 'minutes',
|
|
32
|
+
seconds: 'seconds',
|
|
33
|
+
meridiem: 'meridiem'
|
|
68
34
|
};
|
|
69
|
-
|
|
70
|
-
|
|
35
|
+
|
|
36
|
+
exports.AM = AM;
|
|
37
|
+
exports.ARROW_DOWN = ARROW_DOWN;
|
|
38
|
+
exports.ARROW_UP = ARROW_UP;
|
|
39
|
+
exports.BACKSPACE = BACKSPACE;
|
|
40
|
+
exports.DEFAULT_DELAY_CLOSE = DEFAULT_DELAY_CLOSE;
|
|
41
|
+
exports.DEFAULT_DELAY_OPEN = DEFAULT_DELAY_OPEN;
|
|
42
|
+
exports.END = END;
|
|
43
|
+
exports.ESCAPE = ESCAPE;
|
|
44
|
+
exports.GENERAL_TIME_RANGE = GENERAL_TIME_RANGE;
|
|
45
|
+
exports.HOME = HOME;
|
|
46
|
+
exports.HOUR_RANGE_12 = HOUR_RANGE_12;
|
|
47
|
+
exports.HOUR_RANGE_24 = HOUR_RANGE_24;
|
|
48
|
+
exports.PLACEHOLDER_TIME = PLACEHOLDER_TIME;
|
|
49
|
+
exports.PM = PM;
|
|
50
|
+
exports.SHIFT = SHIFT;
|
|
51
|
+
exports.sizeOptions = sizeOptions;
|
|
@@ -1,39 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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) => {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
14
|
+
|
|
15
|
+
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; }
|
|
16
|
+
|
|
17
|
+
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__default["default"](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; }
|
|
18
|
+
|
|
19
|
+
function getDecoratorsFromHooks(hooks, decorators) {
|
|
20
|
+
const nextDecorators = _objectSpread({}, decorators);
|
|
21
|
+
|
|
22
|
+
Object.keys(hooks).forEach(decorator => {
|
|
37
23
|
if (Array.isArray(decorators[decorator])) {
|
|
38
24
|
nextDecorators[decorator] = [...decorators[decorator], hooks[decorator]];
|
|
39
25
|
} else {
|
|
@@ -41,8 +27,10 @@ const getDecoratorsFromHooks = (hooks, decorators) => {
|
|
|
41
27
|
}
|
|
42
28
|
});
|
|
43
29
|
return nextDecorators;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function createInstancePlugin(name, hooks) {
|
|
33
|
+
return decorators => getDecoratorsFromHooks(hooks, decorators);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = createInstancePlugin;
|
|
@@ -1,40 +1,30 @@
|
|
|
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
|
-
})(
|
|
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");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.async-iterator.reduce.js');
|
|
10
|
+
require('core-js/modules/esnext.iterator.reduce.js');
|
|
11
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
12
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
13
|
+
var uuid = require('uuid');
|
|
14
|
+
var React = require('react');
|
|
15
|
+
var lodash = require('lodash');
|
|
16
|
+
var utils = require('./utils.js');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
22
|
+
|
|
23
|
+
const _excluded = ["uuid", "data", "renderers", "plugins", "customDecorators"];
|
|
24
|
+
|
|
25
|
+
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; }
|
|
26
|
+
|
|
27
|
+
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__default["default"](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; }
|
|
38
28
|
const defaultDecorators = {
|
|
39
29
|
instance: [],
|
|
40
30
|
state: [],
|
|
@@ -42,51 +32,66 @@ const defaultDecorators = {
|
|
|
42
32
|
renderers: [],
|
|
43
33
|
composeData: []
|
|
44
34
|
};
|
|
45
|
-
function createDataInstanceRef({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
function createDataInstanceRef(_ref) {
|
|
36
|
+
let {
|
|
37
|
+
uuid: uuidProp,
|
|
38
|
+
data,
|
|
39
|
+
renderers,
|
|
40
|
+
plugins,
|
|
41
|
+
customDecorators
|
|
42
|
+
} = _ref,
|
|
43
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
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()));
|
|
55
49
|
instance.current = {
|
|
56
|
-
uuid,
|
|
50
|
+
uuid: uuid$1,
|
|
57
51
|
state: {},
|
|
58
52
|
actions: {},
|
|
59
53
|
hotKeys: {},
|
|
54
|
+
// keyboard hotkeys to run specific actions
|
|
60
55
|
originalData: data,
|
|
61
56
|
records: [],
|
|
57
|
+
// item abstraction with meta data for originalData
|
|
62
58
|
renderers,
|
|
59
|
+
|
|
63
60
|
ref(key) {
|
|
64
|
-
|
|
61
|
+
// eslint-disable-next-line no-return-assign
|
|
62
|
+
return node => instance.current.refs[key] = node;
|
|
65
63
|
},
|
|
64
|
+
|
|
66
65
|
getInstance() {
|
|
67
66
|
return instance.current;
|
|
68
67
|
},
|
|
68
|
+
|
|
69
69
|
props
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
}; // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
71
|
+
|
|
72
|
+
const decorators = React.useMemo(() => {
|
|
73
|
+
let nextDecorators = _objectSpread(_objectSpread({}, defaultDecorators), customDecorators);
|
|
74
|
+
|
|
75
|
+
plugins.forEach(plugin => {
|
|
76
|
+
if (!plugin) return;
|
|
76
77
|
nextDecorators = plugin(nextDecorators);
|
|
77
78
|
});
|
|
78
|
-
Object.keys(nextDecorators).forEach(
|
|
79
|
-
if (Array.isArray(nextDecorators[key]))
|
|
80
|
-
nextDecorators[key] = (0, import_lodash.orderBy)(nextDecorators[key], (item) => item.order);
|
|
79
|
+
Object.keys(nextDecorators).forEach(key => {
|
|
80
|
+
if (Array.isArray(nextDecorators[key])) nextDecorators[key] = lodash.orderBy(nextDecorators[key], item => item.order);
|
|
81
81
|
});
|
|
82
82
|
return nextDecorators;
|
|
83
|
-
}, []);
|
|
84
|
-
|
|
85
|
-
instance
|
|
86
|
-
|
|
83
|
+
}, []); // the plugins are defined on creation, but not changed at runtime
|
|
84
|
+
// todo: test if getting the hooks without registering them
|
|
85
|
+
// here would be beneficial to memoize instance and squeeze performance
|
|
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);
|
|
87
90
|
instance.current.renderers = decorators.renderers.reduce((result, decorator) => decorator(result, instance.current), renderers);
|
|
88
|
-
return {
|
|
91
|
+
return {
|
|
92
|
+
instance,
|
|
93
|
+
decorators
|
|
94
|
+
};
|
|
89
95
|
}
|
|
90
|
-
|
|
91
|
-
module.exports =
|
|
92
|
-
//# sourceMappingURL=createInstanceRef.js.map
|
|
96
|
+
|
|
97
|
+
module.exports = createDataInstanceRef;
|