@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
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
10
|
+
require('react');
|
|
11
|
+
var FocusGroupManager = require('./FocusGroupManager.js');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
18
|
+
|
|
19
|
+
const _excluded = ["onExitFocusGroup", "onFocusPrevGroup", "focusKeyBindings"];
|
|
20
|
+
|
|
21
|
+
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; }
|
|
22
|
+
|
|
23
|
+
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; }
|
|
24
|
+
function FocusGroupHoc(WrappedComponent) {
|
|
25
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
26
|
+
return _ref => {
|
|
27
|
+
let {
|
|
28
|
+
onExitFocusGroup,
|
|
29
|
+
onFocusPrevGroup,
|
|
30
|
+
focusKeyBindings
|
|
31
|
+
} = _ref,
|
|
32
|
+
props = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/jsxRuntime.jsx(FocusGroupManager, _objectSpread(_objectSpread({
|
|
35
|
+
keyBindings: focusKeyBindings,
|
|
36
|
+
onExitFocusGroup: onExitFocusGroup,
|
|
37
|
+
onFocusPrevGroup: onFocusPrevGroup
|
|
38
|
+
}, options), {}, {
|
|
39
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, _objectSpread(_objectSpread({}, props), options))
|
|
40
|
+
}));
|
|
26
41
|
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var focusGroupManagerHoc_exports = {};
|
|
29
|
-
__export(focusGroupManagerHoc_exports, {
|
|
30
|
-
FocusGroupHoc: () => FocusGroupHoc,
|
|
31
|
-
default: () => focusGroupManagerHoc_default
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_FocusGroupManager = require("./FocusGroupManager");
|
|
36
|
-
function FocusGroupHoc(WrappedComponent, options = {}) {
|
|
37
|
-
return ({
|
|
38
|
-
onExitFocusGroup,
|
|
39
|
-
onFocusPrevGroup,
|
|
40
|
-
focusKeyBindings,
|
|
41
|
-
...props
|
|
42
|
-
}) => /* @__PURE__ */ import_react.default.createElement(import_FocusGroupManager.FocusGroupProvider, {
|
|
43
|
-
keyBindings: focusKeyBindings,
|
|
44
|
-
onExitFocusGroup,
|
|
45
|
-
onFocusPrevGroup,
|
|
46
|
-
...options
|
|
47
|
-
}, /* @__PURE__ */ import_react.default.createElement(WrappedComponent, {
|
|
48
|
-
...props,
|
|
49
|
-
...options
|
|
50
|
-
}));
|
|
51
42
|
}
|
|
52
|
-
|
|
53
|
-
module.exports =
|
|
54
|
-
//# sourceMappingURL=focusGroupManagerHoc.js.map
|
|
43
|
+
|
|
44
|
+
module.exports = FocusGroupHoc;
|
package/cjs/FocusGroup/index.js
CHANGED
|
@@ -1,47 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
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 FocusGroup_exports = {};
|
|
29
|
-
__export(FocusGroup_exports, {
|
|
30
|
-
FocusGrid: () => import_FocusGrid.FocusGridProvider,
|
|
31
|
-
FocusGridContext: () => import_FocusGrid.FocusGridContext,
|
|
32
|
-
FocusGroup: () => import_FocusGroup.FocusGroup,
|
|
33
|
-
FocusGroupContext: () => import_FocusGroupContext.FocusGroupContext,
|
|
34
|
-
FocusGroupManager: () => import_FocusGroupManager.FocusGroupManager,
|
|
35
|
-
focusGroupManagerHoc: () => import_focusGroupManagerHoc.FocusGroupHoc,
|
|
36
|
-
useFocusGroupItem: () => import_useFocusGroupItem.useFocusGroupItem,
|
|
37
|
-
useFocusGroupWithState: () => import_useFocusGroupItem.useFocusGroupWithState
|
|
38
|
-
});
|
|
39
|
-
var React = __toESM(require("react"));
|
|
40
|
-
var import_FocusGroup = require("./FocusGroup");
|
|
41
|
-
var import_FocusGroupContext = require("./FocusGroupContext");
|
|
42
|
-
var import_FocusGroupManager = require("./FocusGroupManager");
|
|
43
|
-
var import_useFocusGroupItem = require("./useFocusGroupItem");
|
|
44
|
-
var import_focusGroupManagerHoc = require("./focusGroupManagerHoc");
|
|
45
|
-
var import_FocusGrid = require("./FocusGrid");
|
|
46
|
-
module.exports = __toCommonJS(FocusGroup_exports);
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var FocusGroup = require('./FocusGroup.js');
|
|
6
|
+
var FocusGroupContext = require('./FocusGroupContext.js');
|
|
7
|
+
var FocusGroupManager = require('./FocusGroupManager.js');
|
|
8
|
+
var useFocusGroupItem = require('./useFocusGroupItem.js');
|
|
9
|
+
var focusGroupManagerHoc = require('./focusGroupManagerHoc.js');
|
|
10
|
+
var FocusGrid = require('./FocusGrid.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.FocusGroup = FocusGroup;
|
|
15
|
+
exports.FocusGroupContext = FocusGroupContext;
|
|
16
|
+
exports.FocusGroupManager = FocusGroupManager;
|
|
17
|
+
exports.useFocusGroupItem = useFocusGroupItem["default"];
|
|
18
|
+
exports.useFocusGroupWithState = useFocusGroupItem.useFocusGroupWithState;
|
|
19
|
+
exports.focusGroupManagerHoc = focusGroupManagerHoc;
|
|
20
|
+
exports.FocusGrid = FocusGrid["default"];
|
|
21
|
+
exports.FocusGridContext = FocusGrid.FocusGridContext;
|
|
@@ -1,67 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var useFocusGroupItem_exports = {};
|
|
29
|
-
__export(useFocusGroupItem_exports, {
|
|
30
|
-
default: () => useFocusGroupItem_default,
|
|
31
|
-
useFocusGroupItem: () => useFocusGroupItem,
|
|
32
|
-
useFocusGroupWithState: () => useFocusGroupWithState
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = require("react");
|
|
36
|
-
var import_FocusGroupContext = require("./FocusGroupContext");
|
|
37
|
-
function useFocusGroupItem(ref = {}, props) {
|
|
38
|
-
const { register, unregister, ...otherActions } = (0, import_react.useContext)(import_FocusGroupContext.FocusGroupContext) || {};
|
|
39
|
-
(0, import_react.useEffect)(() => {
|
|
40
|
-
if (ref.current && register)
|
|
41
|
-
register(ref.current, props);
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var FocusGroupContext = require('./FocusGroupContext.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
12
|
+
|
|
13
|
+
const _excluded = ["register", "unregister"],
|
|
14
|
+
_excluded2 = ["register", "unregister"];
|
|
15
|
+
function useFocusGroupItem() {
|
|
16
|
+
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
|
+
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
18
|
+
|
|
19
|
+
const _ref = React.useContext(FocusGroupContext) || {},
|
|
20
|
+
{
|
|
21
|
+
register,
|
|
22
|
+
unregister
|
|
23
|
+
} = _ref,
|
|
24
|
+
otherActions = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
25
|
+
|
|
26
|
+
React.useEffect(() => {
|
|
27
|
+
if (ref.current && register) register(ref.current, props);
|
|
42
28
|
return () => {
|
|
43
|
-
if (ref.current && unregister)
|
|
44
|
-
unregister(ref.current);
|
|
29
|
+
if (ref.current && unregister) unregister(ref.current);
|
|
45
30
|
};
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
}); // if the focus item is not wrapped with the focus provider then return null
|
|
32
|
+
|
|
33
|
+
if (!register) return {};
|
|
49
34
|
return otherActions;
|
|
50
35
|
}
|
|
51
|
-
const useFocusGroupWithState = (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
36
|
+
const useFocusGroupWithState = function () {
|
|
37
|
+
let ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38
|
+
let props = arguments.length > 1 ? arguments[1] : undefined;
|
|
39
|
+
|
|
40
|
+
const _ref2 = React.useContext(FocusGroupContext) || {},
|
|
41
|
+
{
|
|
42
|
+
register,
|
|
43
|
+
unregister
|
|
44
|
+
} = _ref2,
|
|
45
|
+
otherActions = _objectWithoutProperties__default["default"](_ref2, _excluded2);
|
|
46
|
+
|
|
47
|
+
React.useEffect(() => {
|
|
48
|
+
if (ref && register) register(ref, props);
|
|
56
49
|
return () => {
|
|
57
|
-
if (ref && unregister)
|
|
58
|
-
unregister(ref);
|
|
50
|
+
if (ref && unregister) unregister(ref);
|
|
59
51
|
};
|
|
60
|
-
}, [ref]);
|
|
61
|
-
|
|
62
|
-
|
|
52
|
+
}, [ref]); // if the focus item is not wrapped with the focus provider then return null
|
|
53
|
+
|
|
54
|
+
if (!register) return {};
|
|
63
55
|
return otherActions;
|
|
64
56
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
|
|
58
|
+
exports["default"] = useFocusGroupItem;
|
|
59
|
+
exports.useFocusGroupWithState = useFocusGroupWithState;
|
|
@@ -1,67 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 getNextCellPosition_exports = {};
|
|
29
|
-
__export(getNextCellPosition_exports, {
|
|
30
|
-
default: () => getNextCellPosition_default,
|
|
31
|
-
getNextCellPosition: () => getNextCellPosition
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
function getNextCellPosition({
|
|
35
|
-
grid,
|
|
36
|
-
currentRow = 0,
|
|
37
|
-
currentCell = 0,
|
|
38
|
-
directionY,
|
|
39
|
-
directionX,
|
|
40
|
-
shouldWrapCells,
|
|
41
|
-
shouldWrapRows
|
|
42
|
-
}) {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line max-statements
|
|
4
|
+
function getNextCellPosition(_ref) {
|
|
5
|
+
let {
|
|
6
|
+
grid,
|
|
7
|
+
currentRow = 0,
|
|
8
|
+
currentCell = 0,
|
|
9
|
+
directionY,
|
|
10
|
+
directionX,
|
|
11
|
+
shouldWrapCells,
|
|
12
|
+
shouldWrapRows
|
|
13
|
+
} = _ref;
|
|
43
14
|
let nextRow = currentRow + directionY;
|
|
44
15
|
let nextCell = currentCell + directionX;
|
|
45
16
|
const rowCount = grid.length;
|
|
46
17
|
const isLeftRight = directionX !== 0;
|
|
18
|
+
|
|
47
19
|
if (!rowCount) {
|
|
48
20
|
return false;
|
|
49
21
|
}
|
|
50
|
-
|
|
22
|
+
|
|
23
|
+
const cellsLength = grid[0].length; // moving horizontally
|
|
24
|
+
|
|
51
25
|
if (shouldWrapCells && isLeftRight) {
|
|
26
|
+
// to left
|
|
52
27
|
if (nextCell < 0) {
|
|
53
28
|
nextCell = cellsLength - 1;
|
|
54
29
|
nextRow -= 1;
|
|
55
30
|
}
|
|
31
|
+
|
|
56
32
|
if (nextCell >= cellsLength) {
|
|
57
33
|
nextCell = 0;
|
|
58
34
|
nextRow += 1;
|
|
59
35
|
}
|
|
60
|
-
}
|
|
36
|
+
} // moving vertically
|
|
37
|
+
|
|
38
|
+
|
|
61
39
|
if (shouldWrapRows && !isLeftRight) {
|
|
40
|
+
// to top
|
|
62
41
|
if (nextRow < 0) {
|
|
63
42
|
nextCell -= 1;
|
|
64
43
|
nextRow = rowCount - 1;
|
|
44
|
+
|
|
65
45
|
if (grid[nextRow] && nextCell >= 0 && !grid[nextRow][nextCell]) {
|
|
66
46
|
nextRow -= 1;
|
|
67
47
|
}
|
|
@@ -70,11 +50,11 @@ function getNextCellPosition({
|
|
|
70
50
|
nextCell += 1;
|
|
71
51
|
}
|
|
72
52
|
}
|
|
53
|
+
|
|
73
54
|
return {
|
|
74
55
|
cellIndex: nextCell,
|
|
75
56
|
rowIndex: nextRow
|
|
76
57
|
};
|
|
77
58
|
}
|
|
78
|
-
|
|
79
|
-
module.exports =
|
|
80
|
-
//# sourceMappingURL=getNextCellPosition.js.map
|
|
59
|
+
|
|
60
|
+
module.exports = getNextCellPosition;
|
|
@@ -1,67 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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 Group_exports = {};
|
|
29
|
-
__export(Group_exports, {
|
|
30
|
-
Group: () => Group,
|
|
31
|
-
default: () => Group_default
|
|
32
|
-
});
|
|
33
|
-
var React = __toESM(require("react"));
|
|
34
|
-
var import_react = __toESM(require("react"));
|
|
35
|
-
var import_prop_types = __toESM(require("prop-types"));
|
|
36
|
-
var import_GroupContext = require("./GroupContext");
|
|
37
|
-
const getValueItem = (e) => {
|
|
38
|
-
const { target, currentTarget } = e;
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var GroupContext = require('./GroupContext.js');
|
|
7
|
+
|
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
+
|
|
10
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
11
|
+
|
|
12
|
+
const getValueItem = e => {
|
|
13
|
+
const {
|
|
14
|
+
target,
|
|
15
|
+
currentTarget
|
|
16
|
+
} = e;
|
|
17
|
+
|
|
39
18
|
if (target) {
|
|
40
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
value
|
|
21
|
+
} = target;
|
|
41
22
|
return value;
|
|
42
23
|
}
|
|
24
|
+
|
|
43
25
|
if (currentTarget) {
|
|
44
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
value
|
|
28
|
+
} = currentTarget;
|
|
45
29
|
return value;
|
|
46
30
|
}
|
|
31
|
+
|
|
47
32
|
return e;
|
|
48
33
|
};
|
|
34
|
+
|
|
49
35
|
const toggleItemValue = (array, e) => {
|
|
50
36
|
const newvalue = getValueItem(e);
|
|
51
37
|
const res = array;
|
|
52
38
|
const index = array.indexOf(newvalue);
|
|
39
|
+
|
|
53
40
|
if (index === -1) {
|
|
54
41
|
res.push(newvalue);
|
|
55
42
|
} else {
|
|
56
43
|
res.splice(index, 1);
|
|
57
44
|
}
|
|
45
|
+
|
|
58
46
|
return res;
|
|
59
47
|
};
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
|
|
49
|
+
const {
|
|
50
|
+
Provider
|
|
51
|
+
} = GroupContext.GroupContext;
|
|
52
|
+
/** deprecated use CheckableGroup instead */
|
|
53
|
+
|
|
54
|
+
class Group extends React.Component {
|
|
62
55
|
constructor(props) {
|
|
63
56
|
super(props);
|
|
64
|
-
const {
|
|
57
|
+
const {
|
|
58
|
+
activeValue,
|
|
59
|
+
disabled
|
|
60
|
+
} = props;
|
|
65
61
|
this.state = {
|
|
66
62
|
activeValue,
|
|
67
63
|
disabled,
|
|
@@ -69,47 +65,60 @@ class Group extends import_react.Component {
|
|
|
69
65
|
onChange: this.handleChange.bind(this)
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
|
|
69
|
+
static getDerivedStateFromProps(nextProps, _ref) {
|
|
70
|
+
let {
|
|
71
|
+
prevValue
|
|
72
|
+
} = _ref;
|
|
73
|
+
if (nextProps.activeValue === prevValue) return null;
|
|
75
74
|
return {
|
|
76
75
|
activeValue: nextProps.activeValue,
|
|
77
76
|
prevValue: nextProps.activeValue
|
|
78
77
|
};
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const {
|
|
79
|
+
|
|
80
|
+
handleChange(e) {
|
|
81
|
+
const {
|
|
82
|
+
multiple,
|
|
83
|
+
onChange
|
|
84
|
+
} = this.props;
|
|
85
|
+
const {
|
|
86
|
+
activeValue
|
|
87
|
+
} = this.state;
|
|
83
88
|
const value = getValueItem(e);
|
|
84
89
|
let newValue;
|
|
90
|
+
|
|
85
91
|
if (multiple) {
|
|
86
92
|
newValue = toggleItemValue(activeValue || [], value);
|
|
87
93
|
} else if (activeValue !== value) {
|
|
94
|
+
// default behaviour it will be toggle the active value
|
|
88
95
|
newValue = value;
|
|
89
96
|
}
|
|
97
|
+
|
|
90
98
|
this.setState({
|
|
91
99
|
activeValue: newValue
|
|
92
100
|
});
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
|
|
102
|
+
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
103
|
+
rest[_key - 1] = arguments[_key];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (onChange) onChange(newValue, ...rest);
|
|
95
107
|
}
|
|
108
|
+
|
|
96
109
|
render() {
|
|
97
|
-
const {
|
|
98
|
-
|
|
110
|
+
const {
|
|
111
|
+
children
|
|
112
|
+
} = this.props;
|
|
113
|
+
return /*#__PURE__*/_jsx__default["default"](Provider, {
|
|
99
114
|
value: this.state
|
|
100
|
-
}, children);
|
|
115
|
+
}, void 0, children);
|
|
101
116
|
}
|
|
117
|
+
|
|
102
118
|
}
|
|
119
|
+
|
|
103
120
|
Group.defaultProps = {
|
|
104
121
|
multiple: false
|
|
105
122
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
multiple: import_prop_types.default.bool,
|
|
109
|
-
onChange: import_prop_types.default.func,
|
|
110
|
-
activeValue: import_prop_types.default.oneOfType([import_prop_types.default.array, import_prop_types.default.number]),
|
|
111
|
-
disabled: import_prop_types.default.bool
|
|
112
|
-
};
|
|
113
|
-
var Group_default = Group;
|
|
114
|
-
module.exports = __toCommonJS(Group_exports);
|
|
115
|
-
//# sourceMappingURL=Group.js.map
|
|
123
|
+
|
|
124
|
+
module.exports = Group;
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 GroupContext_exports = {};
|
|
29
|
-
__export(GroupContext_exports, {
|
|
30
|
-
GroupContext: () => GroupContext
|
|
31
|
-
});
|
|
32
|
-
var React = __toESM(require("react"));
|
|
33
|
-
var import_react = __toESM(require("react"));
|
|
34
|
-
const GroupContext = import_react.default.createContext();
|
|
35
|
-
module.exports = __toCommonJS(GroupContext_exports);
|
|
36
|
-
//# sourceMappingURL=GroupContext.js.map
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
|
+
|
|
11
|
+
const GroupContext = /*#__PURE__*/React__default["default"].createContext();
|
|
12
|
+
|
|
13
|
+
exports.GroupContext = GroupContext;
|