@workday/canvas-kit-react 9.0.1 → 10.0.0-alpha.426-next.0
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/action-bar/lib/useActionBarModel.tsx +20 -3
- package/checkbox/lib/Checkbox.tsx +1 -1
- package/common/lib/utils/changeFocus.ts +3 -15
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts +51 -500
- package/dist/commonjs/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts +12 -0
- package/dist/commonjs/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/commonjs/action-bar/lib/useActionBarModel.js +16 -3
- package/dist/commonjs/checkbox/lib/Checkbox.js +1 -1
- package/dist/commonjs/common/lib/utils/changeFocus.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/changeFocus.js +2 -8
- package/dist/es6/action-bar/lib/ActionBar.d.ts +51 -500
- package/dist/es6/action-bar/lib/ActionBar.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts +12 -0
- package/dist/es6/action-bar/lib/useActionBarModel.d.ts.map +1 -1
- package/dist/es6/action-bar/lib/useActionBarModel.js +16 -3
- package/dist/es6/checkbox/lib/Checkbox.js +1 -1
- package/dist/es6/common/lib/utils/changeFocus.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/changeFocus.js +2 -8
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionBar.d.ts","sourceRoot":"","sources":["../../../../action-bar/lib/ActionBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"ActionBar.d.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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKL,CAAC"}
|
|
@@ -32,6 +32,12 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
32
32
|
defaultItemHeight: number;
|
|
33
33
|
items: any[];
|
|
34
34
|
}>;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum number of actions that can be visible.
|
|
37
|
+
* Must be greater than 1 and less than items.length.
|
|
38
|
+
* @default 3
|
|
39
|
+
*/
|
|
40
|
+
maximumVisible: number;
|
|
35
41
|
initialHiddenIds: string[];
|
|
36
42
|
containerWidth: number;
|
|
37
43
|
shouldCalculateOverflow: boolean;
|
|
@@ -1619,6 +1625,12 @@ export declare const useActionBarModel: (<TT_Special_Generic>(config?: (Partial<
|
|
|
1619
1625
|
defaultItemHeight: number;
|
|
1620
1626
|
items: any[];
|
|
1621
1627
|
}>;
|
|
1628
|
+
/**
|
|
1629
|
+
* The maximum number of actions that can be visible.
|
|
1630
|
+
* Must be greater than 1 and less than items.length.
|
|
1631
|
+
* @default 3
|
|
1632
|
+
*/
|
|
1633
|
+
maximumVisible: number;
|
|
1622
1634
|
initialHiddenIds: string[];
|
|
1623
1635
|
containerWidth: number;
|
|
1624
1636
|
shouldCalculateOverflow: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useActionBarModel.d.ts","sourceRoot":"","sources":["../../../../action-bar/lib/useActionBarModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;IAG1B;;;OAGG;;IAEH;;;;OAIG
|
|
1
|
+
{"version":3,"file":"useActionBarModel.d.ts","sourceRoot":"","sources":["../../../../action-bar/lib/useActionBarModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,iBAAiB;IAG1B;;;OAGG;;IAEH;;;;OAIG;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAhBH;;;OAGG;;IAEH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;IAGH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkFL,CAAC"}
|
|
@@ -23,6 +23,12 @@ exports.useActionBarModel = common_1.createModelHook({
|
|
|
23
23
|
*/
|
|
24
24
|
orientation: 'horizontal',
|
|
25
25
|
menuConfig: {},
|
|
26
|
+
/**
|
|
27
|
+
* The maximum number of actions that can be visible.
|
|
28
|
+
* Must be greater than 1 and less than items.length.
|
|
29
|
+
* @default 3
|
|
30
|
+
*/
|
|
31
|
+
maximumVisible: 3,
|
|
26
32
|
},
|
|
27
33
|
requiredConfig: collection_1.useOverflowListModel.requiredConfig,
|
|
28
34
|
})(config => {
|
|
@@ -36,9 +42,16 @@ exports.useActionBarModel = common_1.createModelHook({
|
|
|
36
42
|
let hiddenIds = model.state.hiddenIds;
|
|
37
43
|
let nonInteractiveIds = model.state.nonInteractiveIds;
|
|
38
44
|
const totalSize = model.state.items.length;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
console.log(config.maximumVisible);
|
|
46
|
+
// Only show maximumVisible buttons
|
|
47
|
+
const maximumVisible = !config.maximumVisible || config.maximumVisible < 1
|
|
48
|
+
? 3 // should fallback to default value
|
|
49
|
+
: config.maximumVisible > totalSize
|
|
50
|
+
? totalSize
|
|
51
|
+
: config.maximumVisible;
|
|
52
|
+
console.log('maximumVisible', maximumVisible);
|
|
53
|
+
if (totalSize - hiddenIds.length >= maximumVisible) {
|
|
54
|
+
hiddenIds = items.slice(maximumVisible, totalSize).map(getId);
|
|
42
55
|
}
|
|
43
56
|
// Always show the first button and make sure it is interactive
|
|
44
57
|
if (totalSize - hiddenIds.length === 0) {
|
|
@@ -242,7 +242,7 @@ exports.Checkbox = common_1.createComponent('input')({
|
|
|
242
242
|
React.createElement(CheckboxCheck, { checked: checked }, indeterminate ? (React.createElement(IndeterminateBox, { variant: variant })) : (React.createElement(icon_1.SystemIcon, { icon: canvas_system_icons_web_1.checkSmallIcon, color: variant === 'inverse'
|
|
243
243
|
? theme.canvas.palette.primary.main
|
|
244
244
|
: theme.canvas.palette.primary.contrast }))))),
|
|
245
|
-
label && (React.createElement(text_1.LabelText, { htmlFor: inputId, disabled: disabled, variant: variant,
|
|
245
|
+
label && (React.createElement(text_1.LabelText, { htmlFor: inputId, disabled: disabled, variant: variant, paddingLeft: checkboxLabelDistance }, label))));
|
|
246
246
|
},
|
|
247
247
|
subComponents: {
|
|
248
248
|
ErrorType: common_1.ErrorType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changeFocus.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/changeFocus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,
|
|
1
|
+
{"version":3,"file":"changeFocus.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/changeFocus.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,YAAa,OAAO,SAmB3C,CAAC"}
|
|
@@ -12,10 +12,10 @@ const changeFocus = (element) => {
|
|
|
12
12
|
if (document.activeElement === element || !element) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
if (
|
|
15
|
+
if (element instanceof HTMLElement) {
|
|
16
16
|
// Dispatch an unidentified keyboard event for an input provider prior to a focus change so that
|
|
17
17
|
// the ring will appear.
|
|
18
|
-
if (typeof KeyboardEvent === 'function'
|
|
18
|
+
if (typeof KeyboardEvent === 'function') {
|
|
19
19
|
const event = new KeyboardEvent('keydown', { bubbles: true, key: 'Unidentified' });
|
|
20
20
|
element.dispatchEvent(event);
|
|
21
21
|
}
|
|
@@ -23,9 +23,3 @@ const changeFocus = (element) => {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
exports.changeFocus = changeFocus;
|
|
26
|
-
function hasCallableProperty(input, method) {
|
|
27
|
-
return (!!input &&
|
|
28
|
-
typeof input === 'object' &&
|
|
29
|
-
method in input &&
|
|
30
|
-
typeof input[method] === 'function');
|
|
31
|
-
}
|