@kwiz/fluentui 1.0.179 → 1.0.181
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/dist/helpers/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './drag-drop';
|
|
|
4
4
|
export * from './hooks';
|
|
5
5
|
export * from './hooks-events';
|
|
6
6
|
export * from './use-alerts';
|
|
7
|
+
export * from './use-auto-focus-ex';
|
|
7
8
|
export * from './use-controlled-state-tracker';
|
|
8
9
|
export * from './use-highlight';
|
|
9
10
|
export * from './use-is-concurrenct';
|
package/dist/helpers/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './drag-drop';
|
|
|
4
4
|
export * from './hooks';
|
|
5
5
|
export * from './hooks-events';
|
|
6
6
|
export * from './use-alerts';
|
|
7
|
+
export * from './use-auto-focus-ex';
|
|
7
8
|
export * from './use-controlled-state-tracker';
|
|
8
9
|
export * from './use-highlight';
|
|
9
10
|
export * from './use-is-concurrenct';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** better auto-focus that actually works. use the ref on the element you wish to focus.
|
|
2
|
+
* focus set initially, and then again on a timeout - default is 200ms timeout. send 0 to skip the timeout
|
|
3
|
+
*/
|
|
4
|
+
export declare function useAutoFocusEX({ timeout }?: {
|
|
5
|
+
timeout?: number;
|
|
6
|
+
}): {
|
|
7
|
+
set: (newValue: HTMLElement) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useRefWithState } from "./hooks";
|
|
3
|
+
/** better auto-focus that actually works. use the ref on the element you wish to focus.
|
|
4
|
+
* focus set initially, and then again on a timeout - default is 200ms timeout. send 0 to skip the timeout
|
|
5
|
+
*/
|
|
6
|
+
export function useAutoFocusEX({ timeout } = { timeout: 200 }) {
|
|
7
|
+
const focusableRef = useRefWithState();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (focusableRef.ref.current) {
|
|
10
|
+
focusableRef.ref.current.focus();
|
|
11
|
+
if (timeout > 0)
|
|
12
|
+
window.setTimeout(() => focusableRef.ref.current.focus(), timeout);
|
|
13
|
+
}
|
|
14
|
+
}, [focusableRef.value, timeout]);
|
|
15
|
+
return { set: focusableRef.set };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=use-auto-focus-ex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-auto-focus-ex.js","sourceRoot":"","sources":["../../src/helpers/use-auto-focus-ex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,EAAE,OAAO,KAA2B,EAAE,OAAO,EAAE,GAAG,EAAE;IAC/E,MAAM,YAAY,GAAG,eAAe,EAAe,CAAC;IACpD,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YAC3B,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,OAAO,GAAG,CAAC;gBACX,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAClC,OAAO,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,CAAA;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kwiz/fluentui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.181",
|
|
4
4
|
"description": "KWIZ common controls for FluentUI",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/
|
|
34
|
+
"url": "git+https://github.com/SnapOn-Software/fluentui.git"
|
|
35
35
|
},
|
|
36
36
|
"keywords": [
|
|
37
37
|
"KWIZ",
|