@workday/canvas-kit-react 11.2.1 → 11.2.3
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/common/lib/utils/elements.ts +32 -10
- package/dist/commonjs/common/lib/utils/elements.d.ts +11 -1
- package/dist/commonjs/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/commonjs/common/lib/utils/elements.js +30 -11
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/commonjs/popup/lib/hooks/useReturnFocus.js +2 -1
- package/dist/commonjs/select/lib/Select.d.ts +114 -57
- package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
- package/dist/commonjs/select/lib/Select.js +2 -2
- package/dist/es6/common/lib/utils/elements.d.ts +11 -1
- package/dist/es6/common/lib/utils/elements.d.ts.map +1 -1
- package/dist/es6/common/lib/utils/elements.js +28 -9
- package/dist/es6/popup/lib/hooks/useReturnFocus.d.ts.map +1 -1
- package/dist/es6/popup/lib/hooks/useReturnFocus.js +2 -1
- package/dist/es6/select/lib/Select.d.ts +114 -57
- package/dist/es6/select/lib/Select.d.ts.map +1 -1
- package/dist/es6/select/lib/Select.js +2 -2
- package/package.json +4 -4
- package/popup/lib/hooks/useReturnFocus.tsx +6 -1
- package/select/lib/Select.tsx +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../select/lib/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAA8B,OAAO,EAAS,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAa,SAAS,EAAC,MAAM,sCAAsC,CAAC;AAM3E,OAAO,EAEL,YAAY,EAEZ,SAAS,EACV,MAAM,kCAAkC,CAAC;A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;;;;;;;;;;;;;;;;;;;;;IAjBH;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;YAjBH;;;;;;;;;;;;;;;;;eAiBG;;;;;;;;YAnML;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8KD;;;;;;;;;;;;;;;;;eAiBG;;;;;;;;YAnML;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiMD;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;YApCH;;;;;;;;;;;;;;;;;eAiBG;;;;;;;;YAnML;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoND;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;YAvDH;;;;;;;;;;;;;;;;;eAiBG;;;;;;;;YAnML;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA8KD;;;;;;;;;;;;;;;;;eAiBG;;;;;;;;YAnML;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8KD;;;;;;;;;;;;;;;;;mBAiBG;;;;;;;;gBAnML;;;;mBAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8OH,CAAC"}
|
|
@@ -28,7 +28,7 @@ const hiddenSelectInputStencil = canvas_kit_styling_1.createStencil({
|
|
|
28
28
|
exports.SelectInput = common_1.createSubcomponent(text_input_1.TextInput)({
|
|
29
29
|
modelHook: useSelectModel_1.useSelectModel,
|
|
30
30
|
elemPropsHook: useSelectInput_1.useSelectInput,
|
|
31
|
-
})(({ placeholder = 'Choose an option', inputStartIcon, error, textInputProps, disabled,
|
|
31
|
+
})(({ placeholder = 'Choose an option', inputStartIcon, error, textInputProps, disabled, ref, onChange, onInput, value, name, ...elemProps }, Element, model) => {
|
|
32
32
|
return (react_1.default.createElement(text_input_1.InputGroup, { "data-width": "ck-formfield-width" },
|
|
33
33
|
inputStartIcon && model.state.selectedIds.length > 0 && (react_1.default.createElement(text_input_1.InputGroup.InnerStart, Object.assign({}, selectIconsStencil()),
|
|
34
34
|
react_1.default.createElement(icon_1.SystemIcon, { icon: inputStartIcon }))),
|
|
@@ -45,7 +45,7 @@ exports.SelectItem = common_1.createSubcomponent('li')({
|
|
|
45
45
|
})(({ children, ...elemProps }, Element, _model) => {
|
|
46
46
|
return (react_1.default.createElement(combobox_1.Combobox.Menu.Item, Object.assign({ role: "option", as: Element }, elemProps), children));
|
|
47
47
|
});
|
|
48
|
-
const selectCardStyles = canvas_kit_styling_1.createStyles({ name: "
|
|
48
|
+
const selectCardStyles = canvas_kit_styling_1.createStyles({ name: "6c472b", styles: "max-height:18.75rem;" });
|
|
49
49
|
exports.SelectCard = common_1.createSubcomponent('div')({
|
|
50
50
|
modelHook: useSelectModel_1.useSelectModel,
|
|
51
51
|
elemPropsHook: useSelectCard_1.useSelectCard,
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Is an element focusable? This function performs various tests to see if the element in question
|
|
3
|
-
* can receive focus. Should skip disabled elements as they are not focusable.
|
|
3
|
+
* can receive focus via a pointer. Should skip disabled elements as they are not focusable.
|
|
4
|
+
*/
|
|
5
|
+
export declare const isMouseFocusable: (element: Element) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Is an element focusable? This function performs various tests to see if the element in question
|
|
8
|
+
* can receive focus via the keyboard. Should skip disabled elements as they are not focusable.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isKeyboardFocusable: (element: Element) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `isMouseFocusable` for mouse events and `isKeyboardFocusable` for keyboard
|
|
13
|
+
* events. `isFocusable` is an alias to `isKeyboardFocusable`
|
|
4
14
|
*/
|
|
5
15
|
export declare const isFocusable: (element: Element) => boolean;
|
|
6
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../../../common/lib/utils/elements.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,YAnCK,OAAO,KAAG,OAmCG,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,YAAa,OAAO,KAAG,OAEtD,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,YARqB,OAAO,KAAG,OAQT,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,cACxB,WAAW,KACrB,OAAO,EAAE,GAAG,WAAW,GAAG,IAgB5B,CAAC;AAaF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,cAAe,WAAW,KAAG,OAAO,EAAE,GAAG,OAAO,GAAG,IAgBtF,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Is an element focusable? This function performs various tests to see if the element in question
|
|
3
|
-
* can receive focus. Should skip disabled elements as they are not focusable.
|
|
4
|
-
*/
|
|
5
|
-
export const isFocusable = (element) => {
|
|
1
|
+
const isBaseFocusable = (element) => {
|
|
6
2
|
if (element.hasAttribute('disabled')) {
|
|
7
3
|
return false;
|
|
8
4
|
}
|
|
@@ -11,8 +7,14 @@ export const isFocusable = (element) => {
|
|
|
11
7
|
const validAnchor = nodeName === 'a' && element.hasAttribute('href');
|
|
12
8
|
const validAudioVideo = ['audio', 'video'].includes(nodeName) && element.hasAttribute('controls');
|
|
13
9
|
const validImgObject = ['img', 'object'].includes(nodeName) && element.hasAttribute('usemap');
|
|
14
|
-
const validNativelyFocusable = [
|
|
15
|
-
|
|
10
|
+
const validNativelyFocusable = [
|
|
11
|
+
'button',
|
|
12
|
+
'details',
|
|
13
|
+
'embed',
|
|
14
|
+
'iframe',
|
|
15
|
+
'select',
|
|
16
|
+
'textarea',
|
|
17
|
+
].includes(nodeName);
|
|
16
18
|
const hasTabIndex = element.getAttribute('tabindex') === '0';
|
|
17
19
|
return (validInput ||
|
|
18
20
|
validAnchor ||
|
|
@@ -21,6 +23,23 @@ export const isFocusable = (element) => {
|
|
|
21
23
|
validNativelyFocusable ||
|
|
22
24
|
hasTabIndex);
|
|
23
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* Is an element focusable? This function performs various tests to see if the element in question
|
|
28
|
+
* can receive focus via a pointer. Should skip disabled elements as they are not focusable.
|
|
29
|
+
*/
|
|
30
|
+
export const isMouseFocusable = isBaseFocusable;
|
|
31
|
+
/**
|
|
32
|
+
* Is an element focusable? This function performs various tests to see if the element in question
|
|
33
|
+
* can receive focus via the keyboard. Should skip disabled elements as they are not focusable.
|
|
34
|
+
*/
|
|
35
|
+
export const isKeyboardFocusable = (element) => {
|
|
36
|
+
return isBaseFocusable(element) && element.getAttribute('tabindex') !== '-1';
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `isMouseFocusable` for mouse events and `isKeyboardFocusable` for keyboard
|
|
40
|
+
* events. `isFocusable` is an alias to `isKeyboardFocusable`
|
|
41
|
+
*/
|
|
42
|
+
export const isFocusable = isKeyboardFocusable;
|
|
24
43
|
/**
|
|
25
44
|
* Get the first focusable element in a container.
|
|
26
45
|
*
|
|
@@ -30,7 +49,7 @@ export const getFirstFocusableElement = (container) => {
|
|
|
30
49
|
const elements = container.querySelectorAll('*');
|
|
31
50
|
for (let i = 0; i < elements.length; i++) {
|
|
32
51
|
const element = elements.item(i);
|
|
33
|
-
if (element &&
|
|
52
|
+
if (element && isKeyboardFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
34
53
|
if (isRadioInput(element)) {
|
|
35
54
|
const radioGroup = getRadioGroup(container, element);
|
|
36
55
|
return radioGroup.length > 1 ? Array.from(radioGroup) : element;
|
|
@@ -55,7 +74,7 @@ export const getLastFocusableElement = (container) => {
|
|
|
55
74
|
const elements = container.querySelectorAll('*');
|
|
56
75
|
for (let i = elements.length - 1; i >= 0; i--) {
|
|
57
76
|
const element = elements.item(i);
|
|
58
|
-
if (element &&
|
|
77
|
+
if (element && isKeyboardFocusable(element) && element.getAttribute('tabindex') !== '-1') {
|
|
59
78
|
if (isRadioInput(element)) {
|
|
60
79
|
const radioGroup = getRadioGroup(container, element);
|
|
61
80
|
return radioGroup.length > 1 ? Array.from(radioGroup) : element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useReturnFocus.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useReturnFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuD1B;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;MA2GzB,CAAC"}
|
|
@@ -19,7 +19,8 @@ function getFocusableElement(element) {
|
|
|
19
19
|
if (element === null || element === document.body || !element.parentElement) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
else if (isFocusable(element)
|
|
22
|
+
else if (isFocusable(element) ||
|
|
23
|
+
['button', 'details', 'embed', 'iframe', 'select', 'textarea'].includes(element.nodeName.toLowerCase())) {
|
|
23
24
|
return element;
|
|
24
25
|
}
|
|
25
26
|
return getFocusableElement(element.parentElement);
|