@carbon/ibm-products 2.45.0 → 2.46.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 +261 -124
- 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 +3 -0
- 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 +81 -86
- 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 +182 -110
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/ActionBar/ActionBarItem.js +1 -1
- package/es/components/Coachmark/Coachmark.d.ts +6 -1
- package/es/components/Coachmark/Coachmark.js +37 -6
- package/es/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +20 -14
- package/es/components/ConditionBuilder/ConditionBuilder.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +8 -5
- package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +4 -2
- package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -3
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +1 -3
- package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +26 -30
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
- package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +6 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +4 -1
- package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +47 -23
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +3 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +6 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +3 -2
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +62 -32
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -0
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +52 -46
- package/es/components/ConditionBuilder/utils/util.d.ts +6 -5
- package/es/components/ConditionBuilder/utils/util.js +35 -17
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +6 -0
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +77 -38
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +4 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +10 -1
- package/es/components/DataSpreadsheet/types/index.d.ts +1 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +33 -1
- package/es/components/Datagrid/types/index.d.ts +14 -2
- package/es/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/es/components/Datagrid/useDisableSelectRows.js +27 -22
- package/es/components/StringFormatter/StringFormatter.js +14 -3
- package/es/components/StringFormatter/utils/enums.d.ts +20 -1
- package/es/components/StringFormatter/utils/enums.js +22 -2
- package/es/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/es/components/Tearsheet/TearsheetShell.js +4 -2
- package/es/global/js/hooks/useFocus.d.ts +1 -0
- package/es/global/js/hooks/useFocus.js +5 -2
- package/es/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1020 -1058
- package/es/node_modules/@carbon/icons-react/es/generated/bucket-9.js +881 -758
- package/lib/components/ActionBar/ActionBarItem.js +1 -1
- package/lib/components/Coachmark/Coachmark.d.ts +6 -1
- package/lib/components/Coachmark/Coachmark.js +36 -5
- package/lib/components/Coachmark/CoachmarkOverlay.js +2 -4
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +1 -7
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +19 -13
- package/lib/components/ConditionBuilder/ConditionBuilder.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderActions/ConditionBuilderActions.js +8 -5
- package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +4 -2
- package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +2 -2
- package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -3
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +1 -3
- package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +25 -29
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +1 -0
- package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +6 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +4 -1
- package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +3 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +46 -22
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemDate/ConditionBuilderItemDate.js +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemNumber/ConditionBuilderItemNumber.js +3 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +6 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemText/ConditionBuilderItemText.js +3 -2
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.d.ts +1 -3
- package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +61 -31
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -0
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +51 -44
- package/lib/components/ConditionBuilder/utils/util.d.ts +6 -5
- package/lib/components/ConditionBuilder/utils/util.js +36 -16
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +6 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +77 -38
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +4 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +10 -1
- package/lib/components/DataSpreadsheet/types/index.d.ts +1 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +34 -10
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilters.js +32 -0
- package/lib/components/Datagrid/types/index.d.ts +14 -2
- package/lib/components/Datagrid/useDisableSelectRows.d.ts +2 -1
- package/lib/components/Datagrid/useDisableSelectRows.js +27 -22
- package/lib/components/StringFormatter/StringFormatter.js +13 -2
- package/lib/components/StringFormatter/utils/enums.d.ts +20 -1
- package/lib/components/StringFormatter/utils/enums.js +23 -1
- package/lib/components/Tearsheet/TearsheetShell.d.ts +1 -1
- package/lib/components/Tearsheet/TearsheetShell.js +3 -1
- package/lib/global/js/hooks/useFocus.d.ts +1 -0
- package/lib/global/js/hooks/useFocus.js +5 -1
- package/lib/node_modules/@carbon/icon-helpers/es/index.js +49 -62
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-2.js +1036 -1074
- package/lib/node_modules/@carbon/icons-react/es/generated/bucket-9.js +946 -823
- package/package.json +6 -6
- package/scss/components/Coachmark/_coachmark-overlay.scss +6 -70
- package/scss/components/Coachmark/_coachmark.scss +5 -4
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +1 -3
- package/scss/components/ConditionBuilder/_condition-builder.scss +4 -0
- package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +6 -1
- package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +1 -1
- package/scss/components/Datagrid/styles/addons/_CustomizeColumnsTearsheet.scss +7 -5
- package/scss/components/Datagrid/styles/addons/_FilterFlyout.scss +5 -4
- package/telemetry.yml +5 -14
@@ -43,7 +43,7 @@ exports.ActionBarItem = /*#__PURE__*/React__default["default"].forwardRef(functi
|
|
43
43
|
className: cx__default["default"](blockClass, className),
|
44
44
|
kind: 'ghost',
|
45
45
|
size: 'md',
|
46
|
-
align: 'bottom-
|
46
|
+
align: 'bottom-end',
|
47
47
|
type: 'button',
|
48
48
|
label: label
|
49
49
|
}), Icon ? /*#__PURE__*/React__default["default"].createElement(Icon, null) : null);
|
@@ -12,6 +12,11 @@ interface CoachmarkProps {
|
|
12
12
|
* @see COACHMARK_ALIGNMENT
|
13
13
|
*/
|
14
14
|
align?: 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-top' | 'left-bottom' | 'right' | 'right-top' | 'right-bottom' | 'top' | 'top-left' | 'top-right';
|
15
|
+
/**
|
16
|
+
* Auto aligns the coachmark based on screen boundaries
|
17
|
+
* Applies only to Tooltip Coachmarks.
|
18
|
+
*/
|
19
|
+
autoAlign?: boolean;
|
15
20
|
/**
|
16
21
|
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
17
22
|
* @see CoachmarkOverlayElements
|
@@ -51,7 +56,7 @@ interface CoachmarkProps {
|
|
51
56
|
positionTune?: {
|
52
57
|
x: number;
|
53
58
|
y: number;
|
54
|
-
}
|
59
|
+
};
|
55
60
|
/**
|
56
61
|
* The optional button or beacon that the user will click to show the Coachmark.
|
57
62
|
*/
|
@@ -21,6 +21,7 @@ var hooks = require('./utils/hooks.js');
|
|
21
21
|
var devtools = require('../../global/js/utils/devtools.js');
|
22
22
|
var settings = require('../../settings.js');
|
23
23
|
var lodash = require('lodash');
|
24
|
+
var react = require('@carbon/react');
|
24
25
|
var useIsomorphicEffect = require('../../global/js/hooks/useIsomorphicEffect.js');
|
25
26
|
|
26
27
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
@@ -28,7 +29,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
29
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
30
31
|
|
31
|
-
var _excluded = ["align", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "
|
32
|
+
var _excluded = ["align", "autoAlign", "children", "className", "onClose", "overlayClassName", "overlayKind", "overlayRef", "positionTune", "portalTarget", "target", "theme"];
|
33
|
+
|
32
34
|
// The block part of our conventional BEM class names (blockClass__E--M).
|
33
35
|
var blockClass = "".concat(settings.pkg.prefix, "--coachmark");
|
34
36
|
var overlayBlockClass = "".concat(blockClass, "-overlay");
|
@@ -46,8 +48,10 @@ var defaults = {
|
|
46
48
|
*/
|
47
49
|
|
48
50
|
exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
51
|
+
var _positionTune$y, _positionTune$x;
|
49
52
|
var _ref$align = _ref.align,
|
50
53
|
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
54
|
+
autoAlign = _ref.autoAlign,
|
51
55
|
children = _ref.children,
|
52
56
|
className = _ref.className,
|
53
57
|
_ref$onClose = _ref.onClose,
|
@@ -56,8 +60,8 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
56
60
|
_ref$overlayKind = _ref.overlayKind,
|
57
61
|
overlayKind = _ref$overlayKind === void 0 ? defaults.overlayKind : _ref$overlayKind,
|
58
62
|
overlayRef = _ref.overlayRef,
|
59
|
-
portalTarget = _ref.portalTarget,
|
60
63
|
positionTune = _ref.positionTune,
|
64
|
+
portalTarget = _ref.portalTarget,
|
61
65
|
target = _ref.target,
|
62
66
|
_ref$theme = _ref.theme,
|
63
67
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
@@ -133,6 +137,10 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
133
137
|
setShouldResetPosition(true);
|
134
138
|
}
|
135
139
|
};
|
140
|
+
var overlayPositionStyle = {
|
141
|
+
top: ((_positionTune$y = positionTune === null || positionTune === void 0 ? void 0 : positionTune.y) !== null && _positionTune$y !== void 0 ? _positionTune$y : 0) - 16,
|
142
|
+
left: ((_positionTune$x = positionTune === null || positionTune === void 0 ? void 0 : positionTune.x) !== null && _positionTune$x !== void 0 ? _positionTune$x : 0) - 16
|
143
|
+
};
|
136
144
|
var contextValue = {
|
137
145
|
buttonProps: {
|
138
146
|
'aria-expanded': isOpen,
|
@@ -148,7 +156,8 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
148
156
|
targetRect: targetRect,
|
149
157
|
targetOffset: targetOffset,
|
150
158
|
align: align,
|
151
|
-
positionTune: positionTune
|
159
|
+
positionTune: positionTune,
|
160
|
+
isOpen: isOpen
|
152
161
|
};
|
153
162
|
var handleResize = lodash.throttle(function () {
|
154
163
|
closeOverlay();
|
@@ -182,7 +191,7 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
182
191
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
183
192
|
className: cx__default["default"](blockClass, "".concat(blockClass, "__").concat(theme), className),
|
184
193
|
ref: _coachmarkRef
|
185
|
-
}, rest, devtools.getDevtoolsProps(componentName)), target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
194
|
+
}, rest, devtools.getDevtoolsProps(componentName)), overlayKind !== 'tooltip' ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, target, isOpen && (portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) && /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
186
195
|
ref: _overlayRef,
|
187
196
|
fixedIsVisible: false,
|
188
197
|
kind: overlayKind,
|
@@ -190,7 +199,23 @@ exports.Coachmark = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
190
199
|
theme: theme,
|
191
200
|
className: cx__default["default"](overlayClassName, "".concat(overlayBlockClass, "--is-visible"))
|
192
201
|
}, children), // Default to `document.body` when `portalNode` is `null`
|
193
|
-
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current))
|
202
|
+
portalNode === null || portalNode === void 0 ? void 0 : portalNode.current)) : /*#__PURE__*/React__default["default"].createElement(react.Popover, {
|
203
|
+
highContrast: true,
|
204
|
+
caret: true,
|
205
|
+
style: _rollupPluginBabelHelpers.objectSpread2({
|
206
|
+
position: 'absolute'
|
207
|
+
}, overlayPositionStyle),
|
208
|
+
align: align,
|
209
|
+
autoAlign: autoAlign,
|
210
|
+
open: isOpen
|
211
|
+
}, target, /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, isOpen && /*#__PURE__*/React__default["default"].createElement(CoachmarkOverlay.CoachmarkOverlay, {
|
212
|
+
ref: _overlayRef,
|
213
|
+
fixedIsVisible: false,
|
214
|
+
kind: overlayKind,
|
215
|
+
onClose: handleClose,
|
216
|
+
theme: theme,
|
217
|
+
className: cx__default["default"](overlayClassName, _rollupPluginBabelHelpers.defineProperty({}, "".concat(overlayBlockClass, "--is-visible"), isOpen))
|
218
|
+
}, children)))));
|
194
219
|
});
|
195
220
|
var overlayRefType = typeof HTMLElement === 'undefined' ? index["default"].object :
|
196
221
|
// eslint-disable-next-line ssr-friendly/no-dom-globals-in-module-scope
|
@@ -213,6 +238,11 @@ exports.Coachmark.propTypes = {
|
|
213
238
|
* @see COACHMARK_ALIGNMENT
|
214
239
|
*/
|
215
240
|
align: index["default"].oneOf(['bottom', 'bottom-left', 'bottom-right', 'left', 'left-top', 'left-bottom', 'right', 'right-top', 'right-bottom', 'top', 'top-left', 'top-right']),
|
241
|
+
/**
|
242
|
+
* Auto aligns the coachmark based on screen boundaries
|
243
|
+
* Applies only to Tooltip Coachmarks.
|
244
|
+
*/
|
245
|
+
autoAlign: index["default"].bool,
|
216
246
|
/**
|
217
247
|
* Coachmark should use a single CoachmarkOverlayElements component as a child.
|
218
248
|
* @see CoachmarkOverlayElements
|
@@ -251,6 +281,7 @@ exports.Coachmark.propTypes = {
|
|
251
281
|
/**
|
252
282
|
* Fine tune the position of the target in pixels. Applies only to Beacons.
|
253
283
|
*/
|
284
|
+
// @ts-ignore
|
254
285
|
positionTune: index["default"].shape({
|
255
286
|
x: index["default"].number,
|
256
287
|
y: index["default"].number
|
@@ -64,7 +64,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
64
64
|
var coachmark = context.useCoachmark();
|
65
65
|
var isBeacon = kind === enums.COACHMARK_OVERLAY_KIND.TOOLTIP;
|
66
66
|
var isDraggable = kind === enums.COACHMARK_OVERLAY_KIND.FLOATING;
|
67
|
-
var isVisible = className
|
67
|
+
var isVisible = className === null || className === void 0 ? void 0 : className.includes('is-visible');
|
68
68
|
var handleKeyPress = function handleKeyPress(event) {
|
69
69
|
var shiftKey = event.shiftKey,
|
70
70
|
key = event.key;
|
@@ -172,9 +172,7 @@ exports.CoachmarkOverlay = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
172
172
|
return /*#__PURE__*/React__default["default"].cloneElement(child, {
|
173
173
|
isVisible: isVisible
|
174
174
|
});
|
175
|
-
}))
|
176
|
-
className: "".concat(blockClass, "__caret")
|
177
|
-
}));
|
175
|
+
})));
|
178
176
|
});
|
179
177
|
function getWindowDimensions() {
|
180
178
|
var _window = window,
|
@@ -35,7 +35,6 @@ var defaults = {
|
|
35
35
|
* Use beacon for the target prop of a Coachmark component.
|
36
36
|
*/
|
37
37
|
exports.CoachmarkBeacon = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
|
38
|
-
var _coachmark$positionTu, _coachmark$positionTu2, _coachmark$positionTu3, _coachmark$positionTu4;
|
39
38
|
var label = _ref.label,
|
40
39
|
className = _ref.className,
|
41
40
|
_ref$kind = _ref.kind,
|
@@ -45,14 +44,9 @@ exports.CoachmarkBeacon = /*#__PURE__*/React__default["default"].forwardRef(func
|
|
45
44
|
if (!coachmark) {
|
46
45
|
return _div || (_div = /*#__PURE__*/React__default["default"].createElement("div", null, "CoachmarkBeacon is to be use exclusively within the target prop of Coachmark"));
|
47
46
|
}
|
48
|
-
var overlayPositionStyle = {
|
49
|
-
top: (_coachmark$positionTu = (_coachmark$positionTu2 = coachmark.positionTune) === null || _coachmark$positionTu2 === void 0 ? void 0 : _coachmark$positionTu2.y) !== null && _coachmark$positionTu !== void 0 ? _coachmark$positionTu : 0,
|
50
|
-
left: (_coachmark$positionTu3 = (_coachmark$positionTu4 = coachmark.positionTune) === null || _coachmark$positionTu4 === void 0 ? void 0 : _coachmark$positionTu4.x) !== null && _coachmark$positionTu3 !== void 0 ? _coachmark$positionTu3 : 0
|
51
|
-
};
|
52
47
|
return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
53
48
|
className: cx__default["default"](blockClass, "".concat(blockClass, "-").concat(kind), className),
|
54
|
-
ref: ref
|
55
|
-
style: overlayPositionStyle
|
49
|
+
ref: ref
|
56
50
|
}, devtools.getDevtoolsProps(componentName), {
|
57
51
|
role: "tooltip"
|
58
52
|
}), /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
@@ -64,7 +64,8 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
64
64
|
isLastCondition = props.isLastCondition;
|
65
65
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
66
66
|
inputConfig = _useContext.inputConfig,
|
67
|
-
variant = _useContext.variant
|
67
|
+
variant = _useContext.variant,
|
68
|
+
conditionBuilderRef = _useContext.conditionBuilderRef;
|
68
69
|
var _useState = React.useState(false),
|
69
70
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
70
71
|
showDeletionPreview = _useState2[0],
|
@@ -80,9 +81,9 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
80
81
|
//filtering the current property to access its properties and config options
|
81
82
|
var getCurrentConfig = function getCurrentConfig(property) {
|
82
83
|
var _inputConfig$properti, _inputConfig$properti2;
|
83
|
-
return (_inputConfig$properti = (_inputConfig$properti2 = inputConfig.properties) === null || _inputConfig$properti2 === void 0 ? void 0 : _inputConfig$properti2.
|
84
|
+
return (_inputConfig$properti = (_inputConfig$properti2 = inputConfig.properties) === null || _inputConfig$properti2 === void 0 ? void 0 : _inputConfig$properti2.find(function (eachProperty) {
|
84
85
|
return eachProperty.id == property;
|
85
|
-
})
|
86
|
+
})) !== null && _inputConfig$properti !== void 0 ? _inputConfig$properti : {};
|
86
87
|
};
|
87
88
|
var _getCurrentConfig = getCurrentConfig(property),
|
88
89
|
icon = _getCurrentConfig.icon,
|
@@ -102,7 +103,7 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
102
103
|
};
|
103
104
|
var ItemComponent = property ? itemComponents[type] : null;
|
104
105
|
var onStatementChangeHandler = function onStatementChangeHandler(v, evt) {
|
105
|
-
util.focusThisField(evt);
|
106
|
+
util.focusThisField(evt, conditionBuilderRef);
|
106
107
|
onStatementChange(v);
|
107
108
|
};
|
108
109
|
var onPropertyChangeHandler = function onPropertyChangeHandler(newProperty) {
|
@@ -110,19 +111,20 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
110
111
|
property: newProperty,
|
111
112
|
operator: undefined,
|
112
113
|
value: '',
|
113
|
-
popoverToOpen: 'operatorField'
|
114
|
+
popoverToOpen: util.checkIsValid(newProperty) ? 'operatorField' : ''
|
114
115
|
}));
|
115
116
|
};
|
116
117
|
var onOperatorChangeHandler = function onOperatorChangeHandler(newOperator) {
|
117
118
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, condition), {}, {
|
118
119
|
operator: newOperator,
|
119
120
|
value: undefined,
|
120
|
-
popoverToOpen: 'valueField'
|
121
|
+
popoverToOpen: util.checkIsValid(newOperator) ? 'valueField' : ''
|
121
122
|
}));
|
122
123
|
};
|
123
|
-
var onValueChangeHandler = function onValueChangeHandler(newValue) {
|
124
|
+
var onValueChangeHandler = function onValueChangeHandler(newValue, evt) {
|
124
125
|
var currentCondition = _rollupPluginBabelHelpers.objectSpread2({}, condition);
|
125
126
|
delete currentCondition.popoverToOpen;
|
127
|
+
util.focusThisField(evt, conditionBuilderRef);
|
126
128
|
onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, currentCondition), {}, {
|
127
129
|
value: newValue
|
128
130
|
}));
|
@@ -158,7 +160,8 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
158
160
|
onChange: onValueChangeHandler,
|
159
161
|
config: config,
|
160
162
|
"data-name": "valueField",
|
161
|
-
parentRef: popoverRef
|
163
|
+
parentRef: popoverRef,
|
164
|
+
type: type
|
162
165
|
});
|
163
166
|
};
|
164
167
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
@@ -189,13 +192,14 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
189
192
|
options: DataConfigs.statementConfig
|
190
193
|
}
|
191
194
|
})), /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
192
|
-
label: label,
|
195
|
+
label: label !== null && label !== void 0 ? label : condition === null || condition === void 0 ? void 0 : condition.property,
|
193
196
|
title: propertyText,
|
194
197
|
renderIcon: icon !== null && icon !== void 0 ? icon : null,
|
195
198
|
className: "".concat(DataConfigs.blockClass, "__property-field"),
|
196
199
|
"data-name": "propertyField",
|
197
200
|
condition: condition,
|
198
|
-
type: type
|
201
|
+
type: type,
|
202
|
+
onChange: onPropertyChangeHandler
|
199
203
|
}, /*#__PURE__*/React__default["default"].createElement(ItemOption.ItemOption, {
|
200
204
|
conditionState: {
|
201
205
|
value: property,
|
@@ -205,12 +209,13 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
205
209
|
config: {
|
206
210
|
options: inputConfig.properties
|
207
211
|
}
|
208
|
-
})), property && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
212
|
+
})), util.checkIsValid(property) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
209
213
|
label: operator,
|
210
214
|
title: operatorText,
|
211
215
|
"data-name": "operatorField",
|
212
216
|
condition: condition,
|
213
|
-
type: type
|
217
|
+
type: type,
|
218
|
+
onChange: onOperatorChangeHandler
|
214
219
|
}, /*#__PURE__*/React__default["default"].createElement(ItemOption.ItemOption, {
|
215
220
|
config: {
|
216
221
|
options: getOperators()
|
@@ -220,7 +225,7 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
220
225
|
label: operatorText
|
221
226
|
},
|
222
227
|
onChange: onOperatorChangeHandler
|
223
|
-
})), property && operator && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
228
|
+
})), util.checkIsValid(property) && util.checkIsValid(operator) && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
|
224
229
|
label: value,
|
225
230
|
type: type,
|
226
231
|
title: label,
|
@@ -228,6 +233,7 @@ var ConditionBlock = function ConditionBlock(props) {
|
|
228
233
|
"data-name": "valueField",
|
229
234
|
condition: condition,
|
230
235
|
config: config,
|
236
|
+
onChange: onValueChangeHandler,
|
231
237
|
renderChildren: renderChildren
|
232
238
|
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
233
239
|
role: "gridcell",
|
@@ -77,7 +77,8 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
77
77
|
popOverSearchThreshold: popOverSearchThreshold,
|
78
78
|
getOptions: getOptions,
|
79
79
|
variant: variant,
|
80
|
-
translateWithId: translateWithId
|
80
|
+
translateWithId: translateWithId,
|
81
|
+
conditionBuilderRef: conditionBuilderRef
|
81
82
|
}, /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
82
83
|
className: cx__default["default"](DataConfigs.blockClass,
|
83
84
|
// Apply the block class to the main HTML element
|
@@ -95,7 +96,6 @@ exports.ConditionBuilder = /*#__PURE__*/React__default["default"].forwardRef(fun
|
|
95
96
|
onKeyDown: handleKeyDownHandler
|
96
97
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderContent["default"], {
|
97
98
|
startConditionLabel: startConditionLabel,
|
98
|
-
conditionBuilderRef: conditionBuilderRef,
|
99
99
|
getConditionState: getConditionState,
|
100
100
|
getActionsState: getActionsState,
|
101
101
|
initialState: initialState,
|
@@ -211,7 +211,7 @@ exports.ConditionBuilder.propTypes = {
|
|
211
211
|
/**
|
212
212
|
* Optional prop, if you need to pass translations to the texts on the component instead of the defined defaults.
|
213
213
|
* This callback function will receive the message id and you need to return the corresponding text for that id.
|
214
|
-
* The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText",
|
214
|
+
* The message id will be one of [ "ifText","addConditionText", "addConditionGroupText", "addSubgroupText", "conditionText", "propertyText", "operatorText", "valueText", "connectorText", "conditionRowText","conditionRowGroupText","conditionBuilderText","actionSectionText", "removeConditionText", "addConditionRowText", "startText", "endText", "clearSearchText", "actionsText", "then", "removeActionText", "addActionText", "invalidText", "invalidNumberWarnText"]
|
215
215
|
]
|
216
216
|
*/
|
217
217
|
translateWithId: index["default"].func,
|
@@ -39,13 +39,14 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
39
39
|
_useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
|
40
40
|
showDeletionPreview = _useState2[0],
|
41
41
|
setShowDeletionPreview = _useState2[1];
|
42
|
-
var _useTranslations = useTranslations.useTranslations(['actionsText', 'then', 'and', 'removeActionText', 'addActionText']),
|
43
|
-
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations,
|
42
|
+
var _useTranslations = useTranslations.useTranslations(['actionsText', 'then', 'and', 'removeActionText', 'addActionText', 'actionSectionText']),
|
43
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 6),
|
44
44
|
actionsText = _useTranslations2[0],
|
45
45
|
thenText = _useTranslations2[1],
|
46
46
|
andText = _useTranslations2[2],
|
47
47
|
removeActionText = _useTranslations2[3],
|
48
|
-
addActionText = _useTranslations2[4]
|
48
|
+
addActionText = _useTranslations2[4],
|
49
|
+
actionSectionText = _useTranslations2[5];
|
49
50
|
var addActionHandler = function addActionHandler() {
|
50
51
|
var action = {
|
51
52
|
id: uuidv4["default"](),
|
@@ -83,7 +84,8 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
83
84
|
level: 4
|
84
85
|
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, actionsText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
85
86
|
className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
|
86
|
-
role: "grid"
|
87
|
+
role: "grid",
|
88
|
+
"aria-label": actionSectionText
|
87
89
|
}, actionState === null || actionState === void 0 ? void 0 : actionState.map(function (action, index) {
|
88
90
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
89
91
|
key: action.id,
|
@@ -133,7 +135,8 @@ var ConditionBuilderActions = function ConditionBuilderActions(_ref) {
|
|
133
135
|
})), actionState.length === index + 1 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
134
136
|
onClick: addActionHandler,
|
135
137
|
className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-left"),
|
136
|
-
buttonLabel: addActionText
|
138
|
+
buttonLabel: addActionText,
|
139
|
+
tabIndex: 0
|
137
140
|
}));
|
138
141
|
}), actionState.length === 0 && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderAdd["default"], {
|
139
142
|
onClick: addActionHandler,
|
@@ -69,14 +69,16 @@ var ConditionBuilderAdd = function ConditionBuilderAdd(_ref) {
|
|
69
69
|
onBlur: hideConditionSubGroupPreviewHandler
|
70
70
|
};
|
71
71
|
};
|
72
|
+
var getAriaLabel = function getAriaLabel() {
|
73
|
+
return buttonLabel ? buttonLabel : !enableSubGroup ? addConditionRowText : undefined;
|
74
|
+
};
|
72
75
|
var wrapperProps = enableSubGroup ? {
|
73
76
|
role: 'gridcell'
|
74
|
-
// 'aria-label': addSubgroupText,
|
75
77
|
} : {};
|
76
78
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
77
79
|
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__add-button-wrapper"),
|
78
80
|
role: !enableSubGroup ? 'gridcell' : 'none',
|
79
|
-
"aria-label":
|
81
|
+
"aria-label": getAriaLabel(),
|
80
82
|
onMouseEnter: showAddSubGroup,
|
81
83
|
onMouseLeave: hideAddSubGroup,
|
82
84
|
onFocus: showAddSubGroup,
|
@@ -45,7 +45,7 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
45
45
|
var Button = function Button() {
|
46
46
|
var _rest$dataName;
|
47
47
|
var dataName = (_rest$dataName = rest['data-name']) !== null && _rest$dataName !== void 0 ? _rest$dataName : '';
|
48
|
-
return /*#__PURE__*/React__default["default"].createElement("button", {
|
48
|
+
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
49
49
|
// role={'gridcell'}
|
50
50
|
tabIndex: tabIndex != undefined ? tabIndex : -1,
|
51
51
|
className: cx__default["default"]([className, "".concat(DataConfigs.blockClass, "__button"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__text-ellipsis"), showToolTip && !hideLabel && !isInvalid), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__invalid-input"), isInvalid)]),
|
@@ -56,7 +56,7 @@ var ConditionBuilderButton = function ConditionBuilderButton(_ref) {
|
|
56
56
|
onMouseEnter: onMouseEnter,
|
57
57
|
onMouseLeave: onMouseLeave,
|
58
58
|
"data-name": dataName
|
59
|
-
}, Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))), isInvalid && (_WarningAltFilled || (_WarningAltFilled = /*#__PURE__*/React__default["default"].createElement(icons.WarningAltFilled, null))));
|
59
|
+
}, rest), Icon && (_Icon || (_Icon = /*#__PURE__*/React__default["default"].createElement(Icon, null))), !hideLabel && (_span || (_span = /*#__PURE__*/React__default["default"].createElement("span", null, label))), isInvalid && (_WarningAltFilled || (_WarningAltFilled = /*#__PURE__*/React__default["default"].createElement(icons.WarningAltFilled, null))));
|
60
60
|
};
|
61
61
|
return hideLabel || showToolTip ? /*#__PURE__*/React__default["default"].createElement(react.Tooltip, _rollupPluginBabelHelpers["extends"]({
|
62
62
|
label: label,
|
@@ -30,7 +30,8 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
30
30
|
onChange = _ref.onChange,
|
31
31
|
rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
|
32
32
|
var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
|
33
|
-
variant = _useContext.variant
|
33
|
+
variant = _useContext.variant,
|
34
|
+
conditionBuilderRef = _useContext.conditionBuilderRef;
|
34
35
|
var _useTranslations = useTranslations.useTranslations(['connectorText']),
|
35
36
|
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 1),
|
36
37
|
connectorText = _useTranslations2[0];
|
@@ -51,10 +52,10 @@ var ConditionConnector = function ConditionConnector(_ref) {
|
|
51
52
|
};
|
52
53
|
var onChangeHandler = function onChangeHandler(op, evt) {
|
53
54
|
onChange(op);
|
54
|
-
util.focusThisField(evt);
|
55
|
+
util.focusThisField(evt, conditionBuilderRef);
|
55
56
|
};
|
56
57
|
return variant == 'tree' ? /*#__PURE__*/React__default["default"].createElement("span", {
|
57
|
-
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__connector
|
58
|
+
className: "".concat(className, " ").concat(DataConfigs.blockClass, "__connector--disabled")
|
58
59
|
}, operator) :
|
59
60
|
/*#__PURE__*/
|
60
61
|
// <div className={className} {...rest}>
|
package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
export default ConditionBuilderContent;
|
2
|
-
declare function ConditionBuilderContent({ startConditionLabel,
|
2
|
+
declare function ConditionBuilderContent({ startConditionLabel, getConditionState, getActionsState, initialState, actions, }: {
|
3
3
|
startConditionLabel: any;
|
4
|
-
conditionBuilderRef: any;
|
5
4
|
getConditionState: any;
|
6
5
|
getActionsState: any;
|
7
6
|
initialState: any;
|
@@ -13,7 +12,6 @@ declare namespace ConditionBuilderContent {
|
|
13
12
|
id: PropTypes.Validator<NonNullable<NonNullable<string | number | null | undefined>>>;
|
14
13
|
label: PropTypes.Validator<string>;
|
15
14
|
}> | null | undefined)[]>;
|
16
|
-
let conditionBuilderRef: PropTypes.Requireable<object>;
|
17
15
|
let getActionsState: PropTypes.Requireable<(...args: any[]) => any>;
|
18
16
|
let getConditionState: PropTypes.Validator<(...args: any[]) => any>;
|
19
17
|
let initialState: PropTypes.Requireable<PropTypes.InferProps<{
|
@@ -28,11 +28,10 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
28
28
|
|
29
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
30
30
|
|
31
|
-
var
|
31
|
+
var _GroupConnector;
|
32
32
|
var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
33
33
|
var _rootState$groups2;
|
34
34
|
var startConditionLabel = _ref.startConditionLabel,
|
35
|
-
conditionBuilderRef = _ref.conditionBuilderRef,
|
36
35
|
getConditionState = _ref.getConditionState,
|
37
36
|
getActionsState = _ref.getActionsState,
|
38
37
|
initialState = _ref.initialState,
|
@@ -50,9 +49,10 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
50
49
|
_useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
|
51
50
|
showConditionGroupPreview = _useState4[0],
|
52
51
|
setShowConditionGroupPreview = _useState4[1];
|
53
|
-
var _useTranslations = useTranslations.useTranslations(['addConditionGroupText']),
|
54
|
-
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations,
|
55
|
-
addConditionGroupText = _useTranslations2[0]
|
52
|
+
var _useTranslations = useTranslations.useTranslations(['addConditionGroupText', 'conditionHeadingText']),
|
53
|
+
_useTranslations2 = _rollupPluginBabelHelpers.slicedToArray(_useTranslations, 2),
|
54
|
+
addConditionGroupText = _useTranslations2[0],
|
55
|
+
conditionHeadingText = _useTranslations2[1];
|
56
56
|
var showConditionGroupPreviewHandler = function showConditionGroupPreviewHandler() {
|
57
57
|
setShowConditionGroupPreview(true);
|
58
58
|
};
|
@@ -118,21 +118,22 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
118
118
|
groups: [].concat(_rollupPluginBabelHelpers.toConsumableArray(rootState.groups), [newGroup])
|
119
119
|
}));
|
120
120
|
};
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
},
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
}
|
121
|
+
if (!isConditionBuilderActive) {
|
122
|
+
return /*#__PURE__*/React__default["default"].createElement(react.Button, {
|
123
|
+
className: "".concat(DataConfigs.blockClass, "__addConditionText-button"),
|
124
|
+
renderIcon: function renderIcon(props) {
|
125
|
+
return /*#__PURE__*/React__default["default"].createElement(icons.Add, props);
|
126
|
+
},
|
127
|
+
iconDescription: startConditionLabel,
|
128
|
+
kind: "ghost",
|
129
|
+
size: "sm",
|
130
|
+
onClick: onStartConditionBuilder
|
131
|
+
}, startConditionLabel);
|
132
|
+
}
|
133
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(react.Section, {
|
133
134
|
className: "".concat(DataConfigs.blockClass, "__heading"),
|
134
135
|
level: 4
|
135
|
-
},
|
136
|
+
}, /*#__PURE__*/React__default["default"].createElement(react.Heading, null, conditionHeadingText)), /*#__PURE__*/React__default["default"].createElement("div", {
|
136
137
|
className: "".concat(DataConfigs.blockClass, "__content-container"),
|
137
138
|
role: "treegrid",
|
138
139
|
"aria-label": "condition builder tree"
|
@@ -153,13 +154,13 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
153
154
|
},
|
154
155
|
onChange: function onChange(updatedGroup) {
|
155
156
|
onChangeHandler(updatedGroup, groupIndex);
|
156
|
-
}
|
157
|
-
conditionBuilderRef: conditionBuilderRef
|
157
|
+
}
|
158
158
|
}), groupIndex < rootState.groups.length - 1 && (_GroupConnector || (_GroupConnector = /*#__PURE__*/React__default["default"].createElement(GroupConnector["default"], null))));
|
159
|
-
})),
|
159
|
+
})), variant == 'tree' && /*#__PURE__*/React__default["default"].createElement("div", {
|
160
160
|
role: "row",
|
161
161
|
tabIndex: -1,
|
162
|
-
"aria-level": 1
|
162
|
+
"aria-level": 1,
|
163
|
+
className: "".concat(DataConfigs.blockClass, "__add-group")
|
163
164
|
}, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderButton.ConditionBuilderButton, {
|
164
165
|
renderIcon: icons.TextNewLine,
|
165
166
|
onClick: addConditionGroupHandler,
|
@@ -179,11 +180,10 @@ var ConditionBuilderContent = function ConditionBuilderContent(_ref) {
|
|
179
180
|
group: {
|
180
181
|
groupOperator: rootState.operator
|
181
182
|
}
|
182
|
-
}))
|
183
|
+
})), actions && /*#__PURE__*/React__default["default"].createElement(ConditionBuilderActions["default"], {
|
183
184
|
actions: actions,
|
184
185
|
className: "".concat(DataConfigs.blockClass, "__actions-container"),
|
185
|
-
variant: variant
|
186
|
-
conditionBuilderRef: conditionBuilderRef
|
186
|
+
variant: variant
|
187
187
|
}));
|
188
188
|
};
|
189
189
|
var ConditionBuilderContent$1 = ConditionBuilderContent;
|
@@ -195,10 +195,6 @@ ConditionBuilderContent.propTypes = {
|
|
195
195
|
id: index["default"].oneOfType([index["default"].string, index["default"].number]).isRequired,
|
196
196
|
label: index["default"].string.isRequired
|
197
197
|
})),
|
198
|
-
/**
|
199
|
-
* ref of condition builder
|
200
|
-
*/
|
201
|
-
conditionBuilderRef: index["default"].object,
|
202
198
|
/**
|
203
199
|
* callback functions that will provide the updated action state back.
|
204
200
|
*/
|
package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts
CHANGED
@@ -18,6 +18,7 @@ export function ConditionBuilderProvider(props: any): import("react/jsx-runtime"
|
|
18
18
|
export namespace ConditionBuilderProvider {
|
19
19
|
namespace propTypes {
|
20
20
|
let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
21
|
+
let conditionBuilderRef: PropTypes.Requireable<object>;
|
21
22
|
let getOptions: PropTypes.Requireable<(...args: any[]) => any>;
|
22
23
|
let inputConfig: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
23
24
|
properties: PropTypes.Requireable<(PropTypes.InferProps<{
|
@@ -71,7 +71,8 @@ var ConditionBuilderProvider = function ConditionBuilderProvider(props) {
|
|
71
71
|
popOverSearchThreshold: props.popOverSearchThreshold,
|
72
72
|
getOptions: props.getOptions,
|
73
73
|
variant: props.variant,
|
74
|
-
translateWithId: props.translateWithId
|
74
|
+
translateWithId: props.translateWithId,
|
75
|
+
conditionBuilderRef: props.conditionBuilderRef
|
75
76
|
}
|
76
77
|
},
|
77
78
|
// eslint-disable-next-line react/prop-types
|
@@ -82,6 +83,10 @@ ConditionBuilderProvider.propTypes = {
|
|
82
83
|
* Provide the contents of the ConditionBuilder.
|
83
84
|
*/
|
84
85
|
children: index["default"].node.isRequired,
|
86
|
+
/**
|
87
|
+
* ref of condition builder
|
88
|
+
*/
|
89
|
+
conditionBuilderRef: index["default"].object,
|
85
90
|
/**
|
86
91
|
* This is an optional callback function that will be triggered when options array is not passed in the inputConfig against a property.
|
87
92
|
* This can be a asynchronous function that need to return a promise, so it will allow to fetch options from API call.
|
@@ -24,6 +24,7 @@ export namespace translationsObject {
|
|
24
24
|
let valueText: string;
|
25
25
|
let connectorText: string;
|
26
26
|
let conditionRowText: string;
|
27
|
+
let conditionRowGroupText: string;
|
27
28
|
let removeConditionText: string;
|
28
29
|
let addConditionRowText: string;
|
29
30
|
let startText: string;
|
@@ -34,6 +35,8 @@ export namespace translationsObject {
|
|
34
35
|
let removeActionText: string;
|
35
36
|
let addActionText: string;
|
36
37
|
let invalidText: string;
|
37
|
-
let invalidDateText: string;
|
38
38
|
let invalidNumberWarnText: string;
|
39
|
+
let conditionBuilderText: string;
|
40
|
+
let actionSectionText: string;
|
41
|
+
let conditionHeadingText: string;
|
39
42
|
}
|
@@ -35,6 +35,7 @@ var translationsObject = {
|
|
35
35
|
valueText: 'Value',
|
36
36
|
connectorText: 'Connector',
|
37
37
|
conditionRowText: 'Condition row',
|
38
|
+
conditionRowGroupText: 'Condition row group',
|
38
39
|
removeConditionText: 'Remove condition',
|
39
40
|
addConditionRowText: 'Add condition row',
|
40
41
|
startText: 'Start',
|
@@ -45,8 +46,10 @@ var translationsObject = {
|
|
45
46
|
removeActionText: 'Remove Action',
|
46
47
|
addActionText: 'Add action',
|
47
48
|
invalidText: 'Incomplete',
|
48
|
-
|
49
|
-
|
49
|
+
invalidNumberWarnText: 'Invalid number, must be 0 or greater',
|
50
|
+
conditionBuilderText: 'Condition Builder',
|
51
|
+
actionSectionText: 'Action Section',
|
52
|
+
conditionHeadingText: 'Condition'
|
50
53
|
};
|
51
54
|
|
52
55
|
exports.translationsObject = translationsObject;
|