@elliemae/ds-hooks-focus-trap 3.32.0-rc.6
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/cjs/DSHookOnFirstFocusIn.js +109 -0
- package/dist/cjs/DSHookOnFirstFocusIn.js.map +7 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/react-desc-prop-types.js +51 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/esm/DSHookOnFirstFocusIn.js +79 -0
- package/dist/esm/DSHookOnFirstFocusIn.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/react-desc-prop-types.js +21 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/types/DSHookOnFirstFocusIn.d.ts +11 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +12 -0
- package/package.json +67 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var DSHookOnFirstFocusIn_exports = {};
|
|
30
|
+
__export(DSHookOnFirstFocusIn_exports, {
|
|
31
|
+
UseFocusTrapWithSchema: () => UseFocusTrapWithSchema,
|
|
32
|
+
useFocusTrap: () => useFocusTrap
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DSHookOnFirstFocusIn_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
|
39
|
+
const useFocusTrapProps = {
|
|
40
|
+
firstElementRef: "object",
|
|
41
|
+
lastElementRef: "object",
|
|
42
|
+
onKeyDown: "function"
|
|
43
|
+
};
|
|
44
|
+
const getVariableType = (arg) => {
|
|
45
|
+
if (Array.isArray(arg))
|
|
46
|
+
return "array";
|
|
47
|
+
if (arg === null)
|
|
48
|
+
return "null";
|
|
49
|
+
if (arg === void 0)
|
|
50
|
+
return "undefined";
|
|
51
|
+
return typeof arg;
|
|
52
|
+
};
|
|
53
|
+
const throwTypeError = (validPropKey, invalidProp) => {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Warning: You are trying to pass a not valid "${validPropKey}" property to use a useFocusTrap hook, please provide a valid type.
|
|
56
|
+
|
|
57
|
+
Received: ${getVariableType(invalidProp)}
|
|
58
|
+
Expected: ${useFocusTrapProps[validPropKey]}
|
|
59
|
+
`
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
const throwRequiredError = (validPropKey) => {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`Warning: Please provide a "${validPropKey}" property to use a useFocusTrap hook, this property is required.`
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
const validateProps = (componentProps) => {
|
|
68
|
+
if (componentProps.firstElementRef === void 0) {
|
|
69
|
+
throwRequiredError("firstElementRef");
|
|
70
|
+
}
|
|
71
|
+
if (componentProps.lastElementRef === void 0) {
|
|
72
|
+
throwRequiredError("lastElementRef");
|
|
73
|
+
}
|
|
74
|
+
if (componentProps.firstElementRef && typeof componentProps.firstElementRef !== "object") {
|
|
75
|
+
throwTypeError("firstElementRef", componentProps.firstElementRef);
|
|
76
|
+
}
|
|
77
|
+
if (componentProps.lastElementRef && typeof componentProps.lastElementRef !== "object") {
|
|
78
|
+
throwTypeError("lastElementRef", componentProps.lastElementRef);
|
|
79
|
+
}
|
|
80
|
+
if (componentProps.onKeyDown && typeof componentProps.onKeyDown !== "function") {
|
|
81
|
+
throwTypeError("onKeyDown", componentProps.onKeyDown);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const useFocusTrap = (props) => {
|
|
85
|
+
(0, import_react.useEffect)(() => validateProps(props), [props]);
|
|
86
|
+
const { firstElementRef, lastElementRef, onKeyDown } = props;
|
|
87
|
+
return (0, import_react.useCallback)(
|
|
88
|
+
(e) => {
|
|
89
|
+
if (onKeyDown)
|
|
90
|
+
onKeyDown(e);
|
|
91
|
+
if (e.key === "Tab" && !e.shiftKey && e.target === lastElementRef.current && firstElementRef.current) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
firstElementRef.current.focus();
|
|
95
|
+
}
|
|
96
|
+
if (e.key === "Tab" && e.shiftKey && e.target === firstElementRef.current && lastElementRef.current) {
|
|
97
|
+
e.preventDefault();
|
|
98
|
+
e.stopPropagation();
|
|
99
|
+
lastElementRef.current.focus();
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
[firstElementRef, lastElementRef, onKeyDown]
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
useFocusTrap.displayName = "useFocusTrap";
|
|
106
|
+
const UseFocusTrapWithSchema = (0, import_ds_props_helpers.describe)(useFocusTrap);
|
|
107
|
+
UseFocusTrapWithSchema.propTypes = import_react_desc_prop_types.UseFocusTrapPropTypes;
|
|
108
|
+
UseFocusTrapWithSchema.returnType = import_react_desc_prop_types.UseFocusTrapReturnType;
|
|
109
|
+
//# sourceMappingURL=DSHookOnFirstFocusIn.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSHookOnFirstFocusIn.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect } from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { UseFocusTrapPropTypes, type DSHooksUseFocusTrapT, UseFocusTrapReturnType } from './react-desc-prop-types.js';\n\nconst useFocusTrapProps: { [index: string]: string } = {\n firstElementRef: 'object',\n lastElementRef: 'object',\n onKeyDown: 'function',\n};\n\nconst getVariableType = (arg: unknown): string => {\n if (Array.isArray(arg)) return 'array';\n if (arg === null) return 'null';\n if (arg === undefined) return 'undefined';\n return typeof arg;\n};\n\nconst throwTypeError = (validPropKey: string, invalidProp: unknown): void => {\n throw new Error(\n `Warning: You are trying to pass a not valid \"${validPropKey}\" property to use a useFocusTrap hook, please provide a valid type.\n\n Received: ${getVariableType(invalidProp)}\n Expected: ${useFocusTrapProps[validPropKey]}\n `,\n );\n};\n\nconst throwRequiredError = (validPropKey: string): void => {\n throw new Error(\n `Warning: Please provide a \"${validPropKey}\" property to use a useFocusTrap hook, this property is required.`,\n );\n};\n\nconst validateProps = (componentProps: Record<string, unknown>): void => {\n if (componentProps.firstElementRef === undefined) {\n throwRequiredError('firstElementRef');\n }\n if (componentProps.lastElementRef === undefined) {\n throwRequiredError('lastElementRef');\n }\n if (componentProps.firstElementRef && typeof componentProps.firstElementRef !== 'object') {\n throwTypeError('firstElementRef', componentProps.firstElementRef);\n }\n if (componentProps.lastElementRef && typeof componentProps.lastElementRef !== 'object') {\n throwTypeError('lastElementRef', componentProps.lastElementRef);\n }\n if (componentProps.onKeyDown && typeof componentProps.onKeyDown !== 'function') {\n throwTypeError('onKeyDown', componentProps.onKeyDown);\n }\n};\n\nconst useFocusTrap: DSHooksUseFocusTrapT.UseFocusTrapT & { displayName: string } = (props) => {\n // We need to investigate how to validate references with useValidateTypescriptPropTypes.\n useEffect(() => validateProps(props), [props]);\n\n const { firstElementRef, lastElementRef, onKeyDown } = props;\n\n return useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n // we need to check all the condition before preventing default\n // because we want last-element/first-element tab/shift-tab to keep working\n\n if (e.key === 'Tab' && !e.shiftKey && e.target === lastElementRef.current && firstElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n firstElementRef.current.focus();\n }\n if (e.key === 'Tab' && e.shiftKey && e.target === firstElementRef.current && lastElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n lastElementRef.current.focus();\n }\n },\n [firstElementRef, lastElementRef, onKeyDown],\n );\n};\n\nuseFocusTrap.displayName = 'useFocusTrap';\nconst UseFocusTrapWithSchema = describe(useFocusTrap);\n\nUseFocusTrapWithSchema.propTypes = UseFocusTrapPropTypes;\nUseFocusTrapWithSchema.returnType = UseFocusTrapReturnType;\n\nexport { useFocusTrap, UseFocusTrapWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAuC;AACvC,8BAAyB;AACzB,mCAAyF;AAEzF,MAAM,oBAAiD;AAAA,EACrD,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AACb;AAEA,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ,GAAG;AAAG,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAChB;AAEA,MAAM,iBAAiB,CAAC,cAAsB,gBAA+B;AAC3E,QAAM,IAAI;AAAA,IACR,gDAAgD;AAAA;AAAA,cAEtC,gBAAgB,WAAW;AAAA,cAC3B,kBAAkB,YAAY;AAAA;AAAA,EAE1C;AACF;AAEA,MAAM,qBAAqB,CAAC,iBAA+B;AACzD,QAAM,IAAI;AAAA,IACR,8BAA8B;AAAA,EAChC;AACF;AAEA,MAAM,gBAAgB,CAAC,mBAAkD;AACvE,MAAI,eAAe,oBAAoB,QAAW;AAChD,uBAAmB,iBAAiB;AAAA,EACtC;AACA,MAAI,eAAe,mBAAmB,QAAW;AAC/C,uBAAmB,gBAAgB;AAAA,EACrC;AACA,MAAI,eAAe,mBAAmB,OAAO,eAAe,oBAAoB,UAAU;AACxF,mBAAe,mBAAmB,eAAe,eAAe;AAAA,EAClE;AACA,MAAI,eAAe,kBAAkB,OAAO,eAAe,mBAAmB,UAAU;AACtF,mBAAe,kBAAkB,eAAe,cAAc;AAAA,EAChE;AACA,MAAI,eAAe,aAAa,OAAO,eAAe,cAAc,YAAY;AAC9E,mBAAe,aAAa,eAAe,SAAS;AAAA,EACtD;AACF;AAEA,MAAM,eAA6E,CAAC,UAAU;AAE5F,8BAAU,MAAM,cAAc,KAAK,GAAG,CAAC,KAAK,CAAC;AAE7C,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,IAAI;AAEvD,aAAO;AAAA,IACL,CAAC,MAAM;AACL,UAAI;AAAW,kBAAU,CAAC;AAI1B,UAAI,EAAE,QAAQ,SAAS,CAAC,EAAE,YAAY,EAAE,WAAW,eAAe,WAAW,gBAAgB,SAAS;AACpG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,wBAAgB,QAAQ,MAAM;AAAA,MAChC;AACA,UAAI,EAAE,QAAQ,SAAS,EAAE,YAAY,EAAE,WAAW,gBAAgB,WAAW,eAAe,SAAS;AACnG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,uBAAe,QAAQ,MAAM;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,gBAAgB,SAAS;AAAA,EAC7C;AACF;AAEA,aAAa,cAAc;AAC3B,MAAM,6BAAyB,kCAAS,YAAY;AAEpD,uBAAuB,YAAY;AACnC,uBAAuB,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
UseFocusTrapWithSchema: () => import_DSHookOnFirstFocusIn.UseFocusTrapWithSchema,
|
|
32
|
+
useFocusTrap: () => import_DSHookOnFirstFocusIn.useFocusTrap
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_DSHookOnFirstFocusIn = require("./DSHookOnFirstFocusIn.js");
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { useFocusTrap, UseFocusTrapWithSchema } from './DSHookOnFirstFocusIn.js';\nexport type { DSHooksUseFocusTrapT } from './react-desc-prop-types.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,kCAAqD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_desc_prop_types_exports = {};
|
|
30
|
+
__export(react_desc_prop_types_exports, {
|
|
31
|
+
UseFocusTrapPropTypes: () => UseFocusTrapPropTypes,
|
|
32
|
+
UseFocusTrapReturnType: () => UseFocusTrapReturnType
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(react_desc_prop_types_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
37
|
+
const UseFocusTrapPropTypes = {
|
|
38
|
+
firstElementRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.oneOf([null]), import_ds_props_helpers.PropTypes.node]).description(
|
|
39
|
+
"Reference to the first element in the focus trap."
|
|
40
|
+
).isRequired,
|
|
41
|
+
lastElementRef: import_ds_props_helpers.PropTypes.oneOfType([import_ds_props_helpers.PropTypes.oneOf([null]), import_ds_props_helpers.PropTypes.node]).description(
|
|
42
|
+
"Reference to the second element in the focus trap."
|
|
43
|
+
).isRequired,
|
|
44
|
+
onKeyDown: import_ds_props_helpers.PropTypes.func.description("Optional onKeyDown callback.")
|
|
45
|
+
};
|
|
46
|
+
const UseFocusTrapReturnType = {
|
|
47
|
+
handleOnKeyDown: import_ds_props_helpers.PropTypes.func.description(
|
|
48
|
+
"onKeyDown event handler that must be added to the DOM node that contains the tabbable elements you want to trap."
|
|
49
|
+
).isRequired
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { WeakValidationMap } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSHooksUseFocusTrapT {\n export type UseFocusTrapT = <T extends HTMLElement = HTMLElement, K extends HTMLElement = HTMLElement>({\n firstElementRef,\n lastElementRef,\n onKeyDown,\n }: {\n firstElementRef: React.MutableRefObject<T | null>;\n lastElementRef: React.MutableRefObject<K | null>;\n onKeyDown?: React.KeyboardEventHandler;\n }) => React.KeyboardEventHandler;\n}\n\nexport const UseFocusTrapPropTypes = {\n firstElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the first element in the focus trap.',\n ).isRequired,\n lastElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the second element in the focus trap.',\n ).isRequired,\n onKeyDown: PropTypes.func.description('Optional onKeyDown callback.'),\n} as WeakValidationMap<unknown>;\n\nexport const UseFocusTrapReturnType = {\n handleOnKeyDown: PropTypes.func.description(\n 'onKeyDown event handler that must be added to the DOM node that contains the tabbable elements you want to trap.',\n ).isRequired,\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,8BAA0B;AAcnB,MAAM,wBAAwB;AAAA,EACnC,iBAAiB,kCAAU,UAAU,CAAC,kCAAU,MAAM,CAAC,IAAI,CAAC,GAAG,kCAAU,IAAI,CAAC,EAAE;AAAA,IAC9E;AAAA,EACF,EAAE;AAAA,EACF,gBAAgB,kCAAU,UAAU,CAAC,kCAAU,MAAM,CAAC,IAAI,CAAC,GAAG,kCAAU,IAAI,CAAC,EAAE;AAAA,IAC7E;AAAA,EACF,EAAE;AAAA,EACF,WAAW,kCAAU,KAAK,YAAY,8BAA8B;AACtE;AAEO,MAAM,yBAAyB;AAAA,EACpC,iBAAiB,kCAAU,KAAK;AAAA,IAC9B;AAAA,EACF,EAAE;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useCallback, useEffect } from "react";
|
|
3
|
+
import { describe } from "@elliemae/ds-props-helpers";
|
|
4
|
+
import { UseFocusTrapPropTypes, UseFocusTrapReturnType } from "./react-desc-prop-types.js";
|
|
5
|
+
const useFocusTrapProps = {
|
|
6
|
+
firstElementRef: "object",
|
|
7
|
+
lastElementRef: "object",
|
|
8
|
+
onKeyDown: "function"
|
|
9
|
+
};
|
|
10
|
+
const getVariableType = (arg) => {
|
|
11
|
+
if (Array.isArray(arg))
|
|
12
|
+
return "array";
|
|
13
|
+
if (arg === null)
|
|
14
|
+
return "null";
|
|
15
|
+
if (arg === void 0)
|
|
16
|
+
return "undefined";
|
|
17
|
+
return typeof arg;
|
|
18
|
+
};
|
|
19
|
+
const throwTypeError = (validPropKey, invalidProp) => {
|
|
20
|
+
throw new Error(
|
|
21
|
+
`Warning: You are trying to pass a not valid "${validPropKey}" property to use a useFocusTrap hook, please provide a valid type.
|
|
22
|
+
|
|
23
|
+
Received: ${getVariableType(invalidProp)}
|
|
24
|
+
Expected: ${useFocusTrapProps[validPropKey]}
|
|
25
|
+
`
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
const throwRequiredError = (validPropKey) => {
|
|
29
|
+
throw new Error(
|
|
30
|
+
`Warning: Please provide a "${validPropKey}" property to use a useFocusTrap hook, this property is required.`
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
const validateProps = (componentProps) => {
|
|
34
|
+
if (componentProps.firstElementRef === void 0) {
|
|
35
|
+
throwRequiredError("firstElementRef");
|
|
36
|
+
}
|
|
37
|
+
if (componentProps.lastElementRef === void 0) {
|
|
38
|
+
throwRequiredError("lastElementRef");
|
|
39
|
+
}
|
|
40
|
+
if (componentProps.firstElementRef && typeof componentProps.firstElementRef !== "object") {
|
|
41
|
+
throwTypeError("firstElementRef", componentProps.firstElementRef);
|
|
42
|
+
}
|
|
43
|
+
if (componentProps.lastElementRef && typeof componentProps.lastElementRef !== "object") {
|
|
44
|
+
throwTypeError("lastElementRef", componentProps.lastElementRef);
|
|
45
|
+
}
|
|
46
|
+
if (componentProps.onKeyDown && typeof componentProps.onKeyDown !== "function") {
|
|
47
|
+
throwTypeError("onKeyDown", componentProps.onKeyDown);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const useFocusTrap = (props) => {
|
|
51
|
+
useEffect(() => validateProps(props), [props]);
|
|
52
|
+
const { firstElementRef, lastElementRef, onKeyDown } = props;
|
|
53
|
+
return useCallback(
|
|
54
|
+
(e) => {
|
|
55
|
+
if (onKeyDown)
|
|
56
|
+
onKeyDown(e);
|
|
57
|
+
if (e.key === "Tab" && !e.shiftKey && e.target === lastElementRef.current && firstElementRef.current) {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
e.stopPropagation();
|
|
60
|
+
firstElementRef.current.focus();
|
|
61
|
+
}
|
|
62
|
+
if (e.key === "Tab" && e.shiftKey && e.target === firstElementRef.current && lastElementRef.current) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
lastElementRef.current.focus();
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
[firstElementRef, lastElementRef, onKeyDown]
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
useFocusTrap.displayName = "useFocusTrap";
|
|
72
|
+
const UseFocusTrapWithSchema = describe(useFocusTrap);
|
|
73
|
+
UseFocusTrapWithSchema.propTypes = UseFocusTrapPropTypes;
|
|
74
|
+
UseFocusTrapWithSchema.returnType = UseFocusTrapReturnType;
|
|
75
|
+
export {
|
|
76
|
+
UseFocusTrapWithSchema,
|
|
77
|
+
useFocusTrap
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=DSHookOnFirstFocusIn.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/DSHookOnFirstFocusIn.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useCallback, useEffect } from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { UseFocusTrapPropTypes, type DSHooksUseFocusTrapT, UseFocusTrapReturnType } from './react-desc-prop-types.js';\n\nconst useFocusTrapProps: { [index: string]: string } = {\n firstElementRef: 'object',\n lastElementRef: 'object',\n onKeyDown: 'function',\n};\n\nconst getVariableType = (arg: unknown): string => {\n if (Array.isArray(arg)) return 'array';\n if (arg === null) return 'null';\n if (arg === undefined) return 'undefined';\n return typeof arg;\n};\n\nconst throwTypeError = (validPropKey: string, invalidProp: unknown): void => {\n throw new Error(\n `Warning: You are trying to pass a not valid \"${validPropKey}\" property to use a useFocusTrap hook, please provide a valid type.\n\n Received: ${getVariableType(invalidProp)}\n Expected: ${useFocusTrapProps[validPropKey]}\n `,\n );\n};\n\nconst throwRequiredError = (validPropKey: string): void => {\n throw new Error(\n `Warning: Please provide a \"${validPropKey}\" property to use a useFocusTrap hook, this property is required.`,\n );\n};\n\nconst validateProps = (componentProps: Record<string, unknown>): void => {\n if (componentProps.firstElementRef === undefined) {\n throwRequiredError('firstElementRef');\n }\n if (componentProps.lastElementRef === undefined) {\n throwRequiredError('lastElementRef');\n }\n if (componentProps.firstElementRef && typeof componentProps.firstElementRef !== 'object') {\n throwTypeError('firstElementRef', componentProps.firstElementRef);\n }\n if (componentProps.lastElementRef && typeof componentProps.lastElementRef !== 'object') {\n throwTypeError('lastElementRef', componentProps.lastElementRef);\n }\n if (componentProps.onKeyDown && typeof componentProps.onKeyDown !== 'function') {\n throwTypeError('onKeyDown', componentProps.onKeyDown);\n }\n};\n\nconst useFocusTrap: DSHooksUseFocusTrapT.UseFocusTrapT & { displayName: string } = (props) => {\n // We need to investigate how to validate references with useValidateTypescriptPropTypes.\n useEffect(() => validateProps(props), [props]);\n\n const { firstElementRef, lastElementRef, onKeyDown } = props;\n\n return useCallback(\n (e) => {\n if (onKeyDown) onKeyDown(e);\n // we need to check all the condition before preventing default\n // because we want last-element/first-element tab/shift-tab to keep working\n\n if (e.key === 'Tab' && !e.shiftKey && e.target === lastElementRef.current && firstElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n firstElementRef.current.focus();\n }\n if (e.key === 'Tab' && e.shiftKey && e.target === firstElementRef.current && lastElementRef.current) {\n e.preventDefault();\n e.stopPropagation();\n lastElementRef.current.focus();\n }\n },\n [firstElementRef, lastElementRef, onKeyDown],\n );\n};\n\nuseFocusTrap.displayName = 'useFocusTrap';\nconst UseFocusTrapWithSchema = describe(useFocusTrap);\n\nUseFocusTrapWithSchema.propTypes = UseFocusTrapPropTypes;\nUseFocusTrapWithSchema.returnType = UseFocusTrapReturnType;\n\nexport { useFocusTrap, UseFocusTrapWithSchema };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,aAAa,iBAAiB;AACvC,SAAS,gBAAgB;AACzB,SAAS,uBAAkD,8BAA8B;AAEzF,MAAM,oBAAiD;AAAA,EACrD,iBAAiB;AAAA,EACjB,gBAAgB;AAAA,EAChB,WAAW;AACb;AAEA,MAAM,kBAAkB,CAAC,QAAyB;AAChD,MAAI,MAAM,QAAQ,GAAG;AAAG,WAAO;AAC/B,MAAI,QAAQ;AAAM,WAAO;AACzB,MAAI,QAAQ;AAAW,WAAO;AAC9B,SAAO,OAAO;AAChB;AAEA,MAAM,iBAAiB,CAAC,cAAsB,gBAA+B;AAC3E,QAAM,IAAI;AAAA,IACR,gDAAgD;AAAA;AAAA,cAEtC,gBAAgB,WAAW;AAAA,cAC3B,kBAAkB,YAAY;AAAA;AAAA,EAE1C;AACF;AAEA,MAAM,qBAAqB,CAAC,iBAA+B;AACzD,QAAM,IAAI;AAAA,IACR,8BAA8B;AAAA,EAChC;AACF;AAEA,MAAM,gBAAgB,CAAC,mBAAkD;AACvE,MAAI,eAAe,oBAAoB,QAAW;AAChD,uBAAmB,iBAAiB;AAAA,EACtC;AACA,MAAI,eAAe,mBAAmB,QAAW;AAC/C,uBAAmB,gBAAgB;AAAA,EACrC;AACA,MAAI,eAAe,mBAAmB,OAAO,eAAe,oBAAoB,UAAU;AACxF,mBAAe,mBAAmB,eAAe,eAAe;AAAA,EAClE;AACA,MAAI,eAAe,kBAAkB,OAAO,eAAe,mBAAmB,UAAU;AACtF,mBAAe,kBAAkB,eAAe,cAAc;AAAA,EAChE;AACA,MAAI,eAAe,aAAa,OAAO,eAAe,cAAc,YAAY;AAC9E,mBAAe,aAAa,eAAe,SAAS;AAAA,EACtD;AACF;AAEA,MAAM,eAA6E,CAAC,UAAU;AAE5F,YAAU,MAAM,cAAc,KAAK,GAAG,CAAC,KAAK,CAAC;AAE7C,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,IAAI;AAEvD,SAAO;AAAA,IACL,CAAC,MAAM;AACL,UAAI;AAAW,kBAAU,CAAC;AAI1B,UAAI,EAAE,QAAQ,SAAS,CAAC,EAAE,YAAY,EAAE,WAAW,eAAe,WAAW,gBAAgB,SAAS;AACpG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,wBAAgB,QAAQ,MAAM;AAAA,MAChC;AACA,UAAI,EAAE,QAAQ,SAAS,EAAE,YAAY,EAAE,WAAW,gBAAgB,WAAW,eAAe,SAAS;AACnG,UAAE,eAAe;AACjB,UAAE,gBAAgB;AAClB,uBAAe,QAAQ,MAAM;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,iBAAiB,gBAAgB,SAAS;AAAA,EAC7C;AACF;AAEA,aAAa,cAAc;AAC3B,MAAM,yBAAyB,SAAS,YAAY;AAEpD,uBAAuB,YAAY;AACnC,uBAAuB,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { useFocusTrap, UseFocusTrapWithSchema } from './DSHookOnFirstFocusIn.js';\nexport type { DSHooksUseFocusTrapT } from './react-desc-prop-types.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc,8BAA8B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { PropTypes } from "@elliemae/ds-props-helpers";
|
|
3
|
+
const UseFocusTrapPropTypes = {
|
|
4
|
+
firstElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(
|
|
5
|
+
"Reference to the first element in the focus trap."
|
|
6
|
+
).isRequired,
|
|
7
|
+
lastElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(
|
|
8
|
+
"Reference to the second element in the focus trap."
|
|
9
|
+
).isRequired,
|
|
10
|
+
onKeyDown: PropTypes.func.description("Optional onKeyDown callback.")
|
|
11
|
+
};
|
|
12
|
+
const UseFocusTrapReturnType = {
|
|
13
|
+
handleOnKeyDown: PropTypes.func.description(
|
|
14
|
+
"onKeyDown event handler that must be added to the DOM node that contains the tabbable elements you want to trap."
|
|
15
|
+
).isRequired
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
UseFocusTrapPropTypes,
|
|
19
|
+
UseFocusTrapReturnType
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=react-desc-prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/react-desc-prop-types.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { WeakValidationMap } from 'react';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\n\nexport declare namespace DSHooksUseFocusTrapT {\n export type UseFocusTrapT = <T extends HTMLElement = HTMLElement, K extends HTMLElement = HTMLElement>({\n firstElementRef,\n lastElementRef,\n onKeyDown,\n }: {\n firstElementRef: React.MutableRefObject<T | null>;\n lastElementRef: React.MutableRefObject<K | null>;\n onKeyDown?: React.KeyboardEventHandler;\n }) => React.KeyboardEventHandler;\n}\n\nexport const UseFocusTrapPropTypes = {\n firstElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the first element in the focus trap.',\n ).isRequired,\n lastElementRef: PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.node]).description(\n 'Reference to the second element in the focus trap.',\n ).isRequired,\n onKeyDown: PropTypes.func.description('Optional onKeyDown callback.'),\n} as WeakValidationMap<unknown>;\n\nexport const UseFocusTrapReturnType = {\n handleOnKeyDown: PropTypes.func.description(\n 'onKeyDown event handler that must be added to the DOM node that contains the tabbable elements you want to trap.',\n ).isRequired,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,iBAAiB;AAcnB,MAAM,wBAAwB;AAAA,EACnC,iBAAiB,UAAU,UAAU,CAAC,UAAU,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,EAAE;AAAA,IAC9E;AAAA,EACF,EAAE;AAAA,EACF,gBAAgB,UAAU,UAAU,CAAC,UAAU,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,IAAI,CAAC,EAAE;AAAA,IAC7E;AAAA,EACF,EAAE;AAAA,EACF,WAAW,UAAU,KAAK,YAAY,8BAA8B;AACtE;AAEO,MAAM,yBAAyB;AAAA,EACpC,iBAAiB,UAAU,KAAK;AAAA,IAC9B;AAAA,EACF,EAAE;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type DSHooksUseFocusTrapT } from './react-desc-prop-types.js';
|
|
3
|
+
declare const useFocusTrap: DSHooksUseFocusTrapT.UseFocusTrapT & {
|
|
4
|
+
displayName: string;
|
|
5
|
+
};
|
|
6
|
+
declare const UseFocusTrapWithSchema: import("@elliemae/ds-props-helpers/dist/types/propTypes/types.js").DocumentedReactComponent<{
|
|
7
|
+
firstElementRef: import("react").MutableRefObject<HTMLElement | null>;
|
|
8
|
+
lastElementRef: import("react").MutableRefObject<HTMLElement | null>;
|
|
9
|
+
onKeyDown?: import("react").KeyboardEventHandler<Element> | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
export { useFocusTrap, UseFocusTrapWithSchema };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { WeakValidationMap } from 'react';
|
|
2
|
+
export declare namespace DSHooksUseFocusTrapT {
|
|
3
|
+
type UseFocusTrapT = <T extends HTMLElement = HTMLElement, K extends HTMLElement = HTMLElement>({ firstElementRef, lastElementRef, onKeyDown, }: {
|
|
4
|
+
firstElementRef: React.MutableRefObject<T | null>;
|
|
5
|
+
lastElementRef: React.MutableRefObject<K | null>;
|
|
6
|
+
onKeyDown?: React.KeyboardEventHandler;
|
|
7
|
+
}) => React.KeyboardEventHandler;
|
|
8
|
+
}
|
|
9
|
+
export declare const UseFocusTrapPropTypes: WeakValidationMap<unknown>;
|
|
10
|
+
export declare const UseFocusTrapReturnType: {
|
|
11
|
+
handleOnKeyDown: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
12
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@elliemae/ds-hooks-focus-trap",
|
|
3
|
+
"version": "3.32.0-rc.6",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ICE MT - Dimsum - Hooks Focus Trap",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
9
|
+
"module": "./dist/esm/index.js",
|
|
10
|
+
"main": "./dist/cjs/index.js",
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "./dist/esm/index.js",
|
|
15
|
+
"require": "./dist/cjs/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"*.css",
|
|
20
|
+
"*.scss"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"pnpm": ">=6",
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"author": "ICE MT",
|
|
31
|
+
"jestSonar": {
|
|
32
|
+
"sonar56x": true,
|
|
33
|
+
"reportPath": "reports",
|
|
34
|
+
"reportFile": "tests.xml",
|
|
35
|
+
"indent": 4
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@elliemae/ds-props-helpers": "3.32.0-rc.6"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@elliemae/pui-cli": "~9.0.0-next.31",
|
|
42
|
+
"@elliemae/ds-monorepo-devops": "3.32.0-rc.6"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"lodash": "^4.17.21",
|
|
46
|
+
"react": "~17.0.2",
|
|
47
|
+
"react-dom": "^17.0.2",
|
|
48
|
+
"styled-components": "~5.3.9",
|
|
49
|
+
"styled-system": "^5.1.5"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public",
|
|
53
|
+
"typeSafety": true
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"dev": "cross-env NODE_ENV=development node ../../../scripts/build/build.mjs --watch",
|
|
57
|
+
"test": "pui-cli test --passWithNoTests",
|
|
58
|
+
"lint": "node ../../../scripts/lint.mjs --fix",
|
|
59
|
+
"eslint:fix": "eslint --ext='.js,.jsx,.test.js,.ts,.tsx' --fix --config='../../../.eslintrc.js' src/",
|
|
60
|
+
"dts": "node ../../../scripts/dts.mjs",
|
|
61
|
+
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
62
|
+
"build": "cross-env NODE_ENV=production node ../../../scripts/build/build.mjs",
|
|
63
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
64
|
+
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
65
|
+
"checkDeps": "npm exec ../../util/ds-codemods -- check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
66
|
+
}
|
|
67
|
+
}
|