@workday/canvas-kit-react 10.3.4 → 10.3.5

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.
Files changed (47) hide show
  1. package/collection/lib/useCursorListModel.tsx +86 -90
  2. package/collection/lib/useListItemAllowChildStrings.ts +3 -3
  3. package/collection/lib/useListRenderItem.tsx +1 -1
  4. package/combobox/lib/hooks/useComboboxKeyboardTypeAhead.ts +3 -3
  5. package/combobox/lib/hooks/useComboboxModel.tsx +1 -2
  6. package/common/lib/styles/errorRing.ts +2 -2
  7. package/dist/commonjs/collection/lib/useCursorListModel.d.ts.map +1 -1
  8. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
  9. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  10. package/dist/commonjs/collection/lib/useListItemAllowChildStrings.js +1 -1
  11. package/dist/commonjs/collection/lib/useListRenderItem.js +1 -1
  12. package/dist/commonjs/combobox/lib/hooks/useComboboxKeyboardTypeAhead.js +2 -3
  13. package/dist/commonjs/combobox/lib/hooks/useComboboxModel.d.ts.map +1 -1
  14. package/dist/commonjs/combobox/lib/hooks/useComboboxModel.js +1 -2
  15. package/dist/commonjs/common/lib/styles/errorRing.js +2 -2
  16. package/dist/commonjs/select/lib/Select.d.ts +2 -1
  17. package/dist/commonjs/select/lib/Select.d.ts.map +1 -1
  18. package/dist/commonjs/select/lib/Select.js +4 -2
  19. package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts +6 -1
  20. package/dist/commonjs/select/lib/hooks/useSelectInput.d.ts.map +1 -1
  21. package/dist/commonjs/select/lib/hooks/useSelectInput.js +45 -4
  22. package/dist/commonjs/select/lib/hooks/useSelectModel.d.ts.map +1 -1
  23. package/dist/commonjs/select/lib/hooks/useSelectModel.js +1 -2
  24. package/dist/commonjs/text-input/lib/TextInput.js +3 -3
  25. package/dist/es6/collection/lib/useCursorListModel.d.ts.map +1 -1
  26. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts +2 -1
  27. package/dist/es6/collection/lib/useListItemAllowChildStrings.d.ts.map +1 -1
  28. package/dist/es6/collection/lib/useListItemAllowChildStrings.js +1 -1
  29. package/dist/es6/collection/lib/useListRenderItem.js +1 -1
  30. package/dist/es6/combobox/lib/hooks/useComboboxKeyboardTypeAhead.js +2 -3
  31. package/dist/es6/combobox/lib/hooks/useComboboxModel.d.ts.map +1 -1
  32. package/dist/es6/combobox/lib/hooks/useComboboxModel.js +1 -2
  33. package/dist/es6/common/lib/styles/errorRing.js +2 -2
  34. package/dist/es6/select/lib/Select.d.ts +2 -1
  35. package/dist/es6/select/lib/Select.d.ts.map +1 -1
  36. package/dist/es6/select/lib/Select.js +4 -2
  37. package/dist/es6/select/lib/hooks/useSelectInput.d.ts +6 -1
  38. package/dist/es6/select/lib/hooks/useSelectInput.d.ts.map +1 -1
  39. package/dist/es6/select/lib/hooks/useSelectInput.js +43 -5
  40. package/dist/es6/select/lib/hooks/useSelectModel.d.ts.map +1 -1
  41. package/dist/es6/select/lib/hooks/useSelectModel.js +1 -2
  42. package/dist/es6/text-input/lib/TextInput.js +3 -3
  43. package/package.json +4 -4
  44. package/select/lib/Select.tsx +50 -4
  45. package/select/lib/hooks/useSelectInput.ts +86 -44
  46. package/select/lib/hooks/useSelectModel.tsx +1 -2
  47. package/text-input/lib/TextInput.tsx +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"useCursorListModel.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useCursorListModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA0B,OAAO,EAAC,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAmB,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAE1D,aAAK,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,CAAC;AAE5E;;;;GAIG;AACH,MAAM,WAAW,iB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;;QA3ElD,wDAAwD;;QAExD;;;;WAIG;;QAEH;;;WAGG;;QAEH;;;;;;WAMG;;8BArCyD,MAAM;;;;;;;;;;;;;;;;;;;QA2ClE,mEAAmE;mBACxD;YAAC,EAAE,EAAE,MAAM,CAAA;SAAC;QAIvB;;;;;WAKG;;QAKH;;;WAGG;;QAKH;;;;;WAKG;;QAOH;;;;;WAKG;;QAKH,mDAAmD;;QAKnD,kDAAkD;;;;;;;;;;;;;;;;;;;EA0BpD,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { Item } from '@workday/canvas-kit-react/collection';
1
2
  /**
2
3
  * This elemProps hook allows for children values to be considered identifiers if the children are
3
4
  * strings. This can be useful for autocomplete or select components that allow string values. This
@@ -47,7 +48,7 @@ export declare const useListItemAllowChildStrings: import("@workday/canvas-kit-r
47
48
  indexRef: import("react").MutableRefObject<number>;
48
49
  nonInteractiveIds: string[];
49
50
  isVirtualized: boolean;
50
- items: import("@workday/canvas-kit-react/collection").Item<any>[];
51
+ items: Item<any>[];
51
52
  };
52
53
  events: {
53
54
  select(data: {
@@ -1 +1 @@
1
- {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
1
+ {"version":3,"file":"useListItemAllowChildStrings.d.ts","sourceRoot":"","sources":["../../../../collection/lib/useListItemAllowChildStrings.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,IAAI,EAAC,MAAM,sCAAsC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASxC,CAAC"}
@@ -27,7 +27,7 @@ import { useListModel } from '@workday/canvas-kit-react/collection';
27
27
  */
28
28
  export const useListItemAllowChildStrings = createElemPropsHook(useListModel)((_, __, elemProps = {}) => {
29
29
  const props = {};
30
- if (!elemProps['data-id'] && typeof elemProps.children === 'string') {
30
+ if (!elemProps['data-id'] && !elemProps.item && typeof elemProps.children === 'string') {
31
31
  props['data-id'] = elemProps.children;
32
32
  }
33
33
  return props;
@@ -36,7 +36,7 @@ export function useListRenderItems(model, children) {
36
36
  if (React.isValidElement(child)) {
37
37
  return React.cloneElement(child, {
38
38
  key: item.id || item.index,
39
- item: item.value,
39
+ item: item,
40
40
  });
41
41
  }
42
42
  return child;
@@ -46,12 +46,11 @@ export const useComboboxKeyboardTypeAhead = createElemPropsHook(useComboboxModel
46
46
  }
47
47
  return -1;
48
48
  };
49
- const currentItem = model.navigation.getItem(model.state.cursorId, model);
50
- const cursorFocusedIndex = currentItem.index;
49
+ const currentItemIndex = model.state.items.length > 0 ? model.navigation.getItem(model.state.cursorId, model).index : 0;
51
50
  const handleKeyboardTypeAhead = (key, numOptions) => {
52
51
  // If the starting point is beyond the list of options, reset it
53
52
  // to the beginning of the list
54
- const startNumber = keySofar.current.length === 0 ? cursorFocusedIndex + 1 : cursorFocusedIndex;
53
+ const startNumber = keySofar.current.length === 0 ? currentItemIndex + 1 : currentItemIndex;
55
54
  const start = startNumber === numOptions ? 0 : startNumber;
56
55
  // Keeps track of the current key types and adds to it
57
56
  // if you type `de` vs `d` for denver
@@ -1 +1 @@
1
- {"version":3,"file":"useComboboxModel.d.ts","sourceRoot":"","sources":["../../../../../combobox/lib/hooks/useComboboxModel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;;;;GAMG;AACH,eAAO,MAAM,aAAa;;oBAIN,MAAM,WAAW,CAAC,gBAAgB,CAAC;;sBAAnC,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;oBAAnC,MAAM,WAAW,CAAC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;;;;;;;sBAlEN,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;oBAAnC,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmDnD;;;OAGG;;;IASH;;OAEG;oBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAftB;;;WAGG;;;;QASH;;WAEG;wBACa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAlEN,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;EAwErD,CAAC"}
@@ -49,8 +49,7 @@ export const useComboboxModel = createModelHook({
49
49
  const input = useInputModel(config);
50
50
  const menu = useMenuModel(useMenuModel.mergeConfig(config, {
51
51
  onSelect({ id }) {
52
- const textValue = menu.navigation.getItem(id, menu).textValue || id;
53
- dispatchInputEvent(menu.state.targetRef.current, textValue);
52
+ dispatchInputEvent(menu.state.targetRef.current, id);
54
53
  },
55
54
  }));
56
55
  const [width, setWidth] = React.useState(0);
@@ -49,10 +49,10 @@ export function errorRing(error, theme) {
49
49
  borderColor: errorColors.outer,
50
50
  transition: '100ms box-shadow',
51
51
  boxShadow: errorBoxShadow,
52
- '&:hover, &:disabled': {
52
+ '&:hover, &:disabled, &.hover, &.disabled': {
53
53
  borderColor: errorColors.outer,
54
54
  },
55
- '&:focus:not([disabled])': {
55
+ '&:focus-visible:not([disabled]), &.focus:not([disabled])': {
56
56
  borderColor: errorColors.outer,
57
57
  boxShadow: `${errorBoxShadow},
58
58
  0 0 0 2px ${colors.frenchVanilla100},
@@ -3,7 +3,8 @@ import { ExtractProps, Themeable } from '@workday/canvas-kit-react/common';
3
3
  import { Combobox } from '@workday/canvas-kit-react/combobox';
4
4
  import { TextInput } from '@workday/canvas-kit-react/text-input';
5
5
  import { CanvasSystemIcon } from '@workday/design-assets-types';
6
- export interface SelectInputProps extends ExtractProps<typeof TextInput> {
6
+ import { CSProps } from '@workday/canvas-kit-styling';
7
+ export interface SelectInputProps extends ExtractProps<typeof TextInput>, CSProps {
7
8
  /**
8
9
  * The Icon to render at the start of the `input`. Use this prop if your options
9
10
  * include icons that you would like to render in the `input` when selected.
@@ -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,EAEL,YAAY,EAEZ,SAAS,EACV,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,oCAAoC,CAAC;AAE5D,OAAO,EAAa,SAAS,EAAC,MAAM,sCAAsC,CAAC;AAO3E,OAAO,EAAC,gBAAgB,EAAC,MAAM,8BAA8B,CAAC;AAG9D,MAAM,WAAW,gBAAiB,SAAQ,YAAY,CAAC,OAAO,SAAS,CAAC;IACtE;;;;OAIG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AAUD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBvB,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWrB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASrB,CAAC;AAEH,MAA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AaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEH;;;;;;;;;;;;;;;;;OAiBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CASL,CAAC"}
@@ -10,14 +10,16 @@ import { useSelectCard } from './hooks/useSelectCard';
10
10
  import { useSelectInput } from './hooks/useSelectInput';
11
11
  import { createStyles } from '@workday/canvas-kit-styling';
12
12
  const selectInputStyles = createStyles({ name: "1gpclr4", styles: "caret-color:transparent;cursor:default;&::selection{background-color:transparent;}" });
13
+ const hiddenSelectStyles = createStyles({ name: "1uxiz6e", styles: "position:absolute;top:0px;bottom:0px;left:0px;right:0px;opacity:0px;cursor:default;pointer-events:none;" });
13
14
  export const SelectInput = createSubcomponent(TextInput)({
14
15
  modelHook: useSelectModel,
15
16
  elemPropsHook: useSelectInput,
16
- })(({ placeholder = 'Choose an option', inputStartIcon, ...elemProps }, Element, model) => {
17
+ })(({ placeholder = 'Choose an option', inputStartIcon, error, textInputProps, disabled, ref, onChange, onInput, onFocus, value, name, ...elemProps }, Element, model) => {
17
18
  return (React.createElement(InputGroup, null,
18
19
  inputStartIcon && model.state.selectedIds.length > 0 && (React.createElement(InputGroup.InnerStart, { pointerEvents: "none" },
19
20
  React.createElement(SystemIcon, { icon: inputStartIcon }))),
20
- React.createElement(InputGroup.Input, Object.assign({ as: Element, placeholder: placeholder }, mergeStyles(elemProps, [selectInputStyles]))),
21
+ React.createElement(InputGroup.Input, { error: error, disabled: disabled, className: hiddenSelectStyles, tabIndex: -1, "aria-hidden": true, onChange: onChange, onInput: onInput, value: value, onFocus: onFocus, name: name, ref: ref }),
22
+ React.createElement(InputGroup.Input, Object.assign({ as: Element, disabled: disabled, placeholder: placeholder, error: error }, textInputProps, mergeStyles(elemProps, [selectInputStyles]))),
21
23
  React.createElement(InputGroup.InnerEnd, { position: "absolute", pointerEvents: "none" },
22
24
  React.createElement(SystemIcon, { icon: caretDownSmallIcon }))));
23
25
  });
@@ -80,8 +80,13 @@ export declare const useSelectInput: import("@workday/canvas-kit-react/common").
80
80
  getId: (item: any) => string;
81
81
  }, {
82
82
  readonly onKeyDown: (event: React.KeyboardEvent) => void;
83
- readonly ref: (instance: HTMLInputElement | null) => void;
83
+ readonly onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
84
84
  readonly autoComplete: "off";
85
+ readonly onFocus: () => void;
86
+ readonly textInputProps: {
87
+ readonly ref: React.RefObject<HTMLInputElement>;
88
+ };
89
+ readonly ref: (instance: HTMLInputElement | null) => void;
85
90
  readonly defaultValue: string | undefined;
86
91
  } & {
87
92
  onKeyDown(event: React.KeyboardEvent<Element>): void;
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAkBJ,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCzC,CAAC"}
1
+ {"version":3,"file":"useSelectInput.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA8CF,mBAAmB;+BAvCP,MAAM,WAAW,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0FvE,CAAC"}
@@ -1,13 +1,24 @@
1
- import { composeHooks, createElemPropsHook, useForkRef, useLocalRef, useResizeObserver, } from '@workday/canvas-kit-react/common';
1
+ import React from 'react';
2
+ import { composeHooks, createElemPropsHook, useLocalRef, useResizeObserver, dispatchInputEvent, } from '@workday/canvas-kit-react/common';
2
3
  import { useComboboxInput, useComboboxKeyboardTypeAhead, useComboboxMoveCursorToSelected, useComboboxResetCursorToSelected, } from '@workday/canvas-kit-react/combobox';
3
4
  import { useSelectModel } from './useSelectModel';
4
5
  /**
5
6
  * `useSelectInput` extends {@link useComboboxInput useComboboxInput} and {@link useComboboxKeyboardTypeAhead useComboboxKeyboardTypeAhead} and adds type ahead functionality and Select-specific [keyboard support](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/).
6
7
  */
7
8
  export const useSelectInput = composeHooks(createElemPropsHook(useSelectModel)((model, ref, elemProps = {}) => {
8
- const { localRef, elementRef } = useLocalRef(useForkRef(ref, ref));
9
+ const { elementRef } = useLocalRef(ref);
10
+ const textInputRef = React.useRef(null);
11
+ // Update the text value of the input
12
+ const handleOnChange = (event) => {
13
+ var _a;
14
+ const value = (_a = model.navigation.getItem(event.target.value, model)) === null || _a === void 0 ? void 0 : _a.textValue;
15
+ const nativeInputValue = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(textInputRef.current), 'value');
16
+ if (nativeInputValue && nativeInputValue.set) {
17
+ nativeInputValue.set.call(textInputRef.current, value);
18
+ }
19
+ };
9
20
  useResizeObserver({
10
- ref: localRef,
21
+ ref: textInputRef,
11
22
  onResize: data => {
12
23
  if (model.state.visibility === 'visible') {
13
24
  // Width of the Input + 2px border + 8px padding
@@ -16,6 +27,20 @@ export const useSelectInput = composeHooks(createElemPropsHook(useSelectModel)((
16
27
  }
17
28
  },
18
29
  });
30
+ // The intent is if items are loaded after the component is rendered, it will update the input with the value.
31
+ // **Note: We might need to watch for other things or how often we should do this**
32
+ React.useEffect(() => {
33
+ if (model.state.inputRef.current &&
34
+ model.state.items.length > 0 &&
35
+ model.state.selectedIds[0]) {
36
+ const value = model.navigation.getItem(model.state.selectedIds[0], model).id;
37
+ if (model.state.inputRef.current.value !== value) {
38
+ // Programmatically dispatch an onChange once items are loaded. This account for when a consumer wants an initial selected item and they're loading them from a server.
39
+ dispatchInputEvent(model.state.inputRef.current, value);
40
+ }
41
+ }
42
+ // eslint-disable-next-line react-hooks/exhaustive-deps
43
+ }, [model.state.inputRef, model.state.items.length]);
19
44
  return {
20
45
  onKeyDown(event) {
21
46
  // Prevent the keys from being enter in the input
@@ -39,8 +64,21 @@ export const useSelectInput = composeHooks(createElemPropsHook(useSelectModel)((
39
64
  }
40
65
  }
41
66
  },
42
- ref: elementRef,
67
+ onChange: handleOnChange,
43
68
  autoComplete: 'off',
44
- defaultValue: model.navigation.getItem(model.state.selectedIds[0], model).textValue || model.state.value,
69
+ // When the hidden input is focused, we want to show the focus/hover states of the input that sits below it.
70
+ onFocus() {
71
+ var _a;
72
+ (_a = textInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
73
+ },
74
+ textInputProps: {
75
+ ref: textInputRef,
76
+ },
77
+ ref: elementRef,
78
+ // Account for the case where an initial item is selected when the Select first renders
79
+ defaultValue: model.state.selectedIds.length > 0 && model.state.items.length > 0
80
+ ? model.navigation.getItem(model.state.selectedIds[0], model).textValue ||
81
+ model.state.value
82
+ : undefined,
45
83
  };
46
84
  }), useComboboxKeyboardTypeAhead, useComboboxResetCursorToSelected, useComboboxMoveCursorToSelected, useComboboxInput);
@@ -1 +1 @@
1
- {"version":3,"file":"useSelectModel.d.ts","sourceRoot":"","sources":["../../../../../select/lib/hooks/useSelectModel.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWzB,CAAC"}
@@ -24,6 +24,5 @@ export const useSelectModel = createModelHook({
24
24
  },
25
25
  contextOverride: useComboboxModel.Context,
26
26
  })(config => {
27
- const model = useComboboxModel(config);
28
- return model;
27
+ return useComboboxModel(config);
29
28
  });
@@ -15,10 +15,10 @@ const StyledTextInput = styled('input')({
15
15
  '&::placeholder': {
16
16
  color: inputColors.placeholder,
17
17
  },
18
- '&:hover': {
18
+ '&:hover, &.hover': {
19
19
  borderColor: inputColors.hoverBorder,
20
20
  },
21
- '&:focus:not([disabled])': {
21
+ '&:focus-visible:not([disabled]), &.focus:not([disabled]), &:focus:not([disabled])': {
22
22
  borderColor: inputColors.focusBorder,
23
23
  boxShadow: `inset 0 0 0 1px ${inputColors.focusBorder}`,
24
24
  outline: 'none',
@@ -41,7 +41,7 @@ const StyledTextInput = styled('input')({
41
41
  width: '100%',
42
42
  }, ({ theme, error }) => {
43
43
  return {
44
- '&:focus:not([disabled])': {
44
+ '&:focus-visible:not([disabled]), &.focus:not([disabled])': {
45
45
  borderColor: theme.canvas.palette.common.focusOutline,
46
46
  boxShadow: `inset 0 0 0 1px ${theme.canvas.palette.common.focusOutline}`,
47
47
  outline: 'none',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "10.3.4",
3
+ "version": "10.3.5",
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",
@@ -50,8 +50,8 @@
50
50
  "@emotion/styled": "^11.6.0",
51
51
  "@popperjs/core": "^2.5.4",
52
52
  "@workday/canvas-colors-web": "^2.0.0",
53
- "@workday/canvas-kit-popup-stack": "^10.3.4",
54
- "@workday/canvas-kit-styling": "^10.3.4",
53
+ "@workday/canvas-kit-popup-stack": "^10.3.5",
54
+ "@workday/canvas-kit-styling": "^10.3.5",
55
55
  "@workday/canvas-system-icons-web": "^3.0.0",
56
56
  "@workday/canvas-tokens-web": "^1.0.0",
57
57
  "@workday/design-assets-types": "^0.2.8",
@@ -69,5 +69,5 @@
69
69
  "@workday/canvas-accent-icons-web": "^3.0.0",
70
70
  "@workday/canvas-applet-icons-web": "^2.0.0"
71
71
  },
72
- "gitHead": "86269e56ac2b18223ec4e6318a63123eabdeef40"
72
+ "gitHead": "ff2e0a2ef7bfedfa90006e0195ac8fcc1039b39c"
73
73
  }
@@ -15,9 +15,9 @@ import {useSelectModel} from './hooks/useSelectModel';
15
15
  import {useSelectCard} from './hooks/useSelectCard';
16
16
  import {useSelectInput} from './hooks/useSelectInput';
17
17
  import {CanvasSystemIcon} from '@workday/design-assets-types';
18
- import {createStyles} from '@workday/canvas-kit-styling';
18
+ import {createStyles, CSProps} from '@workday/canvas-kit-styling';
19
19
 
20
- export interface SelectInputProps extends ExtractProps<typeof TextInput> {
20
+ export interface SelectInputProps extends ExtractProps<typeof TextInput>, CSProps {
21
21
  /**
22
22
  * The Icon to render at the start of the `input`. Use this prop if your options
23
23
  * include icons that you would like to render in the `input` when selected.
@@ -34,11 +34,39 @@ const selectInputStyles = createStyles({
34
34
  },
35
35
  });
36
36
 
37
+ const hiddenSelectStyles = createStyles({
38
+ position: 'absolute',
39
+ top: 0,
40
+ bottom: 0,
41
+ left: 0,
42
+ right: 0,
43
+ opacity: 0,
44
+ cursor: 'default',
45
+ pointerEvents: 'none',
46
+ });
47
+
37
48
  export const SelectInput = createSubcomponent(TextInput)({
38
49
  modelHook: useSelectModel,
39
50
  elemPropsHook: useSelectInput,
40
51
  })<SelectInputProps>(
41
- ({placeholder = 'Choose an option', inputStartIcon, ...elemProps}, Element, model) => {
52
+ (
53
+ {
54
+ placeholder = 'Choose an option',
55
+ inputStartIcon,
56
+ error,
57
+ textInputProps,
58
+ disabled,
59
+ ref,
60
+ onChange,
61
+ onInput,
62
+ onFocus,
63
+ value,
64
+ name,
65
+ ...elemProps
66
+ },
67
+ Element,
68
+ model
69
+ ) => {
42
70
  return (
43
71
  <InputGroup>
44
72
  {inputStartIcon && model.state.selectedIds.length > 0 && (
@@ -46,11 +74,29 @@ export const SelectInput = createSubcomponent(TextInput)({
46
74
  <SystemIcon icon={inputStartIcon} />
47
75
  </InputGroup.InnerStart>
48
76
  )}
77
+ {/* Hidden input to handle ids */}
78
+ <InputGroup.Input
79
+ error={error}
80
+ disabled={disabled}
81
+ className={hiddenSelectStyles}
82
+ tabIndex={-1}
83
+ aria-hidden={true}
84
+ onChange={onChange}
85
+ onInput={onInput}
86
+ value={value}
87
+ onFocus={onFocus}
88
+ name={name}
89
+ ref={ref}
90
+ />
91
+ {/* Visual input */}
49
92
  <InputGroup.Input
50
93
  as={Element}
94
+ disabled={disabled}
51
95
  placeholder={placeholder}
96
+ error={error}
97
+ {...textInputProps}
52
98
  {...mergeStyles(elemProps, [selectInputStyles])}
53
- ></InputGroup.Input>
99
+ />
54
100
  <InputGroup.InnerEnd position="absolute" pointerEvents="none">
55
101
  <SystemIcon icon={caretDownSmallIcon} />
56
102
  </InputGroup.InnerEnd>
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  import {
3
3
  composeHooks,
4
4
  createElemPropsHook,
5
- useForkRef,
6
5
  useLocalRef,
7
6
  useResizeObserver,
7
+ dispatchInputEvent,
8
8
  } from '@workday/canvas-kit-react/common';
9
9
  import {
10
10
  useComboboxInput,
@@ -18,56 +18,98 @@ import {useSelectModel} from './useSelectModel';
18
18
  * `useSelectInput` extends {@link useComboboxInput useComboboxInput} and {@link useComboboxKeyboardTypeAhead useComboboxKeyboardTypeAhead} and adds type ahead functionality and Select-specific [keyboard support](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/).
19
19
  */
20
20
  export const useSelectInput = composeHooks(
21
- createElemPropsHook(useSelectModel)((model, ref, elemProps: {keySofar?: string} = {}) => {
22
- const {localRef, elementRef} = useLocalRef<HTMLInputElement>(
23
- useForkRef(ref as React.Ref<HTMLElement>, ref)
24
- );
21
+ createElemPropsHook(useSelectModel)(
22
+ (model, ref, elemProps: {keySofar?: string; placeholder?: string} = {}) => {
23
+ const {elementRef} = useLocalRef<HTMLInputElement>(ref as any);
24
+ const textInputRef = React.useRef<HTMLInputElement>(null);
25
25
 
26
- useResizeObserver({
27
- ref: localRef,
28
- onResize: data => {
29
- if (model.state.visibility === 'visible') {
30
- // Width of the Input + 2px border + 8px padding
31
- const calculatedWidth = data.width ? data.width + 42 + 8 : 0;
32
- model.events.setWidth(calculatedWidth);
26
+ // Update the text value of the input
27
+ const handleOnChange = (event: React.ChangeEvent<HTMLInputElement>) => {
28
+ const value = model.navigation.getItem(event.target.value, model)?.textValue;
29
+ const nativeInputValue = Object.getOwnPropertyDescriptor(
30
+ Object.getPrototypeOf(textInputRef.current),
31
+ 'value'
32
+ );
33
+ if (nativeInputValue && nativeInputValue.set) {
34
+ nativeInputValue.set.call(textInputRef.current, value);
33
35
  }
34
- },
35
- });
36
+ };
36
37
 
37
- return {
38
- onKeyDown(event: React.KeyboardEvent) {
39
- // Prevent the keys from being enter in the input
40
- if (event.key !== 'Tab') {
41
- event.preventDefault();
42
- }
43
-
44
- // Select should open if Spacebar is typed and nothing has been typed AND the menu is hidden
45
- if (
46
- event.key === 'Spacebar' ||
47
- (event.key === ' ' && model.state.visibility === 'hidden' && elemProps?.keySofar === '')
48
- ) {
49
- model.events.show();
50
- }
51
- // if the menu is visible
38
+ useResizeObserver({
39
+ ref: textInputRef,
40
+ onResize: data => {
41
+ if (model.state.visibility === 'visible') {
42
+ // Width of the Input + 2px border + 8px padding
43
+ const calculatedWidth = data.width ? data.width + 42 + 8 : 0;
44
+ model.events.setWidth(calculatedWidth);
45
+ }
46
+ },
47
+ });
48
+ // The intent is if items are loaded after the component is rendered, it will update the input with the value.
49
+ // **Note: We might need to watch for other things or how often we should do this**
50
+ React.useEffect(() => {
52
51
  if (
53
- (event.key === 'Spacebar' || event.key === ' ') &&
54
- model.state.visibility === 'visible'
52
+ model.state.inputRef.current &&
53
+ model.state.items.length > 0 &&
54
+ model.state.selectedIds[0]
55
55
  ) {
56
- // If key so far is empty, they're done typing, select the item where the cursor is located and hide the menu
57
- if (elemProps?.keySofar === '') {
58
- model.events.select({
59
- id: model.state.cursorId,
60
- });
61
- model.events.hide();
56
+ const value = model.navigation.getItem(model.state.selectedIds[0], model).id;
57
+ if (model.state.inputRef.current.value !== value) {
58
+ // Programmatically dispatch an onChange once items are loaded. This account for when a consumer wants an initial selected item and they're loading them from a server.
59
+ dispatchInputEvent(model.state.inputRef.current, value);
62
60
  }
63
61
  }
64
- },
65
- ref: elementRef,
66
- autoComplete: 'off',
67
- defaultValue:
68
- model.navigation.getItem(model.state.selectedIds[0], model).textValue || model.state.value,
69
- } as const;
70
- }),
62
+ // eslint-disable-next-line react-hooks/exhaustive-deps
63
+ }, [model.state.inputRef, model.state.items.length]);
64
+
65
+ return {
66
+ onKeyDown(event: React.KeyboardEvent) {
67
+ // Prevent the keys from being enter in the input
68
+ if (event.key !== 'Tab') {
69
+ event.preventDefault();
70
+ }
71
+
72
+ // Select should open if Spacebar is typed and nothing has been typed AND the menu is hidden
73
+ if (
74
+ event.key === 'Spacebar' ||
75
+ (event.key === ' ' && model.state.visibility === 'hidden' && elemProps?.keySofar === '')
76
+ ) {
77
+ model.events.show();
78
+ }
79
+ // if the menu is visible
80
+ if (
81
+ (event.key === 'Spacebar' || event.key === ' ') &&
82
+ model.state.visibility === 'visible'
83
+ ) {
84
+ // If key so far is empty, they're done typing, select the item where the cursor is located and hide the menu
85
+ if (elemProps?.keySofar === '') {
86
+ model.events.select({
87
+ id: model.state.cursorId,
88
+ });
89
+ model.events.hide();
90
+ }
91
+ }
92
+ },
93
+ onChange: handleOnChange,
94
+ autoComplete: 'off',
95
+ // When the hidden input is focused, we want to show the focus/hover states of the input that sits below it.
96
+ onFocus() {
97
+ textInputRef.current?.focus();
98
+ },
99
+ textInputProps: {
100
+ ref: textInputRef,
101
+ },
102
+ ref: elementRef,
103
+
104
+ // Account for the case where an initial item is selected when the Select first renders
105
+ defaultValue:
106
+ model.state.selectedIds.length > 0 && model.state.items.length > 0
107
+ ? model.navigation.getItem(model.state.selectedIds[0], model).textValue ||
108
+ model.state.value
109
+ : undefined,
110
+ } as const;
111
+ }
112
+ ),
71
113
  useComboboxKeyboardTypeAhead,
72
114
  useComboboxResetCursorToSelected,
73
115
  useComboboxMoveCursorToSelected,
@@ -25,6 +25,5 @@ export const useSelectModel = createModelHook({
25
25
  },
26
26
  contextOverride: useComboboxModel.Context,
27
27
  })(config => {
28
- const model = useComboboxModel(config);
29
- return model;
28
+ return useComboboxModel(config);
30
29
  });
@@ -38,10 +38,10 @@ const StyledTextInput = styled('input')<
38
38
  '&::placeholder': {
39
39
  color: inputColors.placeholder,
40
40
  },
41
- '&:hover': {
41
+ '&:hover, &.hover': {
42
42
  borderColor: inputColors.hoverBorder,
43
43
  },
44
- '&:focus:not([disabled])': {
44
+ '&:focus-visible:not([disabled]), &.focus:not([disabled]), &:focus:not([disabled])': {
45
45
  borderColor: inputColors.focusBorder,
46
46
  boxShadow: `inset 0 0 0 1px ${inputColors.focusBorder}`,
47
47
  outline: 'none',
@@ -68,7 +68,7 @@ const StyledTextInput = styled('input')<
68
68
  },
69
69
  ({theme, error}) => {
70
70
  return {
71
- '&:focus:not([disabled])': {
71
+ '&:focus-visible:not([disabled]), &.focus:not([disabled])': {
72
72
  borderColor: theme.canvas.palette.common.focusOutline,
73
73
  boxShadow: `inset 0 0 0 1px ${theme.canvas.palette.common.focusOutline}`,
74
74
  outline: 'none',