@carbon/ibm-products 2.36.0-alpha.27 → 2.37.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.
- package/css/index-full-carbon.css +5404 -5117
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +4 -4
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +820 -61
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +329 -6
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/es/components/Carousel/Carousel.d.ts +46 -2
- package/es/components/Carousel/Carousel.js +36 -21
- package/es/components/Carousel/CarouselItem.d.ts +19 -2
- package/es/components/Carousel/CarouselItem.js +0 -1
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +261 -0
- package/es/components/ConditionBuilder/ConditionBuilder.js +45 -16
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +74 -0
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +112 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +151 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +59 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +52 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +162 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +40 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +82 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/es/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +85 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +145 -0
- package/es/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/es/components/ConditionBuilder/utils/util.js +16 -0
- package/es/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/es/components/Datagrid/useParentDimensions.js +1 -1
- package/es/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/es/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/es/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/es/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/es/components/InterstitialScreen/InterstitialScreen.js +25 -14
- package/es/components/Nav/NavItem.js +1 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/es/components/PageHeader/PageHeader.js +12 -3
- package/es/components/SidePanel/SidePanel.js +1 -1
- package/es/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/es/components/SimpleHeader/SimpleHeader.js +2 -4
- package/es/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/es/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/es/components/Tearsheet/TearsheetShell.js +18 -8
- package/es/components/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/es/components/UserProfileImage/UserProfileImage.js +5 -3
- package/es/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/es/components/WebTerminal/WebTerminal.js +2 -2
- package/es/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/es/global/js/hooks/usePrefersReducedMotion.js +28 -0
- package/es/global/js/utils/Wrap.d.ts +31 -2
- package/es/global/js/utils/Wrap.js +7 -9
- package/es/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/es/global/js/utils/getNodeTextContent.js +1 -1
- package/es/global/js/utils/window.d.ts +2 -0
- package/es/global/js/utils/window.js +12 -0
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2780 -0
- package/lib/_virtual/_rollupPluginBabelHelpers.js +9 -10
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +3 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +8 -2
- package/lib/components/Carousel/Carousel.d.ts +46 -2
- package/lib/components/Carousel/Carousel.js +35 -20
- package/lib/components/Carousel/CarouselItem.d.ts +19 -2
- package/lib/components/Carousel/CarouselItem.js +0 -1
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +21 -0
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +270 -0
- package/lib/components/ConditionBuilder/ConditionBuilder.js +46 -17
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +12 -0
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +83 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +18 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +90 -42
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.d.ts → ConditionBuilderProvider.d.ts} +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderContext/{DataTreeContext.js → ConditionBuilderProvider.js} +27 -8
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.d.ts +22 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/DataConfigs.js +121 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +31 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +44 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +28 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +159 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +67 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +60 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.d.ts +13 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js +170 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +48 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +11 -0
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +90 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.d.ts +15 -0
- package/lib/components/ConditionBuilder/ConditionConnector/ConditionConnector.js +93 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +24 -0
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +153 -0
- package/lib/components/ConditionBuilder/utils/util.d.ts +4 -0
- package/lib/components/ConditionBuilder/utils/util.js +20 -0
- package/lib/components/CreateTearsheet/CreateTearsheet.d.ts +106 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +12 -32
- package/lib/components/Datagrid/useParentDimensions.js +1 -1
- package/lib/components/EditUpdateCards/EditUpdateCards.d.ts +104 -2
- package/lib/components/EditUpdateCards/EditUpdateCards.js +3 -0
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.d.ts +61 -2
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +1 -3
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +97 -2
- package/lib/components/ExpressiveCard/ExpressiveCard.js +4 -0
- package/lib/components/InlineTip/InlineTipButton.d.ts +21 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +100 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.js +24 -13
- package/lib/components/Nav/NavItem.js +2 -2
- package/lib/components/NotificationsPanel/NotificationsPanel.js +5 -6
- package/lib/components/PageHeader/PageHeader.js +11 -2
- package/lib/components/SidePanel/SidePanel.js +1 -1
- package/lib/components/SimpleHeader/SimpleHeader.d.ts +1 -5
- package/lib/components/SimpleHeader/SimpleHeader.js +2 -4
- package/lib/components/Tearsheet/TearsheetNarrow.d.ts +4 -13
- package/lib/components/Tearsheet/TearsheetShell.d.ts +119 -10
- package/lib/components/Tearsheet/TearsheetShell.js +16 -6
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +66 -2
- package/lib/components/UserProfileImage/UserProfileImage.js +5 -3
- package/lib/components/WebTerminal/WebTerminal.d.ts +46 -2
- package/lib/components/WebTerminal/WebTerminal.js +2 -2
- package/lib/global/js/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/lib/global/js/hooks/usePrefersReducedMotion.js +32 -0
- package/lib/global/js/utils/Wrap.d.ts +31 -2
- package/lib/global/js/utils/Wrap.js +7 -9
- package/lib/global/js/utils/getNodeTextContent.d.ts +1 -1
- package/lib/global/js/utils/getNodeTextContent.js +1 -1
- package/lib/global/js/utils/window.d.ts +2 -0
- package/lib/global/js/utils/window.js +16 -0
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +2912 -0
- package/package.json +5 -5
- package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -1
- package/scss/components/ConditionBuilder/_condition-builder.scss +26 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +46 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +194 -0
- package/scss/components/ConditionBuilder/styles/_index.scss +2 -0
- package/scss/components/Guidebanner/_guidebanner.scss +3 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +1 -6
- package/scss/components/Tearsheet/_tearsheet.scss +3 -1
- package/telemetry.yml +3 -0
- package/es/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/es/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/es/global/js/utils/keyboardNavigation.js +0 -33
- package/es/global/js/utils/wrapFocus.d.ts +0 -25
- package/es/global/js/utils/wrapFocus.js +0 -68
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3004
- package/lib/components/ConditionBuilder/assets/sampleInput.d.ts +0 -58
- package/lib/global/js/utils/keyboardNavigation.d.ts +0 -27
- package/lib/global/js/utils/keyboardNavigation.js +0 -39
- package/lib/global/js/utils/wrapFocus.d.ts +0 -25
- package/lib/global/js/utils/wrapFocus.js +0 -73
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-8.js +0 -3136
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export declare const inputData: {
|
|
2
|
-
properties: ({
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
icon: import("@carbon/react/icons").CarbonIconType;
|
|
6
|
-
type: string;
|
|
7
|
-
config: {
|
|
8
|
-
options: {
|
|
9
|
-
label: string;
|
|
10
|
-
id: string;
|
|
11
|
-
}[];
|
|
12
|
-
includeSearch?: undefined;
|
|
13
|
-
min?: undefined;
|
|
14
|
-
step?: undefined;
|
|
15
|
-
unit?: undefined;
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
id: string;
|
|
19
|
-
label: string;
|
|
20
|
-
icon: import("@carbon/react/icons").CarbonIconType;
|
|
21
|
-
type: string;
|
|
22
|
-
config: {
|
|
23
|
-
options: {
|
|
24
|
-
label: string;
|
|
25
|
-
id: string;
|
|
26
|
-
icon: import("@carbon/react/icons").CarbonIconType;
|
|
27
|
-
}[];
|
|
28
|
-
includeSearch: boolean;
|
|
29
|
-
min?: undefined;
|
|
30
|
-
step?: undefined;
|
|
31
|
-
unit?: undefined;
|
|
32
|
-
};
|
|
33
|
-
} | {
|
|
34
|
-
id: string;
|
|
35
|
-
label: string;
|
|
36
|
-
icon: import("@carbon/react/icons").CarbonIconType;
|
|
37
|
-
type: string;
|
|
38
|
-
config: {
|
|
39
|
-
options?: undefined;
|
|
40
|
-
includeSearch?: undefined;
|
|
41
|
-
min?: undefined;
|
|
42
|
-
step?: undefined;
|
|
43
|
-
unit?: undefined;
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
id: string;
|
|
47
|
-
label: string;
|
|
48
|
-
icon: import("@carbon/react/icons").CarbonIconType;
|
|
49
|
-
type: string;
|
|
50
|
-
config: {
|
|
51
|
-
min: number;
|
|
52
|
-
step: number;
|
|
53
|
-
unit: string;
|
|
54
|
-
options?: undefined;
|
|
55
|
-
includeSearch?: undefined;
|
|
56
|
-
};
|
|
57
|
-
})[];
|
|
58
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2016, 2018
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Various utilities to help with a11y work
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* A flag `node.compareDocumentPosition(target)` returns,
|
|
12
|
-
* that indicates `target` is located earlier than `node` in the document or `target` contains `node`.
|
|
13
|
-
*/
|
|
14
|
-
export const DOCUMENT_POSITION_BROAD_PRECEDING: number | false;
|
|
15
|
-
/**
|
|
16
|
-
* A flag `node.compareDocumentPosition(target)` returns,
|
|
17
|
-
* that indicates `target` is located later than `node` in the document or `node` contains `target`.
|
|
18
|
-
*/
|
|
19
|
-
export const DOCUMENT_POSITION_BROAD_FOLLOWING: number | false;
|
|
20
|
-
/**
|
|
21
|
-
* CSS selector that selects major nodes that are sequential-focusable.
|
|
22
|
-
*/
|
|
23
|
-
export const selectorTabbable: "\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\n textarea:not([disabled]):not([tabindex='-1']),\n iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true]\n";
|
|
24
|
-
/**
|
|
25
|
-
* CSS selector that selects major nodes that are click focusable
|
|
26
|
-
*/
|
|
27
|
-
export const selectorFocusable: "\n a[href], area[href], input:not([disabled]),\n button:not([disabled]),select:not([disabled]),\n textarea:not([disabled]),\n iframe, object, embed, *[tabindex]:not([disabled]), *[contenteditable=true]\n";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2024
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Various utilities to help with a11y work
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A flag `node.compareDocumentPosition(target)` returns,
|
|
18
|
-
* that indicates `target` is located earlier than `node` in the document or `target` contains `node`.
|
|
19
|
-
*/
|
|
20
|
-
var DOCUMENT_POSITION_BROAD_PRECEDING =
|
|
21
|
-
// Checks `typeof Node` for `react-docgen`
|
|
22
|
-
typeof Node !== 'undefined' && Node.DOCUMENT_POSITION_PRECEDING | Node.DOCUMENT_POSITION_CONTAINS;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* A flag `node.compareDocumentPosition(target)` returns,
|
|
26
|
-
* that indicates `target` is located later than `node` in the document or `node` contains `target`.
|
|
27
|
-
*/
|
|
28
|
-
var DOCUMENT_POSITION_BROAD_FOLLOWING =
|
|
29
|
-
// Checks `typeof Node` for `react-docgen`
|
|
30
|
-
typeof Node !== 'undefined' && Node.DOCUMENT_POSITION_FOLLOWING | Node.DOCUMENT_POSITION_CONTAINED_BY;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* CSS selector that selects major nodes that are sequential-focusable.
|
|
34
|
-
*/
|
|
35
|
-
var selectorTabbable = "\n a[href], area[href], input:not([disabled]):not([tabindex='-1']),\n button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),\n textarea:not([disabled]):not([tabindex='-1']),\n iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true]\n";
|
|
36
|
-
|
|
37
|
-
exports.DOCUMENT_POSITION_BROAD_FOLLOWING = DOCUMENT_POSITION_BROAD_FOLLOWING;
|
|
38
|
-
exports.DOCUMENT_POSITION_BROAD_PRECEDING = DOCUMENT_POSITION_BROAD_PRECEDING;
|
|
39
|
-
exports.selectorTabbable = selectorTabbable;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export default wrapFocus;
|
|
2
|
-
/**
|
|
3
|
-
* @param {Node} node A DOM node.
|
|
4
|
-
* @param {string[]} selectorsFloatingMenus The CSS selectors that matches floating menus.
|
|
5
|
-
* @returns {boolean} `true` of the given `node` is in a floating menu.
|
|
6
|
-
*/
|
|
7
|
-
export function elementOrParentIsFloatingMenu(node: Node, selectorsFloatingMenus?: string[]): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Ensures the focus is kept in the given `modalNode`, implementing "focus-wrap" behavior.
|
|
10
|
-
* @param {object} options The options.
|
|
11
|
-
* @param {Node} options.bodyNode The DOM node of the inner modal.
|
|
12
|
-
* @param {Node} options.startTrapNode The DOM node of the focus sentinel the is placed earlier next to `modalNode`.
|
|
13
|
-
* @param {Node} options.endTrapNode The DOM node of the focus sentinel the is placed next to `modalNode`.
|
|
14
|
-
* @param {Node} options.currentActiveNode The DOM node that has focus.
|
|
15
|
-
* @param {Node} options.oldActiveNode The DOM node that previously had focus.
|
|
16
|
-
* @param {Node} [options.selectorsFloatingMenus] The CSS selectors that matches floating menus
|
|
17
|
-
*/
|
|
18
|
-
declare function wrapFocus({ bodyNode, startTrapNode, endTrapNode, currentActiveNode, oldActiveNode, selectorsFloatingMenus, }: {
|
|
19
|
-
bodyNode: Node;
|
|
20
|
-
startTrapNode: Node;
|
|
21
|
-
endTrapNode: Node;
|
|
22
|
-
currentActiveNode: Node;
|
|
23
|
-
oldActiveNode: Node;
|
|
24
|
-
selectorsFloatingMenus?: Node | undefined;
|
|
25
|
-
}): void;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright IBM Corp. 2020, 2024
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
'use strict';
|
|
9
|
-
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
|
-
var keyboardNavigation = require('./keyboardNavigation.js');
|
|
13
|
-
var settings = require('../../../settings.js');
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* @param {Node} node A DOM node.
|
|
17
|
-
* @param {string[]} selectorsFloatingMenus The CSS selectors that matches floating menus.
|
|
18
|
-
* @returns {boolean} `true` of the given `node` is in a floating menu.
|
|
19
|
-
*/
|
|
20
|
-
function elementOrParentIsFloatingMenu(node) {
|
|
21
|
-
var selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [".".concat(settings.carbon.prefix, "--overflow-menu-options"), ".".concat(settings.carbon.prefix, "--tooltip"), '.flatpickr-calendar'];
|
|
22
|
-
if (node && typeof node.closest === 'function') {
|
|
23
|
-
return selectorsFloatingMenus.some(function (selector) {
|
|
24
|
-
return node.closest(selector);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Ensures the focus is kept in the given `modalNode`, implementing "focus-wrap" behavior.
|
|
31
|
-
* @param {object} options The options.
|
|
32
|
-
* @param {Node} options.bodyNode The DOM node of the inner modal.
|
|
33
|
-
* @param {Node} options.startTrapNode The DOM node of the focus sentinel the is placed earlier next to `modalNode`.
|
|
34
|
-
* @param {Node} options.endTrapNode The DOM node of the focus sentinel the is placed next to `modalNode`.
|
|
35
|
-
* @param {Node} options.currentActiveNode The DOM node that has focus.
|
|
36
|
-
* @param {Node} options.oldActiveNode The DOM node that previously had focus.
|
|
37
|
-
* @param {Node} [options.selectorsFloatingMenus] The CSS selectors that matches floating menus
|
|
38
|
-
*/
|
|
39
|
-
function wrapFocus(_ref) {
|
|
40
|
-
var bodyNode = _ref.bodyNode,
|
|
41
|
-
startTrapNode = _ref.startTrapNode,
|
|
42
|
-
endTrapNode = _ref.endTrapNode,
|
|
43
|
-
currentActiveNode = _ref.currentActiveNode,
|
|
44
|
-
oldActiveNode = _ref.oldActiveNode,
|
|
45
|
-
selectorsFloatingMenus = _ref.selectorsFloatingMenus;
|
|
46
|
-
if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
|
|
47
|
-
var comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
|
|
48
|
-
if (currentActiveNode === startTrapNode || comparisonResult & keyboardNavigation.DOCUMENT_POSITION_BROAD_PRECEDING) {
|
|
49
|
-
var arrayNodes = Array.from(bodyNode.querySelectorAll(keyboardNavigation.selectorTabbable));
|
|
50
|
-
arrayNodes.reverse();
|
|
51
|
-
var tabbable = arrayNodes.find(function (elem) {
|
|
52
|
-
return Boolean(elem.offsetParent);
|
|
53
|
-
});
|
|
54
|
-
if (tabbable) {
|
|
55
|
-
tabbable.focus();
|
|
56
|
-
} else if (bodyNode !== oldActiveNode) {
|
|
57
|
-
bodyNode.focus();
|
|
58
|
-
}
|
|
59
|
-
} else if (currentActiveNode === endTrapNode || comparisonResult & keyboardNavigation.DOCUMENT_POSITION_BROAD_FOLLOWING) {
|
|
60
|
-
var _tabbable = Array.prototype.find.call(bodyNode.querySelectorAll(keyboardNavigation.selectorTabbable), function (elem) {
|
|
61
|
-
return Boolean(elem.offsetParent);
|
|
62
|
-
});
|
|
63
|
-
if (_tabbable) {
|
|
64
|
-
_tabbable.focus();
|
|
65
|
-
} else if (bodyNode !== oldActiveNode) {
|
|
66
|
-
bodyNode.focus();
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
exports["default"] = wrapFocus;
|
|
73
|
-
exports.elementOrParentIsFloatingMenu = elementOrParentIsFloatingMenu;
|