@workday/canvas-kit-react 7.1.4 → 7.2.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/collection/index.ts +2 -0
- package/collection/lib/useBaseListModel.tsx +1 -1
- package/collection/lib/useCursorListModel.tsx +88 -20
- package/collection/lib/useGridModel.ts +34 -0
- package/collection/lib/useListItemRovingFocus.tsx +6 -4
- package/dist/commonjs/collection/index.d.ts +2 -0
- package/dist/commonjs/collection/index.d.ts.map +1 -1
- package/dist/commonjs/collection/index.js +5 -1
- package/dist/commonjs/collection/lib/useBaseListModel.js +1 -1
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts +64 -101
- package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useCursorListModel.js +64 -23
- package/dist/commonjs/collection/lib/useGridModel.d.ts +955 -0
- package/dist/commonjs/collection/lib/useGridModel.d.ts.map +1 -0
- package/dist/commonjs/collection/lib/useGridModel.js +52 -0
- package/dist/commonjs/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
- package/dist/commonjs/collection/lib/useListItemRovingFocus.js +6 -4
- package/dist/es6/collection/index.d.ts +2 -0
- package/dist/es6/collection/index.d.ts.map +1 -1
- package/dist/es6/collection/index.js +2 -0
- package/dist/es6/collection/lib/useBaseListModel.js +1 -1
- package/dist/es6/collection/lib/useCursorListModel.d.ts +64 -101
- package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
- package/dist/es6/collection/lib/useCursorListModel.js +64 -23
- package/dist/es6/collection/lib/useGridModel.d.ts +955 -0
- package/dist/es6/collection/lib/useGridModel.d.ts.map +1 -0
- package/dist/es6/collection/lib/useGridModel.js +49 -0
- package/dist/es6/collection/lib/useListItemRovingFocus.d.ts.map +1 -1
- package/dist/es6/collection/lib/useListItemRovingFocus.js +6 -4
- package/package.json +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGridModel.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASL,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { createModelHook } from '@workday/canvas-kit-react/common';
|
|
24
|
+
import { navigationManager } from './useCursorListModel';
|
|
25
|
+
import { useListModel } from './useListModel';
|
|
26
|
+
var _a = useListModel.defaultConfig, columnCount = _a.columnCount, orientation = _a.orientation, defaultConfig = __rest(_a, ["columnCount", "orientation"]);
|
|
27
|
+
export var useGridModel = createModelHook({
|
|
28
|
+
defaultConfig: __assign(__assign({}, defaultConfig), {
|
|
29
|
+
/**
|
|
30
|
+
* Controls the state changes when the user sends navigation events to the model. For example,
|
|
31
|
+
* when the user hits the "right" arrow, a behavior hook will determine directionality
|
|
32
|
+
* (left-to-right or right-to-left) and call the correct navigation method. In our example, a
|
|
33
|
+
* left-to-right language would send a `getNext`. The navigation manager may return the next
|
|
34
|
+
* item in the list. Different managers can be created for slightly different use cases. The
|
|
35
|
+
* default navigation manager will stop when the end of a row/column is detected. For example,
|
|
36
|
+
* `getNext` will return the same item the cursor was previously on if the cursor is on the last
|
|
37
|
+
* item of a row.
|
|
38
|
+
*/
|
|
39
|
+
navigation: navigationManager }),
|
|
40
|
+
requiredConfig: __assign({
|
|
41
|
+
/**
|
|
42
|
+
* The number of columns represented in a grid
|
|
43
|
+
*/
|
|
44
|
+
columnCount: 1 }, useListModel.requiredConfig),
|
|
45
|
+
contextOverride: useListModel.Context,
|
|
46
|
+
})(function (config) {
|
|
47
|
+
var list = useListModel(config);
|
|
48
|
+
return list;
|
|
49
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useListItemRovingFocus.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRovingFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAqBpB,CAAC;AA+BX;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCZ,mBAAmB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useListItemRovingFocus.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemRovingFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAqBpB,CAAC;AA+BX;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAqCZ,mBAAmB;;;;;;;;;OA+CzC,CAAC"}
|
|
@@ -94,10 +94,12 @@ export var useListItemRovingFocus = createElemPropsHook(useCursorListModel)(func
|
|
|
94
94
|
if (event.ctrlKey) {
|
|
95
95
|
for (var key in ctrlKeyMap) {
|
|
96
96
|
if (hasOwnKey(ctrlKeyMap, key)) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
if (event.key === key) {
|
|
98
|
+
keyDownRef.current = true;
|
|
99
|
+
(_a = events[ctrlKeyMap[key]]) === null || _a === void 0 ? void 0 : _a.call(events);
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-react",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0-next.2+2d1c962c",
|
|
4
4
|
"description": "The parent module that contains all Workday Canvas Kit React components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"@emotion/styled": "^11.6.0",
|
|
50
50
|
"@popperjs/core": "^2.5.4",
|
|
51
51
|
"@workday/canvas-colors-web": "^2.0.0",
|
|
52
|
-
"@workday/canvas-kit-labs-react": "^7.
|
|
53
|
-
"@workday/canvas-kit-popup-stack": "^7.
|
|
54
|
-
"@workday/canvas-kit-preview-react": "^7.
|
|
52
|
+
"@workday/canvas-kit-labs-react": "^7.2.0-next.2+2d1c962c",
|
|
53
|
+
"@workday/canvas-kit-popup-stack": "^7.2.0-next.2+2d1c962c",
|
|
54
|
+
"@workday/canvas-kit-preview-react": "^7.2.0-next.2+2d1c962c",
|
|
55
55
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
56
56
|
"@workday/design-assets-types": "^0.2.8",
|
|
57
57
|
"chroma-js": "^2.1.0",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"@workday/canvas-accent-icons-web": "^3.0.0",
|
|
71
71
|
"@workday/canvas-applet-icons-web": "^2.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "2d1c962c704eec264f341f2f3a5cad9a0e7c2c02"
|
|
74
74
|
}
|