@pega/cosmos-react-core 9.0.0-build.9.4 → 9.0.0-build.9.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.
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +6 -4
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +5 -3
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/WeekInput.js +6 -4
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.js +4 -2
- package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
- package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +1 -1
- package/lib/components/FieldGroup/FieldGroupList.utils.js +2 -2
- package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +22 -0
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.d.ts +2 -1
- package/lib/hooks/useItemIntersection.d.ts.map +1 -1
- package/lib/hooks/useItemIntersection.js +10 -6
- package/lib/hooks/useItemIntersection.js.map +1 -1
- package/lib/i18n/default.d.ts +22 -0
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +23 -0
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +22 -0
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/utils/getFocusables.d.ts +4 -2
- package/lib/utils/getFocusables.d.ts.map +1 -1
- package/lib/utils/getFocusables.js +9 -7
- package/lib/utils/getFocusables.js.map +1 -1
- package/lib/utils/isInstance.d.ts +4 -4
- package/lib/utils/isInstance.d.ts.map +1 -1
- package/lib/utils/isInstance.js +20 -8
- package/lib/utils/isInstance.js.map +1 -1
- package/package.json +1 -1
package/lib/i18n/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,QAAA,MAAM,MAAM,GAAI,eAAe,WAAW,KAAG,QAAQ,CAAC,eAAe,CAEpE,CAAC;AACF,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/i18n/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,MAAM,WAAW,CAAC;AAE3C,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAClE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7D,QAAA,MAAM,MAAM,GAAI,eAAe,WAAW,KAAG,QAAQ,CAAC,eAAe,CAEpE,CAAC;AACF,eAAe,MAAM,CAAC;AAEtB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAW,CAAC;AAiB3C,eAAO,MAAM,SAAS,GAAI,WAAW,MAAM,KAAG,KAAK,GAAG,KAErD,CAAC"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { RefObject } from 'react';
|
|
2
|
-
export declare const focusableSelector = "a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]
|
|
2
|
+
export declare const focusableSelector = "a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]";
|
|
3
3
|
/**
|
|
4
4
|
* Returns all valid focusable elements within a given ref.
|
|
5
5
|
* @param container The container element, or reference to the container element, to search for focusable elements within.
|
|
6
6
|
* @param options
|
|
7
7
|
* @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.
|
|
8
|
+
* @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.
|
|
8
9
|
* @returns A list of valid focusable elements within the given ref.
|
|
9
10
|
*/
|
|
10
|
-
declare const getFocusables: (container: RefObject<ParentNode> | ParentNode, { includeActiveEl }?: {
|
|
11
|
+
declare const getFocusables: (container: RefObject<ParentNode> | ParentNode, { includeActiveEl, includeNegativeTabIndex }?: {
|
|
11
12
|
includeActiveEl?: boolean;
|
|
13
|
+
includeNegativeTabIndex?: boolean;
|
|
12
14
|
}) => HTMLElement[];
|
|
13
15
|
export default getFocusables;
|
|
14
16
|
//# sourceMappingURL=getFocusables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFocusables.d.ts","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"getFocusables.d.ts","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,eAAO,MAAM,iBAAiB,oGACqE,CAAC;AAEpG;;;;;;;GAOG;AACH,QAAA,MAAM,aAAa,GACjB,WAAW,SAAS,CAAC,UAAU,CAAC,GAAG,UAAU,EAC7C,+CAGG;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC9B,KACL,WAAW,EAmCb,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import hasProp from './hasProp';
|
|
2
2
|
import getActiveElement from './getActiveElement';
|
|
3
3
|
import createUID from './createUID';
|
|
4
|
-
export const focusableSelector = 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]
|
|
4
|
+
export const focusableSelector = 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]';
|
|
5
5
|
/**
|
|
6
6
|
* Returns all valid focusable elements within a given ref.
|
|
7
7
|
* @param container The container element, or reference to the container element, to search for focusable elements within.
|
|
8
8
|
* @param options
|
|
9
9
|
* @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.
|
|
10
|
+
* @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.
|
|
10
11
|
* @returns A list of valid focusable elements within the given ref.
|
|
11
12
|
*/
|
|
12
|
-
const getFocusables = (container, { includeActiveEl = false } = {}) => {
|
|
13
|
+
const getFocusables = (container, { includeActiveEl = false, includeNegativeTabIndex = false } = {}) => {
|
|
13
14
|
const uid = createUID();
|
|
14
15
|
let activeId = uid;
|
|
15
16
|
let activeEl = null;
|
|
@@ -25,11 +26,12 @@ const getFocusables = (container, { includeActiveEl = false } = {}) => {
|
|
|
25
26
|
selector = `${selector}, [id="${activeId}"]`;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
const focusableElements = [...containerEl.querySelectorAll(selector)].filter(el =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
!el.closest('[inert]'))));
|
|
29
|
+
const focusableElements = [...containerEl.querySelectorAll(selector)].filter(el => {
|
|
30
|
+
const passesTabIndex = includeNegativeTabIndex || el.getAttribute('tabindex') !== '-1';
|
|
31
|
+
return (el instanceof HTMLElement &&
|
|
32
|
+
(el.id === activeId ||
|
|
33
|
+
(!el.hasAttribute('disabled') && !el.closest('[inert]') && passesTabIndex)));
|
|
34
|
+
});
|
|
33
35
|
if (activeEl?.id === uid) {
|
|
34
36
|
activeEl.removeAttribute('id');
|
|
35
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFocusables.js","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,
|
|
1
|
+
{"version":3,"file":"getFocusables.js","sourceRoot":"","sources":["../../src/utils/getFocusables.ts"],"names":[],"mappings":"AAEA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAClD,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC,MAAM,CAAC,MAAM,iBAAiB,GAC5B,iGAAiG,CAAC;AAEpG;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CACpB,SAA6C,EAC7C,EACE,eAAe,GAAG,KAAK,E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jC,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import type { RefObject } from 'react';\n\nimport hasProp from './hasProp';\nimport getActiveElement from './getActiveElement';\nimport createUID from './createUID';\n\nexport const focusableSelector =\n 'a[href], button, input, textarea, select, details, video[controls], audio[controls], [tabindex]';\n\n/**\n * Returns all valid focusable elements within a given ref.\n * @param container The container element, or reference to the container element, to search for focusable elements within.\n * @param options\n * @param options.includeActiveEl If true, the active element will be included in the list, even if it does not match focusable criteria.\n * @param options.includeNegativeTabIndex If true, elements with negative tabindex will be included in the list.\n * @returns A list of valid focusable elements within the given ref.\n */\nconst getFocusables = (\n container: RefObject<ParentNode> | ParentNode,\n {\n includeActiveEl = false,\n includeNegativeTabIndex = false\n }: {\n includeActiveEl?: boolean;\n includeNegativeTabIndex?: boolean;\n } = {}\n): HTMLElement[] => {\n const uid = createUID();\n let activeId = uid;\n let activeEl: ReturnType<typeof getActiveElement> = null;\n\n const containerEl = hasProp(container, 'current') ? container.current : container;\n if (!containerEl) return [];\n\n let selector = focusableSelector;\n\n if (includeActiveEl) {\n activeEl = getActiveElement();\n if (activeEl) {\n activeId = activeEl.id || uid;\n activeEl.id = activeId;\n selector = `${selector}, [id=\"${activeId}\"]`;\n }\n }\n\n const focusableElements = ([...containerEl.querySelectorAll(selector)] as HTMLElement[]).filter(\n el => {\n const passesTabIndex = includeNegativeTabIndex || el.getAttribute('tabindex') !== '-1';\n return (\n el instanceof HTMLElement &&\n (el.id === activeId ||\n (!el.hasAttribute('disabled') && !el.closest('[inert]') && passesTabIndex))\n );\n }\n );\n\n if (activeEl?.id === uid) {\n activeEl.removeAttribute('id');\n }\n\n return focusableElements;\n};\n\nexport default getFocusables;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This function checks if an object is an instance of
|
|
2
|
+
* This function checks if an object is an instance of one of the given types.
|
|
3
3
|
* It works similarly to the `instanceof` operator, but works across frame boundaries.
|
|
4
4
|
*
|
|
5
5
|
* @param obj The object to check.
|
|
6
|
-
* @param
|
|
7
|
-
* @returns True if the object is an instance of the given
|
|
6
|
+
* @param types The constructor functions or classes to check against.
|
|
7
|
+
* @returns True if the object is an instance of one of the given types, false otherwise.
|
|
8
8
|
*/
|
|
9
|
-
declare const isInstance: <T
|
|
9
|
+
declare const isInstance: <T extends (abstract new (...args: never[]) => unknown)[]>(obj: unknown, ...types: T) => obj is InstanceType<T[number]>;
|
|
10
10
|
export default isInstance;
|
|
11
11
|
//# sourceMappingURL=isInstance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInstance.d.ts","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"isInstance.d.ts","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,QAAA,MAAM,UAAU,GAAI,CAAC,SAAS,CAAC,QAAQ,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,EAAE,EAC1E,KAAK,OAAO,EACZ,GAAG,OAAO,CAAC,KACV,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAgC/B,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/lib/utils/isInstance.js
CHANGED
|
@@ -1,20 +1,32 @@
|
|
|
1
|
+
const objTargetString = Object.prototype.toString();
|
|
1
2
|
/**
|
|
2
|
-
* This function checks if an object is an instance of
|
|
3
|
+
* This function checks if an object is an instance of one of the given types.
|
|
3
4
|
* It works similarly to the `instanceof` operator, but works across frame boundaries.
|
|
4
5
|
*
|
|
5
6
|
* @param obj The object to check.
|
|
6
|
-
* @param
|
|
7
|
-
* @returns True if the object is an instance of the given
|
|
7
|
+
* @param types The constructor functions or classes to check against.
|
|
8
|
+
* @returns True if the object is an instance of one of the given types, false otherwise.
|
|
8
9
|
*/
|
|
9
|
-
const isInstance = (obj,
|
|
10
|
-
if (
|
|
10
|
+
const isInstance = (obj, ...types) => {
|
|
11
|
+
if (types.length === 0)
|
|
11
12
|
return false;
|
|
12
|
-
if (obj
|
|
13
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function'))
|
|
14
|
+
return false;
|
|
15
|
+
if (types.some(type => obj instanceof type))
|
|
13
16
|
return true;
|
|
14
|
-
const
|
|
17
|
+
const targetStrings = new Set(types.flatMap(type => {
|
|
18
|
+
const str = Object.prototype.toString.call(type.prototype);
|
|
19
|
+
// If str is '[object Object]', but type.prototype is not Object.prototype bail to avoid false positives.
|
|
20
|
+
if (str === objTargetString && type.prototype !== Object.prototype) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
return str;
|
|
24
|
+
}));
|
|
25
|
+
if (targetStrings.size === 0)
|
|
26
|
+
return false;
|
|
15
27
|
let current = obj;
|
|
16
28
|
while (current) {
|
|
17
|
-
if (Object.prototype.toString.call(current)
|
|
29
|
+
if (targetStrings.has(Object.prototype.toString.call(current))) {
|
|
18
30
|
return true;
|
|
19
31
|
}
|
|
20
32
|
current = Object.getPrototypeOf(current);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isInstance.js","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"isInstance.js","sourceRoot":"","sources":["../../src/utils/isInstance.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;AAEpD;;;;;;;GAOG;AACH,MAAM,UAAU,GAAG,CACjB,GAAY,EACZ,GAAG,KAAQ,EACqB,EAAE;IAClC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAErC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,UAAU,CAAC;QAAE,OAAO,KAAK,CAAC;IAEjF,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,YAAY,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzD,MAAM,aAAa,GAAG,IAAI,GAAG,CAC3B,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3D,yGAAyG;QACzG,IAAI,GAAG,KAAK,eAAe,IAAI,IAAI,CAAC,SAAS,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;YACnE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CACH,CAAC;IAEF,IAAI,aAAa,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3C,IAAI,OAAO,GAAkB,GAAG,CAAC;IACjC,OAAO,OAAO,EAAE,CAAC;QACf,IAAI,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YAC/D,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["const objTargetString = Object.prototype.toString();\n\n/**\n * This function checks if an object is an instance of one of the given types.\n * It works similarly to the `instanceof` operator, but works across frame boundaries.\n *\n * @param obj The object to check.\n * @param types The constructor functions or classes to check against.\n * @returns True if the object is an instance of one of the given types, false otherwise.\n */\nconst isInstance = <T extends (abstract new (...args: never[]) => unknown)[]>(\n obj: unknown,\n ...types: T\n): obj is InstanceType<T[number]> => {\n if (types.length === 0) return false;\n\n if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) return false;\n\n if (types.some(type => obj instanceof type)) return true;\n\n const targetStrings = new Set(\n types.flatMap(type => {\n const str = Object.prototype.toString.call(type.prototype);\n\n // If str is '[object Object]', but type.prototype is not Object.prototype bail to avoid false positives.\n if (str === objTargetString && type.prototype !== Object.prototype) {\n return [];\n }\n\n return str;\n })\n );\n\n if (targetStrings.size === 0) return false;\n\n let current: object | null = obj;\n while (current) {\n if (targetStrings.has(Object.prototype.toString.call(current))) {\n return true;\n }\n\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n};\n\nexport default isInstance;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-core",
|
|
3
|
-
"version": "9.0.0-build.9.
|
|
3
|
+
"version": "9.0.0-build.9.5",
|
|
4
4
|
"description": "Cosmos is a visual design system and UI component collection. Its goal is to empower application developers in their pursuit to create engaging and rewarding user experiences.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|