@workday/canvas-kit-react 16.0.0-alpha.0483-next.0 → 16.0.0-alpha.0484-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.
@@ -8,7 +8,7 @@ import {useRef} from 'react';
8
8
  * const value = useConstant(generateUniqueId)
9
9
  */
10
10
  export function useConstant<T>(fn: () => T): T {
11
- const ref = useRef<T>();
11
+ const ref = useRef<T | undefined>(undefined);
12
12
 
13
13
  if (!ref.current) {
14
14
  ref.current = fn();
@@ -10,7 +10,7 @@ const react_1 = require("react");
10
10
  * const value = useConstant(generateUniqueId)
11
11
  */
12
12
  function useConstant(fn) {
13
- const ref = (0, react_1.useRef)();
13
+ const ref = (0, react_1.useRef)(undefined);
14
14
  if (!ref.current) {
15
15
  ref.current = fn();
16
16
  }
@@ -25,7 +25,7 @@ exports.SubmenuPopper = (0, common_1.createSubcomponent)('div')({
25
25
  return ((0, jsx_runtime_1.jsx)(popup_1.Popper, { placement: "right-start", popperOptions: MenuPopper_1.defaultMenuPopperOptions, ...elemProps, children: children }));
26
26
  });
27
27
  const useIntentTimer = (fn, waitMs = 0) => {
28
- const timer = react_1.default.useRef();
28
+ const timer = react_1.default.useRef(undefined);
29
29
  const start = () => {
30
30
  timer.current = window.setTimeout(fn, waitMs);
31
31
  };
@@ -50,7 +50,7 @@ exports.useSubmenuTargetItem = (0, common_1.composeHooks)((0, common_1.subModelH
50
50
  ref: elementRef,
51
51
  };
52
52
  }), (0, common_1.subModelHook)(model => model.UNSTABLE_parentModel, collection_1.useListItemRegister), (0, common_1.createElemPropsHook)(useMenuModel_1.useMenuModel)(model => {
53
- const currentTargetIdRef = react_1.default.useRef();
53
+ const currentTargetIdRef = react_1.default.useRef(undefined);
54
54
  const mouseEnterTimer = useIntentTimer(() => {
55
55
  model.UNSTABLE_parentModel.events.goTo({ id: currentTargetIdRef.current || '' });
56
56
  model.events.show(event);
@@ -28,7 +28,7 @@ const React = __importStar(require("react"));
28
28
  const common_1 = require("@workday/canvas-kit-react/common");
29
29
  const popup_1 = require("@workday/canvas-kit-react/popup");
30
30
  const useIntentTimer = (fn, waitMs = 0) => {
31
- const timer = React.useRef();
31
+ const timer = React.useRef(undefined);
32
32
  const start = () => {
33
33
  timer.current = window.setTimeout(fn, waitMs);
34
34
  };
@@ -7,7 +7,7 @@ import { useRef } from 'react';
7
7
  * const value = useConstant(generateUniqueId)
8
8
  */
9
9
  export function useConstant(fn) {
10
- const ref = useRef();
10
+ const ref = useRef(undefined);
11
11
  if (!ref.current) {
12
12
  ref.current = fn();
13
13
  }
@@ -19,7 +19,7 @@ export const SubmenuPopper = createSubcomponent('div')({
19
19
  return (_jsx(Popper, { placement: "right-start", popperOptions: defaultMenuPopperOptions, ...elemProps, children: children }));
20
20
  });
21
21
  const useIntentTimer = (fn, waitMs = 0) => {
22
- const timer = React.useRef();
22
+ const timer = React.useRef(undefined);
23
23
  const start = () => {
24
24
  timer.current = window.setTimeout(fn, waitMs);
25
25
  };
@@ -44,7 +44,7 @@ export const useSubmenuTargetItem = composeHooks(subModelHook(model => model.UNS
44
44
  ref: elementRef,
45
45
  };
46
46
  }), subModelHook(model => model.UNSTABLE_parentModel, useListItemRegister), createElemPropsHook(useMenuModel)(model => {
47
- const currentTargetIdRef = React.useRef();
47
+ const currentTargetIdRef = React.useRef(undefined);
48
48
  const mouseEnterTimer = useIntentTimer(() => {
49
49
  model.UNSTABLE_parentModel.events.goTo({ id: currentTargetIdRef.current || '' });
50
50
  model.events.show(event);
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { useUniqueId } from '@workday/canvas-kit-react/common';
3
3
  import { useAlwaysCloseOnOutsideClick, useCloseOnEscape, useCloseOnFullscreenExit, useCloseOnTargetHidden, usePopupModel, } from '@workday/canvas-kit-react/popup';
4
4
  const useIntentTimer = (fn, waitMs = 0) => {
5
- const timer = React.useRef();
5
+ const timer = React.useRef(undefined);
6
6
  const start = () => {
7
7
  timer.current = window.setTimeout(fn, waitMs);
8
8
  };
@@ -45,7 +45,7 @@ export const SubmenuPopper = createSubcomponent('div')({
45
45
  });
46
46
 
47
47
  const useIntentTimer = (fn: Function, waitMs: number = 0): {start(): void; clear(): void} => {
48
- const timer = React.useRef() as React.MutableRefObject<number | undefined>;
48
+ const timer = React.useRef<number | undefined>(undefined);
49
49
 
50
50
  const start = () => {
51
51
  timer.current = window.setTimeout(fn, waitMs);
@@ -81,7 +81,7 @@ export const useSubmenuTargetItem = composeHooks(
81
81
  }),
82
82
  subModelHook(model => (model as any).UNSTABLE_parentModel!, useListItemRegister),
83
83
  createElemPropsHook(useMenuModel)(model => {
84
- const currentTargetIdRef = React.useRef<string>();
84
+ const currentTargetIdRef = React.useRef<string | undefined>(undefined);
85
85
  const mouseEnterTimer = useIntentTimer(() => {
86
86
  model.UNSTABLE_parentModel.events.goTo({id: currentTargetIdRef.current || ''});
87
87
  model.events.show(event);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "16.0.0-alpha.0483-next.0",
3
+ "version": "16.0.0-alpha.0484-next.0",
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",
@@ -53,8 +53,8 @@
53
53
  "@tanstack/react-virtual": "^3.13.9",
54
54
  "@workday/canvas-colors-web": "^2.0.0",
55
55
  "@workday/canvas-expressive-icons-web": "1.0.2",
56
- "@workday/canvas-kit-popup-stack": "^16.0.0-alpha.0483-next.0",
57
- "@workday/canvas-kit-styling": "^16.0.0-alpha.0483-next.0",
56
+ "@workday/canvas-kit-popup-stack": "^16.0.0-alpha.0484-next.0",
57
+ "@workday/canvas-kit-styling": "^16.0.0-alpha.0484-next.0",
58
58
  "@workday/canvas-system-icons-web": "4.0.4",
59
59
  "@workday/canvas-tokens-web": "4.4.0-beta.7",
60
60
  "@workday/design-assets-types": "^0.3.0",
@@ -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": "d78aaca7a4894a345fbf05f88ba6e84b41b8028b"
72
+ "gitHead": "3e56c1d93edfd1fe6f2c896ce52884919f1df7f5"
73
73
  }
@@ -10,7 +10,7 @@ import {
10
10
  } from '@workday/canvas-kit-react/popup';
11
11
 
12
12
  const useIntentTimer = (fn: Function, waitMs: number = 0): {start(): void; clear(): void} => {
13
- const timer = React.useRef() as React.MutableRefObject<number | undefined>;
13
+ const timer = React.useRef<number | undefined>(undefined);
14
14
 
15
15
  const start = () => {
16
16
  timer.current = window.setTimeout(fn, waitMs);