@carbon/ibm-products 2.70.1 → 2.71.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/carbon.css +317 -216
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +546 -270
- 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 +387 -43
- 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 +229 -54
- 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 +242 -56
- 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/_commonjsHelpers.js +1 -3
- package/es/_virtual/index2.js +2 -6
- package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +4 -0
- package/es/components/ActionSet/ActionSet.js +46 -44
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/Card/Card.d.ts +1 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/es/components/Coachmark/CoachmarkTagline.js +2 -2
- package/es/components/Coachmark/utils/context.d.ts +28 -2
- package/es/components/Coachmark/utils/context.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +11 -4
- package/es/components/CreateModal/CreateModal.d.ts +4 -7
- package/es/components/CreateModal/CreateModal.js +4 -19
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/es/components/EmptyStates/EmptyState.js +0 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/es/components/FilterSummary/FilterSummary.js +2 -1
- package/es/components/Guidebanner/Guidebanner.js +4 -20
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
- package/es/components/InterstitialScreen/index.d.ts +4 -1
- package/es/components/Nav/NavItemLink.js +1 -4
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/es/components/PageHeader/next/PageHeader.js +475 -0
- package/es/components/PageHeader/next/index.d.ts +8 -0
- package/es/components/ScrollGradient/ScrollGradient.js +4 -4
- package/es/components/SidePanel/SidePanel.js +25 -20
- package/es/components/StringFormatter/StringFormatter.js +3 -0
- package/es/components/Tearsheet/Tearsheet.js +4 -7
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/UserAvatar/UserAvatar.js +5 -7
- package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/es/components/UserProfileImage/UserProfileImage.js +12 -6
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +3 -0
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/prop-types/index.js +1 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -3
- package/lib/_virtual/index2.js +2 -8
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/ActionSet/ActionSet.d.ts +4 -0
- package/lib/components/ActionSet/ActionSet.js +46 -43
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/Card/Card.d.ts +1 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
- package/lib/components/Coachmark/utils/context.d.ts +28 -2
- package/lib/components/Coachmark/utils/context.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +11 -4
- package/lib/components/CreateModal/CreateModal.d.ts +4 -7
- package/lib/components/CreateModal/CreateModal.js +4 -19
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/lib/components/EmptyStates/EmptyState.js +0 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/lib/components/FilterSummary/FilterSummary.js +2 -1
- package/lib/components/Guidebanner/Guidebanner.js +4 -20
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
- package/lib/components/InterstitialScreen/index.d.ts +4 -1
- package/lib/components/Nav/NavItemLink.js +1 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/lib/components/PageHeader/next/PageHeader.js +490 -0
- package/lib/components/PageHeader/next/index.d.ts +8 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
- package/lib/components/SidePanel/SidePanel.js +26 -21
- package/lib/components/StringFormatter/StringFormatter.js +3 -0
- package/lib/components/Tearsheet/Tearsheet.js +4 -7
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.js +5 -7
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/package.json +22 -30
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
- package/scss/components/PageHeader/_page-header.scss +198 -0
- package/scss/components/SidePanel/_side-panel.scss +2 -52
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +12 -13
- package/es/_virtual/index3.js +0 -10
- package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/es/components/SidePanel/resizer/Resizer.js +0 -271
- package/es/node_modules/lodash.debounce/index.js +0 -367
- package/lib/_virtual/index3.js +0 -12
- package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/lib/components/SidePanel/resizer/Resizer.js +0 -277
- package/lib/node_modules/lodash.debounce/index.js +0 -369
- /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -156,7 +156,7 @@ const ConditionBlock = props => {
|
|
156
156
|
'aria-setsize': aria.setsize
|
157
157
|
} : {};
|
158
158
|
};
|
159
|
-
const renderChildren = popoverRef => {
|
159
|
+
const renderChildren = (popoverRef, closePopover) => {
|
160
160
|
return /*#__PURE__*/React.createElement(ItemComponent, {
|
161
161
|
conditionState: {
|
162
162
|
property,
|
@@ -167,7 +167,21 @@ const ConditionBlock = props => {
|
|
167
167
|
config: config,
|
168
168
|
"data-name": "valueField",
|
169
169
|
parentRef: popoverRef,
|
170
|
-
type: type
|
170
|
+
type: type,
|
171
|
+
closePopover: closePopover
|
172
|
+
});
|
173
|
+
};
|
174
|
+
const renderItemOption = (popoverRef, closePopover) => {
|
175
|
+
return /*#__PURE__*/React.createElement(ItemOption.ItemOption, {
|
176
|
+
conditionState: {
|
177
|
+
value: property,
|
178
|
+
label: propertyText
|
179
|
+
},
|
180
|
+
onChange: onPropertyChangeHandler,
|
181
|
+
config: {
|
182
|
+
options: inputConfig?.properties
|
183
|
+
},
|
184
|
+
closePopover: closePopover
|
171
185
|
});
|
172
186
|
};
|
173
187
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
@@ -217,17 +231,9 @@ const ConditionBlock = props => {
|
|
217
231
|
condition: condition,
|
218
232
|
type: type,
|
219
233
|
description: description,
|
220
|
-
onChange: onPropertyChangeHandler
|
221
|
-
}, /*#__PURE__*/React.createElement(ItemOption.ItemOption, {
|
222
|
-
conditionState: {
|
223
|
-
value: property,
|
224
|
-
label: propertyText
|
225
|
-
},
|
226
234
|
onChange: onPropertyChangeHandler,
|
227
|
-
|
228
|
-
|
229
|
-
}
|
230
|
-
})), util.checkIsValid(property) && /*#__PURE__*/React.createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
235
|
+
renderChildren: renderItemOption
|
236
|
+
}), util.checkIsValid(property) && /*#__PURE__*/React.createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
231
237
|
label: operator,
|
232
238
|
title: operatorText,
|
233
239
|
"data-name": "operatorField",
|
@@ -18,7 +18,7 @@ interface ConditionBuilderItemProps extends PropsWithChildren {
|
|
18
18
|
description?: string;
|
19
19
|
condition?: Action & Condition;
|
20
20
|
config?: ConfigType;
|
21
|
-
renderChildren?: (ref: Ref<HTMLDivElement
|
21
|
+
renderChildren?: (ref: Ref<HTMLDivElement | null>, closePopover: () => void) => ReactNode;
|
22
22
|
onChange?: (val: string) => void;
|
23
23
|
tabIndex?: number;
|
24
24
|
onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
@@ -91,7 +91,9 @@ const ConditionBuilderItem = _ref => {
|
|
91
91
|
}
|
92
92
|
if (condition.popoverToOpen == currentField) {
|
93
93
|
//current popover need to be opened
|
94
|
-
|
94
|
+
setTimeout(() => {
|
95
|
+
openPopOver();
|
96
|
+
});
|
95
97
|
}
|
96
98
|
} else {
|
97
99
|
// when we change any statement(if/ excl.if) which is not part of condition state, label change is triggered.
|
@@ -128,7 +130,7 @@ const ConditionBuilderItem = _ref => {
|
|
128
130
|
}
|
129
131
|
};
|
130
132
|
const handleKeyDownHandler = evt => {
|
131
|
-
handleKeyboardEvents.handleKeyDownForPopover(evt, conditionBuilderRef, popoverRef);
|
133
|
+
handleKeyboardEvents.handleKeyDownForPopover(evt, conditionBuilderRef, popoverRef, closePopover);
|
132
134
|
if (evt.key === 'Escape') {
|
133
135
|
manageInvalidSelection();
|
134
136
|
}
|
@@ -180,7 +182,7 @@ const ConditionBuilderItem = _ref => {
|
|
180
182
|
className: `${util.blockClass}__item__title`
|
181
183
|
}, title), /*#__PURE__*/React.createElement("div", {
|
182
184
|
className: `${util.blockClass}__popover-content`
|
183
|
-
}, renderChildren ? renderChildren(popoverRef) : children)))));
|
185
|
+
}, renderChildren ? renderChildren(popoverRef, closePopover) : children)))));
|
184
186
|
};
|
185
187
|
ConditionBuilderItem.propTypes = {
|
186
188
|
/**
|
@@ -17,9 +17,10 @@ interface ItemOptionProps {
|
|
17
17
|
isStatement?: boolean;
|
18
18
|
};
|
19
19
|
onChange: (value: string, e: Event) => void;
|
20
|
+
closePopover?: () => void;
|
20
21
|
}
|
21
22
|
export declare const ItemOption: {
|
22
|
-
({ conditionState, config, onChange, }: ItemOptionProps): React.JSX.Element | undefined;
|
23
|
+
({ conditionState, config, onChange, closePopover, }: ItemOptionProps): React.JSX.Element | undefined;
|
23
24
|
propTypes: {
|
24
25
|
/**
|
25
26
|
* current condition object
|
@@ -19,7 +19,8 @@ const ItemOption = _ref => {
|
|
19
19
|
let {
|
20
20
|
conditionState = {},
|
21
21
|
config = {},
|
22
|
-
onChange
|
22
|
+
onChange,
|
23
|
+
closePopover
|
23
24
|
} = _ref;
|
24
25
|
const {
|
25
26
|
popOverSearchThreshold
|
@@ -73,7 +74,9 @@ const ItemOption = _ref => {
|
|
73
74
|
labelText: clearSearchText,
|
74
75
|
closeButtonLabelText: clearSearchText,
|
75
76
|
onChange: onSearchChangeHandler,
|
76
|
-
onKeyDown: evt =>
|
77
|
+
onKeyDown: evt => {
|
78
|
+
util.onKeyDownHandlerForSearch(evt, conditionBuilderRef, closePopover);
|
79
|
+
}
|
77
80
|
})), /*#__PURE__*/React.createElement("ul", {
|
78
81
|
"aria-label": getAriaLabel(),
|
79
82
|
role: "listbox"
|
@@ -12,9 +12,10 @@ interface ItemOptionForValueFieldProps {
|
|
12
12
|
};
|
13
13
|
config: PropertyConfigOption['config'];
|
14
14
|
onChange: (value: any, e?: Event) => void;
|
15
|
+
closePopover?: () => void;
|
15
16
|
}
|
16
17
|
export declare const ItemOptionForValueField: {
|
17
|
-
({ conditionState, config, onChange, }: ItemOptionForValueFieldProps): React.JSX.Element;
|
18
|
+
({ conditionState, config, onChange, closePopover, }: ItemOptionForValueFieldProps): React.JSX.Element;
|
18
19
|
propTypes: {
|
19
20
|
/**
|
20
21
|
* current condition object
|
@@ -20,7 +20,8 @@ const ItemOptionForValueField = _ref => {
|
|
20
20
|
let {
|
21
21
|
conditionState = {},
|
22
22
|
config = {},
|
23
|
-
onChange
|
23
|
+
onChange,
|
24
|
+
closePopover
|
24
25
|
} = _ref;
|
25
26
|
const multiSelectable = util.checkForMultiSelectOperator(conditionState, config);
|
26
27
|
const {
|
@@ -125,7 +126,9 @@ const ItemOptionForValueField = _ref => {
|
|
125
126
|
labelText: clearSearchText,
|
126
127
|
closeButtonLabelText: clearSearchText,
|
127
128
|
onChange: onSearchChangeHandler,
|
128
|
-
onKeyDown: evt =>
|
129
|
+
onKeyDown: evt => {
|
130
|
+
util.onKeyDownHandlerForSearch(evt, conditionBuilderRef, closePopover);
|
131
|
+
}
|
129
132
|
})), multiSelectable && /*#__PURE__*/React.createElement("div", {
|
130
133
|
className: `${util.blockClass}__multiselectSelectionStatusContainer`
|
131
134
|
}, /*#__PURE__*/React.createElement("label", null, selection.length, "/", allOptions.length, " Selected"), /*#__PURE__*/React.createElement(react.Button, {
|
@@ -9,10 +9,18 @@ import { PropertyConfigTime } from '../../ConditionBuilder.types';
|
|
9
9
|
interface ConditionBuilderItemTime {
|
10
10
|
onChange: (value: string | undefined) => void;
|
11
11
|
config: PropertyConfigTime['config'];
|
12
|
+
conditionState: {
|
13
|
+
label?: string;
|
14
|
+
value?: string;
|
15
|
+
};
|
12
16
|
}
|
13
17
|
export declare const ConditionBuilderItemTime: {
|
14
|
-
({ onChange, config, }: ConditionBuilderItemTime): React.JSX.Element;
|
18
|
+
({ onChange, config, conditionState, }: ConditionBuilderItemTime): React.JSX.Element;
|
15
19
|
propTypes: {
|
20
|
+
/**
|
21
|
+
* current condition object
|
22
|
+
*/
|
23
|
+
conditionState: any;
|
16
24
|
/**
|
17
25
|
* current config object that this property is part of
|
18
26
|
*/
|
@@ -16,14 +16,26 @@ var _SelectItem, _SelectItem2;
|
|
16
16
|
const ConditionBuilderItemTime = _ref => {
|
17
17
|
let {
|
18
18
|
onChange,
|
19
|
-
config
|
19
|
+
config,
|
20
|
+
conditionState
|
20
21
|
} = _ref;
|
21
|
-
const
|
22
|
-
|
23
|
-
|
22
|
+
const getInitialValue = itemType => {
|
23
|
+
const itemMap = {
|
24
|
+
time: 0,
|
25
|
+
dayZone: 1,
|
26
|
+
timeZone: 2
|
27
|
+
};
|
28
|
+
return conditionState.value !== 'INVALID' ? conditionState.value?.split(' ')[itemMap[itemType]] ?? undefined : undefined;
|
29
|
+
};
|
30
|
+
const initialTimeValue = getInitialValue('time');
|
31
|
+
const initialDayZone = getInitialValue('dayZone');
|
32
|
+
const initialTimeZone = getInitialValue('timeZone');
|
33
|
+
const [timeValue, setTimeValue] = React.useState(initialTimeValue);
|
34
|
+
const [dayZoneValue, setDayZoneValue] = React.useState(initialDayZone ?? 'AM');
|
35
|
+
const [timeZoneValue, setTimeZoneValue] = React.useState(initialTimeZone ?? config?.timeZones?.[0]);
|
24
36
|
React.useEffect(() => {
|
25
37
|
const timeToUpdate = `${timeValue ?? ''} ${dayZoneValue ?? ''} ${timeZoneValue ?? ''}`;
|
26
|
-
onChange(timeValue ? timeToUpdate :
|
38
|
+
onChange(timeValue ? timeToUpdate : 'INVALID');
|
27
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
28
40
|
}, [timeValue, dayZoneValue, timeZoneValue]);
|
29
41
|
const setTimeZone = evt => {
|
@@ -38,11 +50,13 @@ const ConditionBuilderItemTime = _ref => {
|
|
38
50
|
return /*#__PURE__*/React.createElement("div", {
|
39
51
|
className: `${util.blockClass}__item-time`
|
40
52
|
}, /*#__PURE__*/React.createElement(react.TimePicker, {
|
53
|
+
defaultValue: initialTimeValue,
|
41
54
|
id: "time-picker",
|
42
55
|
labelText: "Select a time",
|
43
56
|
onChange: setTime
|
44
57
|
}, /*#__PURE__*/React.createElement(react.TimePickerSelect, {
|
45
58
|
id: "time-picker-day-zone",
|
59
|
+
defaultValue: initialDayZone,
|
46
60
|
onChange: setDayZone
|
47
61
|
}, _SelectItem || (_SelectItem = /*#__PURE__*/React.createElement(react.SelectItem, {
|
48
62
|
value: "AM",
|
@@ -52,6 +66,7 @@ const ConditionBuilderItemTime = _ref => {
|
|
52
66
|
text: "PM"
|
53
67
|
}))), /*#__PURE__*/React.createElement(react.TimePickerSelect, {
|
54
68
|
id: "time-picker-time-zone",
|
69
|
+
defaultValue: initialTimeZone,
|
55
70
|
onChange: setTimeZone
|
56
71
|
}, config?.timeZones?.map((timeZone, index) => /*#__PURE__*/React.createElement(react.SelectItem, {
|
57
72
|
key: index,
|
@@ -60,6 +75,10 @@ const ConditionBuilderItemTime = _ref => {
|
|
60
75
|
})))));
|
61
76
|
};
|
62
77
|
ConditionBuilderItemTime.propTypes = {
|
78
|
+
/**
|
79
|
+
* current condition object
|
80
|
+
*/
|
81
|
+
conditionState: index.default.object,
|
63
82
|
/**
|
64
83
|
* current config object that this property is part of
|
65
84
|
*/
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export function handleKeyDown(evt: any, conditionBuilderRef: any, variant: any): void;
|
2
|
-
export function handleKeyDownForPopover(evt: any, conditionBuilderRef: any, popoverRef: any): void;
|
2
|
+
export function handleKeyDownForPopover(evt: any, conditionBuilderRef: any, popoverRef: any, closePopover: any): void;
|
@@ -15,18 +15,18 @@ const handleKeyDown = (evt, conditionBuilderRef, variant) => {
|
|
15
15
|
handleKeyPressForMainContent(evt, conditionBuilderRef, variant);
|
16
16
|
}
|
17
17
|
};
|
18
|
-
const handleKeyDownForPopover = (evt, conditionBuilderRef, popoverRef) => {
|
18
|
+
const handleKeyDownForPopover = (evt, conditionBuilderRef, popoverRef, closePopover) => {
|
19
19
|
if (excludeKeyPress(evt)) {
|
20
20
|
return;
|
21
21
|
}
|
22
|
-
handleKeyPressForPopover(evt, popoverRef?.current, conditionBuilderRef);
|
22
|
+
handleKeyPressForPopover(evt, popoverRef?.current, conditionBuilderRef, closePopover);
|
23
23
|
};
|
24
24
|
|
25
25
|
//skipping keyboard handling for date and time fields to get take carbon's
|
26
26
|
const excludeKeyPress = evt => {
|
27
27
|
return !['Escape'].includes(evt.key) && evt.target.closest(`.${util.blockClass}__item-date`);
|
28
28
|
};
|
29
|
-
const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) => {
|
29
|
+
const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef, closePopover) => {
|
30
30
|
const key = evt.key;
|
31
31
|
const isHoldingShiftKey = util.checkForHoldingKey(evt, 'shiftKey');
|
32
32
|
const isMultiSelect = parentContainer.querySelector('ul')?.dataset.multiSelect;
|
@@ -34,6 +34,8 @@ const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) =>
|
|
34
34
|
let allItems = [];
|
35
35
|
if (key === 'Escape') {
|
36
36
|
//focus the corresponding field in which the popover is triggered from
|
37
|
+
|
38
|
+
closePopover?.();
|
37
39
|
util.focusThisField(evt, conditionBuilderRef);
|
38
40
|
evt.preventDefault();
|
39
41
|
evt.stopPropagation();
|
@@ -90,8 +92,8 @@ const handleKeyPressForPopover = (evt, parentContainer, conditionBuilderRef) =>
|
|
90
92
|
if (key === 'Enter' && !isHoldingShiftKey) {
|
91
93
|
if (document.activeElement.type !== 'button') {
|
92
94
|
//for button , enter key is click which already handled by framework, else trigger click
|
95
|
+
closePopover?.();
|
93
96
|
util.focusThisField(evt, conditionBuilderRef);
|
94
|
-
document.activeElement?.click();
|
95
97
|
}
|
96
98
|
}
|
97
99
|
}
|
@@ -10,4 +10,4 @@ export function checkIsValid(item: any): any;
|
|
10
10
|
export function manageTabIndexAndFocus(currentElement: any, conditionBuilderRef: any): void;
|
11
11
|
export function getValue(type: any, value: any, config: any): any;
|
12
12
|
export function checkForMultiSelectOperator(condition: any, config: any): any;
|
13
|
-
export function onKeyDownHandlerForSearch(evt: any, conditionBuilderRef: any): void;
|
13
|
+
export function onKeyDownHandlerForSearch(evt: any, conditionBuilderRef: any, closePopover: any): void;
|
@@ -14,10 +14,16 @@ const NON_HIERARCHICAL_VARIANT = 'Non-Hierarchical';
|
|
14
14
|
const HIERARCHICAL_VARIANT = 'Hierarchical';
|
15
15
|
const focusThisField = (evt, conditionBuilderRef) => {
|
16
16
|
if (evt) {
|
17
|
+
const target = evt.target;
|
18
|
+
const itemRow = evt.target.closest('[role="row"]');
|
19
|
+
const buttonName = evt.target.closest('[role="gridcell"]')?.querySelector('button').dataset.name;
|
17
20
|
setTimeout(() => {
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
const selector = itemRow.querySelector(`button[data-name="${buttonName}"]`);
|
22
|
+
manageTabIndexAndFocus(selector, conditionBuilderRef);
|
23
|
+
if (document.contains(target)) {
|
24
|
+
evt.target.closest('[role="gridcell"]')?.querySelector('button')?.click();
|
25
|
+
evt.target.closest('[role="gridcell"]')?.querySelector('button')?.focus();
|
26
|
+
}
|
21
27
|
}, 0);
|
22
28
|
}
|
23
29
|
};
|
@@ -80,9 +86,10 @@ const checkForMultiSelectOperator = (condition, config) => {
|
|
80
86
|
return condition?.operator === 'oneOf' || config?.operators?.find(operator => condition?.operator === operator.id && operator.isMultiSelect);
|
81
87
|
};
|
82
88
|
//this will close the popover on escape key on search box
|
83
|
-
const onKeyDownHandlerForSearch = (evt, conditionBuilderRef) => {
|
89
|
+
const onKeyDownHandlerForSearch = (evt, conditionBuilderRef, closePopover) => {
|
84
90
|
if (!evt.currentTarget.value && evt.key === 'Escape') {
|
85
91
|
focusThisField(evt, conditionBuilderRef);
|
92
|
+
closePopover?.();
|
86
93
|
}
|
87
94
|
};
|
88
95
|
|
@@ -1,12 +1,11 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2021,
|
2
|
+
* Copyright IBM Corp. 2021, 2025
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import {
|
8
|
-
|
9
|
-
export interface CreateModalProps extends React.ComponentProps<typeof ComposedModal> {
|
7
|
+
import React, { PropsWithChildren, ReactNode } from 'react';
|
8
|
+
export interface CreateModalProps extends PropsWithChildren {
|
10
9
|
/**
|
11
10
|
* Specify an optional className to be applied to the modal root node
|
12
11
|
*/
|
@@ -65,6 +64,4 @@ resource. It is triggered by a user’s action, appears on top of the main page
|
|
65
64
|
content, and is persistent until dismissed. The purpose of this modal should be
|
66
65
|
immediately apparent to the user, with a clear and obvious path to completion.
|
67
66
|
*/
|
68
|
-
export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps &
|
69
|
-
children?: ReactNode | undefined;
|
70
|
-
} & React.RefAttributes<HTMLDivElement>>;
|
67
|
+
export declare let CreateModal: React.ForwardRefExoticComponent<CreateModalProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -18,27 +18,14 @@ var usePortalTarget = require('../../global/js/hooks/usePortalTarget.js');
|
|
18
18
|
|
19
19
|
const componentName = 'CreateModal';
|
20
20
|
const blockClass = `${settings.pkg.prefix}--create-modal`;
|
21
|
-
|
22
|
-
// Custom PropType validator which checks and ensures that the children property has no more than 4 nodes
|
23
|
-
const isValidChildren = () => _ref => {
|
24
|
-
let {
|
25
|
-
children
|
26
|
-
} = _ref;
|
27
|
-
if (children && children.length > 4) {
|
28
|
-
throw new Error('The `CreateModal` component does not take more than 4 nodes as children. This is to ensure that the modal does not overflow. Please remove 1 or more nodes.');
|
29
|
-
}
|
30
|
-
return;
|
31
|
-
};
|
32
21
|
/**
|
33
22
|
* The `CreateModal` component provides a way for a user to quickly generate a new
|
34
23
|
resource. It is triggered by a user’s action, appears on top of the main page
|
35
24
|
content, and is persistent until dismissed. The purpose of this modal should be
|
36
25
|
immediately apparent to the user, with a clear and obvious path to completion.
|
37
26
|
*/
|
38
|
-
exports.CreateModal = /*#__PURE__*/React.forwardRef((
|
39
|
-
|
40
|
-
// The component props, in alphabetical order (for consistency).
|
41
|
-
|
27
|
+
exports.CreateModal = /*#__PURE__*/React.forwardRef((props, ref) => {
|
28
|
+
const {
|
42
29
|
className,
|
43
30
|
children,
|
44
31
|
onRequestClose,
|
@@ -52,9 +39,8 @@ exports.CreateModal = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
52
39
|
primaryButtonText,
|
53
40
|
disableSubmit,
|
54
41
|
selectorPrimaryFocus,
|
55
|
-
// Collect any other property values passed in.
|
56
42
|
...rest
|
57
|
-
} =
|
43
|
+
} = props;
|
58
44
|
const renderPortalUse = usePortalTarget.usePortalTarget(portalTargetIn);
|
59
45
|
return renderPortalUse(/*#__PURE__*/React.createElement(react.ComposedModal, _rollupPluginBabelHelpers.extends({}, rest, {
|
60
46
|
selectorPrimaryFocus: selectorPrimaryFocus,
|
@@ -98,8 +84,7 @@ exports.CreateModal.propTypes = {
|
|
98
84
|
/**
|
99
85
|
* Children refers to all form items within a form inside of the modal's body.
|
100
86
|
*/
|
101
|
-
|
102
|
-
children: isValidChildren(),
|
87
|
+
children: index.default.node,
|
103
88
|
/**
|
104
89
|
* Specify an optional className to be applied to the modal root node
|
105
90
|
*/
|
@@ -18,6 +18,9 @@ type fieldsetLegendTextProps = {
|
|
18
18
|
* Otherwise, use CSS to hide/remove this label text.
|
19
19
|
*/
|
20
20
|
fieldsetLegendText?: string;
|
21
|
+
/**
|
22
|
+
* This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
|
23
|
+
*/
|
21
24
|
fieldsetLegendId?: React.ReactNode;
|
22
25
|
} | {
|
23
26
|
/**
|
@@ -32,6 +35,9 @@ type fieldsetLegendTextProps = {
|
|
32
35
|
* Otherwise, use CSS to hide/remove this label text.
|
33
36
|
*/
|
34
37
|
fieldsetLegendText: string;
|
38
|
+
/**
|
39
|
+
* This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
|
40
|
+
*/
|
35
41
|
fieldsetLegendId: React.ReactNode;
|
36
42
|
};
|
37
43
|
interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
@@ -149,8 +149,16 @@ const DraggableItemsList = _ref => {
|
|
149
149
|
strategy: sortable.verticalListSortingStrategy
|
150
150
|
}, visibleCols.map(colDef => {
|
151
151
|
const colHeaderTitle = getNodeTextContent.getNodeTextContent(colDef.Header);
|
152
|
-
const parts = colHeaderTitle.split(
|
153
|
-
|
152
|
+
// const parts = colHeaderTitle.split(
|
153
|
+
// new RegExp(`(${filterString})`, 'gi')
|
154
|
+
// );
|
155
|
+
// const highlightedText = parts.map((part) =>
|
156
|
+
// part.toLowerCase() === filterString.toLowerCase() ? (
|
157
|
+
// <strong>{part}</strong>
|
158
|
+
// ) : (
|
159
|
+
// part
|
160
|
+
// )
|
161
|
+
// );
|
154
162
|
const isFrozenColumn = !!colDef.sticky;
|
155
163
|
const isDisabled = colDef.disabled;
|
156
164
|
const listContents = /*#__PURE__*/React.createElement(react.Checkbox, {
|
@@ -163,7 +171,8 @@ const DraggableItemsList = _ref => {
|
|
163
171
|
return onSelectColumn(colDef, checked);
|
164
172
|
},
|
165
173
|
id: `${blockClass}__customization-column-${colDef.id}`,
|
166
|
-
labelText: highlightedText
|
174
|
+
labelText: colHeaderTitle //filterString ? highlightedText : colHeaderTitle
|
175
|
+
,
|
167
176
|
className: `${blockClass}__customize-columns-checkbox`,
|
168
177
|
onKeyDown: event => handleCheckboxKeydown(event, colDef)
|
169
178
|
});
|
@@ -1,21 +1,46 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
/**
|
2
|
+
* Copyright IBM Corp. 2022, 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
|
+
import React from 'react';
|
8
|
+
import { SAVED_FILTERS } from './constants';
|
9
|
+
import { Filter } from '../../../../FilterSummary/FilterSummary';
|
10
|
+
type ActionType = typeof SAVED_FILTERS;
|
11
|
+
interface Action {
|
12
|
+
type: ActionType;
|
13
|
+
payload?: any;
|
14
|
+
}
|
15
|
+
export interface ContextType {
|
16
|
+
EventEmitter: any;
|
17
|
+
dispatch: React.Dispatch<Action>;
|
18
|
+
state: {
|
19
|
+
savedFilters: object[];
|
20
|
+
};
|
21
|
+
setPanelOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
22
|
+
panelOpen: boolean;
|
23
|
+
tableId: string;
|
24
|
+
filterTags: Filter[];
|
25
|
+
}
|
26
|
+
export declare const FilterContext: React.Context<ContextType>;
|
27
|
+
export declare const clearSingleFilter: ({ key, value, tableId }: {
|
3
28
|
key: any;
|
4
29
|
value: any;
|
5
30
|
tableId: any;
|
6
|
-
}, setAllFilters: any, state: any, contextTableId: any)
|
7
|
-
export
|
8
|
-
children:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
20
|
-
}
|
21
|
-
|
31
|
+
}, setAllFilters: any, state: any, contextTableId: any) => void;
|
32
|
+
export declare const FilterProvider: {
|
33
|
+
({ children, filters, filterProps, tableId }: {
|
34
|
+
children: any;
|
35
|
+
filters: any;
|
36
|
+
filterProps: any;
|
37
|
+
tableId: any;
|
38
|
+
}): React.JSX.Element;
|
39
|
+
propTypes: {
|
40
|
+
children: any;
|
41
|
+
filterProps: any;
|
42
|
+
filters: any;
|
43
|
+
tableId: any;
|
44
|
+
};
|
45
|
+
};
|
46
|
+
export {};
|
@@ -11,7 +11,7 @@ var React = require('react');
|
|
11
11
|
var index = require('../../../../../_virtual/index.js');
|
12
12
|
var constants = require('./constants.js');
|
13
13
|
|
14
|
-
const FilterContext = /*#__PURE__*/React.createContext();
|
14
|
+
const FilterContext = /*#__PURE__*/React.createContext({});
|
15
15
|
const EventEmitter = {
|
16
16
|
events: {},
|
17
17
|
dispatch: function (event, data) {
|
@@ -4,5 +4,5 @@
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
declare const useFilterContext: () =>
|
7
|
+
declare const useFilterContext: () => import("../FilterProvider").ContextType;
|
8
8
|
export default useFilterContext;
|
@@ -16,8 +16,8 @@ const useFilterContext = () => {
|
|
16
16
|
// get the context
|
17
17
|
const context = React.useContext(FilterProvider.FilterContext);
|
18
18
|
|
19
|
-
// if
|
20
|
-
if (context ===
|
19
|
+
// if empty object, throw an error
|
20
|
+
if (Object.entries(context).length === 0) {
|
21
21
|
throw new Error('useFilterContext was used outside of its Provider');
|
22
22
|
}
|
23
23
|
return context;
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
export const InlineEditContext: React.Context<
|
1
|
+
export const InlineEditContext: React.Context<{
|
2
|
+
state: {};
|
3
|
+
dispatch: ({ type, payload }: {
|
4
|
+
type: any;
|
5
|
+
payload: any;
|
6
|
+
}) => void;
|
7
|
+
}>;
|
2
8
|
export function InlineEditProvider({ children }: {
|
3
9
|
children: any;
|
4
10
|
}): React.JSX.Element;
|
package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js
CHANGED
@@ -12,7 +12,15 @@ var index = require('../../../../../../_virtual/index.js');
|
|
12
12
|
var returnUpdatedActiveCell = require('./returnUpdatedActiveCell.js');
|
13
13
|
var getCellIdAsObject = require('./getCellIdAsObject.js');
|
14
14
|
|
15
|
-
const InlineEditContext = /*#__PURE__*/React.createContext(
|
15
|
+
const InlineEditContext = /*#__PURE__*/React.createContext({
|
16
|
+
state: {},
|
17
|
+
dispatch: _ref => {
|
18
|
+
let {
|
19
|
+
type,
|
20
|
+
payload
|
21
|
+
} = _ref;
|
22
|
+
}
|
23
|
+
});
|
16
24
|
const inlineEditReducer = (state, action) => {
|
17
25
|
switch (action.type) {
|
18
26
|
case 'ADD_GRID_ACTIVE_FOCUS':
|
@@ -89,10 +97,10 @@ const inlineEditReducer = (state, action) => {
|
|
89
97
|
return state;
|
90
98
|
}
|
91
99
|
};
|
92
|
-
const InlineEditProvider =
|
100
|
+
const InlineEditProvider = _ref2 => {
|
93
101
|
let {
|
94
102
|
children
|
95
|
-
} =
|
103
|
+
} = _ref2;
|
96
104
|
const initialState = {};
|
97
105
|
const [state, dispatch] = React.useReducer(inlineEditReducer, initialState);
|
98
106
|
return /*#__PURE__*/React.createElement(InlineEditContext.Provider, {
|
@@ -15,10 +15,20 @@ var react = require('@carbon/react');
|
|
15
15
|
var settings = require('../../../../../settings.js');
|
16
16
|
|
17
17
|
const blockClass = `${settings.pkg.prefix}--datagrid__row-size`;
|
18
|
-
const RowSizeRadioGroup = /*#__PURE__*/React.forwardRef((
|
19
|
-
|
20
|
-
rowSizes
|
21
|
-
|
18
|
+
const RowSizeRadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
19
|
+
const {
|
20
|
+
rowSizes = [{
|
21
|
+
value: 'xl' // 64
|
22
|
+
}, {
|
23
|
+
value: 'lg' // 48
|
24
|
+
}, {
|
25
|
+
value: 'md' // 40
|
26
|
+
}, {
|
27
|
+
value: 'sm' // 32
|
28
|
+
}, {
|
29
|
+
value: 'xs' // 24
|
30
|
+
}],
|
31
|
+
selectedOption = 'lg',
|
22
32
|
onChange,
|
23
33
|
legendText,
|
24
34
|
rowSizeLabels = {
|
@@ -29,7 +39,7 @@ const RowSizeRadioGroup = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
29
39
|
xs: 'Extra small'
|
30
40
|
},
|
31
41
|
tableId
|
32
|
-
} =
|
42
|
+
} = props;
|
33
43
|
return /*#__PURE__*/React.createElement("div", {
|
34
44
|
className: `${blockClass}-dropdown`,
|
35
45
|
role: "presentation",
|
@@ -67,20 +77,6 @@ const getBackwardCompatibleRowSize = rowSize => {
|
|
67
77
|
};
|
68
78
|
return rowSizeMap[rowSize] || rowSize;
|
69
79
|
};
|
70
|
-
RowSizeRadioGroup.defaultProps = {
|
71
|
-
rowSizes: [{
|
72
|
-
value: 'xl' // 64
|
73
|
-
}, {
|
74
|
-
value: 'lg' // 48
|
75
|
-
}, {
|
76
|
-
value: 'md' // 40
|
77
|
-
}, {
|
78
|
-
value: 'sm' // 32
|
79
|
-
}, {
|
80
|
-
value: 'xs' // 24
|
81
|
-
}],
|
82
|
-
selectedOption: 'lg'
|
83
|
-
};
|
84
80
|
RowSizeRadioGroup.propTypes = {
|
85
81
|
legendText: index.default.string,
|
86
82
|
onChange: index.default.func.isRequired,
|