@carbon/ibm-products 2.42.1-canary.27 → 2.42.1-canary.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. package/css/index-full-carbon.css +9 -302
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon.css +9 -302
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +9 -302
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  14. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +33 -74
  15. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  16. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +12 -95
  17. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  18. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +9 -27
  19. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  20. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +14 -95
  21. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  22. package/es/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  23. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  24. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  25. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  26. package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +33 -38
  27. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +67 -197
  28. package/es/components/ConditionBuilder/utils/util.d.ts +0 -1
  29. package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  30. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  31. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  32. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  33. package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  34. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  35. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  36. package/es/components/Datagrid/types/index.d.ts +0 -2
  37. package/es/components/Datagrid/useColumnOrder.d.ts +1 -7
  38. package/es/components/Datagrid/useFiltering.d.ts +1 -8
  39. package/es/components/Datagrid/useFiltering.js +7 -8
  40. package/es/components/Datagrid/useFlexResize.d.ts +1 -1
  41. package/es/components/Datagrid/useFlexResize.js +11 -11
  42. package/es/components/Datagrid/useNestedRows.js +2 -24
  43. package/es/components/Datagrid/useOnRowClick.d.ts +1 -8
  44. package/es/components/Datagrid/useOnRowClick.js +1 -2
  45. package/es/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  46. package/es/components/Datagrid/useRowIsMouseOver.js +1 -1
  47. package/es/components/Datagrid/useSelectRows.d.ts +1 -8
  48. package/es/components/Datagrid/useSelectRows.js +2 -3
  49. package/es/components/Datagrid/useSortableColumns.d.ts +3 -10
  50. package/es/components/Datagrid/useSortableColumns.js +2 -3
  51. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  52. package/es/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  53. package/es/components/SidePanel/SidePanel.d.ts +2 -2
  54. package/es/components/SidePanel/SidePanel.js +5 -9
  55. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +0 -6
  56. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +32 -73
  57. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.d.ts +1 -15
  58. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +9 -92
  59. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.d.ts +2 -11
  60. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +8 -26
  61. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.d.ts +0 -5
  62. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +11 -92
  63. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.d.ts +0 -1
  64. package/lib/components/ConditionBuilder/ConditionBuilderContext/ConditionBuilderProvider.js +0 -1
  65. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +0 -7
  66. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +1 -8
  67. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +1 -1
  68. package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.js +31 -36
  69. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +64 -195
  70. package/lib/components/ConditionBuilder/utils/util.d.ts +0 -1
  71. package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +1 -1
  72. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.d.ts +1 -1
  73. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -0
  74. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +4 -7
  75. package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -7
  76. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.d.ts +0 -1
  77. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +3 -13
  78. package/lib/components/Datagrid/types/index.d.ts +0 -2
  79. package/lib/components/Datagrid/useColumnOrder.d.ts +1 -7
  80. package/lib/components/Datagrid/useFiltering.d.ts +1 -8
  81. package/lib/components/Datagrid/useFiltering.js +7 -8
  82. package/lib/components/Datagrid/useFlexResize.d.ts +1 -1
  83. package/lib/components/Datagrid/useFlexResize.js +11 -11
  84. package/lib/components/Datagrid/useNestedRows.js +2 -24
  85. package/lib/components/Datagrid/useOnRowClick.d.ts +1 -8
  86. package/lib/components/Datagrid/useOnRowClick.js +1 -2
  87. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +1 -2
  88. package/lib/components/Datagrid/useRowIsMouseOver.js +1 -1
  89. package/lib/components/Datagrid/useSelectRows.d.ts +1 -8
  90. package/lib/components/Datagrid/useSelectRows.js +2 -3
  91. package/lib/components/Datagrid/useSortableColumns.d.ts +3 -10
  92. package/lib/components/Datagrid/useSortableColumns.js +2 -3
  93. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.d.ts +1 -8
  94. package/lib/components/Datagrid/utils/getAutoSizedColumnWidth.js +7 -0
  95. package/lib/components/SidePanel/SidePanel.d.ts +2 -2
  96. package/lib/components/SidePanel/SidePanel.js +5 -9
  97. package/package.json +3 -3
  98. package/scss/components/ConditionBuilder/_condition-builder.scss +1 -21
  99. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +3 -22
  100. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +21 -58
  101. package/telemetry.yml +0 -23
  102. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  103. package/es/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -44
  104. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  105. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -69
  106. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.d.ts +0 -2
  107. package/lib/components/ConditionBuilder/ConditionBuilderConnector/GroupConnector.js +0 -52
  108. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +0 -10
  109. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +0 -77
  110. /package/es/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
  111. /package/lib/components/ConditionBuilder/{ConditionBuilderConnector → ConditionConnector}/ConditionConnector.d.ts +0 -0
@@ -13,22 +13,12 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
13
13
  var React = require('react');
14
14
  var ConditionBlock = require('../ConditionBlock/ConditionBlock.js');
15
15
  var index = require('../../../node_modules/prop-types/index.js');
16
- var cx = require('classnames');
17
16
  var DataConfigs = require('../ConditionBuilderContext/DataConfigs.js');
18
- var ConditionBuilderItem = require('../ConditionBuilderItem/ConditionBuilderItem.js');
19
- var ConditionBuilderItemOption = require('../ConditionBuilderItem/ConditionBuilderItemOption/ConditionBuilderItemOption.js');
20
- var util = require('../utils/util.js');
21
- var ConditionConnector = require('../ConditionBuilderConnector/ConditionConnector.js');
22
- var ConditionBuilderProvider = require('../ConditionBuilderContext/ConditionBuilderProvider.js');
23
17
  var uuidv4 = require('../../../global/js/utils/uuidv4.js');
24
- var ConditionPreview = require('../ConditionPreview/ConditionPreview.js');
25
18
 
26
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
27
20
 
28
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
- var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
30
-
31
- var _ConditionPreview, _ConditionPreview2;
32
22
 
33
23
  /**
34
24
  *
@@ -36,24 +26,14 @@ var _ConditionPreview, _ConditionPreview2;
36
26
  * All the inner components of group are called from here.
37
27
  * @returns
38
28
  */
39
-
40
29
  var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
30
+ var _group$conditions;
41
31
  var group = _ref.group,
42
32
  aria = _ref.aria,
43
33
  onRemove = _ref.onRemove,
44
34
  onChange = _ref.onChange,
45
35
  conditionBuilderRef = _ref.conditionBuilderRef,
46
36
  className = _ref.className;
47
- var _useContext = React.useContext(ConditionBuilderProvider.ConditionBuilderContext),
48
- variant = _useContext.variant;
49
- var _useState = React.useState(-1),
50
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
51
- showConditionPreview = _useState2[0],
52
- setShowConditionPreview = _useState2[1];
53
- var _useState3 = React.useState(-1),
54
- _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
55
- showConditionSubGroupPreview = _useState4[0],
56
- setShowConditionSubGroupPreview = _useState4[1];
57
37
  var onRemoveHandler = function onRemoveHandler(conditionId, evt) {
58
38
  if (group.conditions.length > 1) {
59
39
  onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
@@ -84,183 +64,72 @@ var ConditionGroupBuilder = function ConditionGroupBuilder(_ref) {
84
64
  conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [newCondition], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
85
65
  }));
86
66
  };
87
- var handleFocusOnClose = function handleFocusOnClose(e) {
88
- var _e$currentTarget;
89
- var previousClose = (_e$currentTarget = e.currentTarget) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.closest('[role="row"]')) === null || _e$currentTarget === void 0 || (_e$currentTarget = _e$currentTarget.previousSibling) === null || _e$currentTarget === void 0 ? void 0 : _e$currentTarget.querySelector('[data-name="closeCondition"]');
90
- if (previousClose) {
91
- previousClose.focus();
92
- }
93
- };
94
- var addConditionSubGroupHandler = function addConditionSubGroupHandler(conditionIndex) {
95
- onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
96
- conditions: [].concat(_rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(0, conditionIndex + 1)), [{
97
- groupSeparateOperator: null,
98
- groupOperator: 'and',
99
- statement: 'if',
100
- conditions: [{
101
- property: undefined,
102
- operator: '',
103
- value: '',
104
- popoverToOpen: 'propertyField',
105
- id: uuidv4["default"]()
106
- }],
107
- id: uuidv4["default"]()
108
- }], _rollupPluginBabelHelpers.toConsumableArray(group.conditions.slice(conditionIndex + 1)))
109
- }));
110
- };
111
67
  var isLastCondition = function isLastCondition(conditionIndex, conditionArr) {
112
68
  return conditionIndex + 1 >= conditionArr.length || conditionArr.length - 1 != conditionIndex && conditionArr[conditionIndex + 1].conditions;
113
69
  };
114
- var _showConditionSubGroupPreviewHandler = function showConditionSubGroupPreviewHandler(conditionIndex) {
115
- setShowConditionSubGroupPreview(conditionIndex);
116
- };
117
- var hideConditionSubGroupPreviewHandler = function hideConditionSubGroupPreviewHandler() {
118
- setShowConditionSubGroupPreview(-1);
119
- };
120
- var _showConditionPreviewHandler = function showConditionPreviewHandler(conditionIndex) {
121
- setShowConditionPreview(conditionIndex);
122
- };
123
- var hideConditionPreviewHandler = function hideConditionPreviewHandler() {
124
- setShowConditionPreview(-1);
125
- };
126
- var onStatementChangeHandler = function onStatementChangeHandler(updatedStatement) {
127
- onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
128
- statement: updatedStatement
129
- }));
130
- };
131
- var onConnectorOperatorChange = function onConnectorOperatorChange(op) {
132
- onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
133
- groupOperator: op
134
- }));
135
- };
136
- var getSentenceVariant = function getSentenceVariant() {
137
- var _group$conditions;
138
- return /*#__PURE__*/React__default["default"].createElement("div", {
139
- className: "".concat(className, " eachGroup")
140
- }, /*#__PURE__*/React__default["default"].createElement("div", {
141
- className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
142
- role: "grid",
143
- "aria-label": DataConfigs.translateWithId('condition_builder_group')
144
- }, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
145
- return /*#__PURE__*/React__default["default"].createElement("div", {
146
- key: eachCondition.id,
147
- className: "".concat(DataConfigs.blockClass, "__group-wrapper")
148
- }, /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
149
- conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
150
- aria: {
151
- level: aria.level + 1,
152
- posinset: conditionIndex + 1,
153
- setsize: group.conditions.length
154
- },
155
- isStatement: conditionIndex == 0,
156
- condition: eachCondition,
157
- group: group,
158
- conditionIndex: conditionIndex,
159
- onChange: function onChange(updatedConditions) {
160
- onChangeHandler(updatedConditions, conditionIndex);
161
- },
162
- addConditionHandler: addConditionHandler,
163
- onRemove: function onRemove(e) {
164
- onRemoveHandler(eachCondition.id, e);
165
- },
166
- onConnectorOperatorChange: onConnectorOperatorChange,
167
- onStatementChange: onStatementChangeHandler,
168
- isLastCondition: isLastCondition
169
- }));
170
- })));
70
+ var handleFocusOnClose = function handleFocusOnClose(evt) {
71
+ var _evt$currentTarget;
72
+ var previousClose = (_evt$currentTarget = evt.currentTarget) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.closest('[role="row"]')) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.parentElement) === null || _evt$currentTarget === void 0 || (_evt$currentTarget = _evt$currentTarget.previousSibling) === null || _evt$currentTarget === void 0 ? void 0 : _evt$currentTarget.querySelector('[data-name="closeCondition"]');
73
+ if (previousClose) {
74
+ previousClose.focus();
75
+ }
171
76
  };
172
- var getTreeVariant = function getTreeVariant() {
173
- var _group$conditions2;
77
+ return /*#__PURE__*/React__default["default"].createElement("div", {
78
+ className: "".concat(className, " eachGroup")
79
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
80
+ className: "".concat(DataConfigs.blockClass, "__condition-wrapper"),
81
+ role: "grid",
82
+ "aria-label": DataConfigs.translateWithId('condition_builder_group')
83
+ }, group === null || group === void 0 || (_group$conditions = group.conditions) === null || _group$conditions === void 0 ? void 0 : _group$conditions.map(function (eachCondition, conditionIndex) {
174
84
  return /*#__PURE__*/React__default["default"].createElement("div", {
175
- className: "".concat(className, " ").concat(DataConfigs.blockClass, "__condition-wrapper"),
176
- role: aria.level === 1 ? 'rowgroup' : undefined,
177
- "aria-label": aria.level == 1 ? DataConfigs.translateWithId('condition_builder_group') : undefined
178
- }, /*#__PURE__*/React__default["default"].createElement("div", {
179
- tabIndex: 0,
180
- role: "row",
181
- "aria-level": aria.level,
182
- "aria-posinset": aria.posinset,
183
- "aria-setsize": aria.setsize
184
- }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItem.ConditionBuilderItem, {
185
- label: group.statement,
186
- title: DataConfigs.translateWithId('condition'),
187
- "data-name": "connectorField",
188
- popOverClassName: "".concat(DataConfigs.blockClass, "__gap"),
189
- className: "".concat(DataConfigs.blockClass, "__statement-button")
190
- }, /*#__PURE__*/React__default["default"].createElement(ConditionBuilderItemOption.ConditionBuilderItemOption, {
191
- conditionState: {
192
- value: group.statement,
193
- label: DataConfigs.translateWithId('condition')
85
+ key: eachCondition.id
86
+ }, eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionGroupBuilder, {
87
+ className: "".concat(DataConfigs.blockClass, "__group"),
88
+ aria: {
89
+ level: aria.level + 1,
90
+ posinset: conditionIndex + 1,
91
+ setsize: group.conditions.length
92
+ },
93
+ group: eachCondition,
94
+ onChange: function onChange(updatedCondition) {
95
+ onChangeHandler(updatedCondition, conditionIndex);
96
+ },
97
+ onRemove: function onRemove(evt) {
98
+ onRemoveHandler(eachCondition.id, evt);
99
+ },
100
+ conditionBuilderRef: conditionBuilderRef
101
+ }), !eachCondition.conditions && /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
102
+ conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
103
+ aria: {
104
+ level: aria.level + 1,
105
+ posinset: conditionIndex + 1,
106
+ setsize: group.conditions.length
194
107
  },
195
- onChange: function onChange(v, evt) {
196
- util.focusThisField(evt);
197
- onStatementChangeHandler(v);
108
+ isStatement: conditionIndex == 0,
109
+ condition: eachCondition,
110
+ group: group,
111
+ conditionIndex: conditionIndex,
112
+ className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__gap-bottom"),
113
+ onChange: function onChange(updatedConditions) {
114
+ onChangeHandler(updatedConditions, conditionIndex);
198
115
  },
199
- config: {
200
- options: DataConfigs.statementConfig
201
- }
202
- }))), group === null || group === void 0 || (_group$conditions2 = group.conditions) === null || _group$conditions2 === void 0 ? void 0 : _group$conditions2.map(function (eachCondition, conditionIndex) {
203
- return /*#__PURE__*/React__default["default"].createElement(React.Fragment, {
204
- key: eachCondition.id
205
- }, eachCondition.conditions ? /*#__PURE__*/React__default["default"].createElement("div", {
206
- className: cx__default["default"]("".concat(DataConfigs.blockClass, "__condition-block subgroup ").concat(DataConfigs.blockClass, "__gap"), _rollupPluginBabelHelpers.defineProperty({}, "".concat(DataConfigs.blockClass, "__gap-bottom"), group.conditions.length < conditionIndex + 1))
207
- }, /*#__PURE__*/React__default["default"].createElement(ConditionConnector["default"], {
208
- className: "".concat(DataConfigs.blockClass, "__gap ").concat(DataConfigs.blockClass, "__groupConnector"),
209
- operator: group.groupOperator,
210
- "aria-hidden": true
211
- }), /*#__PURE__*/React__default["default"].createElement(ConditionGroupBuilder, {
212
- aria: {
213
- level: aria.level + 1,
214
- posinset: conditionIndex + 1,
215
- setsize: group.conditions.length
216
- },
217
- className: "".concat(DataConfigs.blockClass, "__group"),
218
- group: eachCondition,
219
- onChange: function onChange(updatedConditions) {
220
- onChangeHandler(updatedConditions, conditionIndex);
221
- },
222
- onRemove: function onRemove(e) {
223
- onRemoveHandler(eachCondition.id, e);
224
- },
225
- conditionBuilderRef: conditionBuilderRef
226
- })) : /*#__PURE__*/React__default["default"].createElement(ConditionBlock["default"], {
227
- conjunction: conditionIndex > 0 ? group.groupOperator : undefined,
228
- aria: {
229
- level: aria.level + 1,
230
- posinset: conditionIndex + 1,
231
- setsize: group.conditions.length
232
- },
233
- isStatement: false,
234
- condition: eachCondition,
235
- group: group,
236
- conditionIndex: conditionIndex,
237
- addConditionHandler: addConditionHandler,
238
- addConditionSubGroupHandler: addConditionSubGroupHandler,
239
- onChange: function onChange(updatedConditions) {
240
- onChangeHandler(updatedConditions, conditionIndex);
241
- },
242
- onRemove: function onRemove(e) {
243
- onRemoveHandler(eachCondition.id, e);
244
- },
245
- onConnectorOperatorChange: onConnectorOperatorChange,
246
- onStatementChange: onStatementChangeHandler,
247
- showConditionSubGroupPreviewHandler: function showConditionSubGroupPreviewHandler() {
248
- _showConditionSubGroupPreviewHandler(conditionIndex);
249
- },
250
- hideConditionSubGroupPreviewHandler: hideConditionSubGroupPreviewHandler,
251
- showConditionPreviewHandler: function showConditionPreviewHandler() {
252
- _showConditionPreviewHandler(conditionIndex);
253
- },
254
- hideConditionPreviewHandler: hideConditionPreviewHandler,
255
- isLastCondition: isLastCondition
256
- }), conditionIndex == showConditionSubGroupPreview && (_ConditionPreview || (_ConditionPreview = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
257
- previewType: "subGroup"
258
- }))), conditionIndex == showConditionPreview && (_ConditionPreview2 || (_ConditionPreview2 = /*#__PURE__*/React__default["default"].createElement(ConditionPreview["default"], {
259
- previewType: "condition"
260
- }))));
116
+ addConditionHandler: addConditionHandler,
117
+ onRemove: function onRemove(evt) {
118
+ onRemoveHandler(eachCondition.id, evt);
119
+ },
120
+ onConnectorOperatorChange: function onConnectorOperatorChange(op) {
121
+ onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
122
+ groupOperator: op
123
+ }));
124
+ },
125
+ onStatementChange: function onStatementChange(updatedStatement) {
126
+ onChange(_rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, group), {}, {
127
+ statement: updatedStatement
128
+ }));
129
+ },
130
+ isLastCondition: isLastCondition
261
131
  }));
262
- };
263
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, variant == 'tree' && getTreeVariant(), variant == 'sentence' && getSentenceVariant());
132
+ })));
264
133
  };
265
134
  var ConditionGroupBuilder$1 = ConditionGroupBuilder;
266
135
  ConditionGroupBuilder.propTypes = {
@@ -269,19 +138,19 @@ ConditionGroupBuilder.propTypes = {
269
138
  */
270
139
  aria: index["default"].object,
271
140
  /**
272
- * state defines the current group
273
- */
274
- /**
275
- * Provide an optional class to be applied to the containing node.
141
+ * Provide an class to be applied to the containing node.
276
142
  */
277
143
  className: index["default"].string,
278
144
  /**
279
- className: PropTypes.string,
280
145
  * ref of condition builder
281
146
  */
282
147
  conditionBuilderRef: index["default"].object,
148
+ /**
149
+ * group defines the current group
150
+ */
283
151
  group: index["default"].object,
284
152
  /**
153
+
285
154
  * callback to update the current condition of the state tree
286
155
  */
287
156
  onChange: index["default"].func,
@@ -2,4 +2,3 @@ export function focusThisField(evt: any): void;
2
2
  export function focusThisItem(currentElement: any): void;
3
3
  export function traverseClockVise(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
4
4
  export function traverseReverse(eachElem: any, index: any, allElements: any, rotate: any, trapFocus: any): void;
5
- export function checkForHoldingKey(evt: any, key: any): any;
@@ -194,7 +194,7 @@ var HeaderRow = function HeaderRow(datagridState, headRef, headerGroup) {
194
194
  headerProps = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_header$getHeaderProp), _header$getHeaderProp));
195
195
  var resizerProps = header === null || header === void 0 || (_header$getResizerPro = header.getResizerProps) === null || _header$getResizerPro === void 0 ? void 0 : _header$getResizerPro.call(header);
196
196
  return /*#__PURE__*/React__default["default"].createElement(react.TableHeader, _rollupPluginBabelHelpers["extends"]({}, headerProps, {
197
- className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug)), headerProps.className),
197
+ className: cx__default["default"](header === null || header === void 0 ? void 0 : header.className, _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__resizableColumn"), resizerProps), "".concat(blockClass, "__isResizing"), header === null || header === void 0 ? void 0 : header.isResizing), "".concat(blockClass, "__sortableColumn"), datagridState.isTableSortable && header.id !== 'spacer'), "".concat(blockClass, "__isSorted"), header === null || header === void 0 ? void 0 : header.isSorted), "".concat(blockClass, "__header-actions-column"), header === null || header === void 0 ? void 0 : header.isAction), "".concat(blockClass, "__with-slug"), header.slug && /*#__PURE__*/React__default["default"].isValidElement(header === null || header === void 0 ? void 0 : header.slug))),
198
198
  key: header.id,
199
199
  "aria-hidden": header.id === 'spacer' && 'true'
200
200
  }, getAccessibilityProps(header)), header.render('Header'), renderSlug(header.slug), resizerProps && !header.isAction && /*#__PURE__*/React__default["default"].createElement(ResizeHeader, {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2020, 2024
2
+ * Copyright IBM Corp. 2020, 2023
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.
@@ -15,6 +15,7 @@ var reactWindow = require('react-window');
15
15
  var react = require('@carbon/react');
16
16
  var settings = require('../../../settings.js');
17
17
  var DatagridHead = require('./DatagridHead.js');
18
+ var layout = require('@carbon/layout');
18
19
  var useResizeObserver = require('../../../global/js/hooks/useResizeObserver.js');
19
20
 
20
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -79,6 +80,10 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
79
80
  if (headWrapEl) {
80
81
  headWrapEl.scrollLeft = virtualBody === null || virtualBody === void 0 ? void 0 : virtualBody.scrollLeft;
81
82
  }
83
+ var spacerColumn = document.querySelector("#".concat(tableId, " .").concat(blockClass, "__head-wrap thead th:last-child"));
84
+ if (spacerColumn) {
85
+ spacerColumn.style.width = layout.px(32 + (virtualBody.offsetWidth - virtualBody.clientWidth)); // scrollbar width to header column to fix header alignment
86
+ }
82
87
  }
83
88
  var testRefValue = testRef === null || testRef === void 0 ? void 0 : testRef.current;
84
89
  testRefValue === null || testRefValue === void 0 || testRefValue.addEventListener('scroll', handleScroll);
@@ -82,7 +82,7 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
82
82
  };
83
83
  var onCheckboxCheck = function onCheckboxCheck(col, value) {
84
84
  var changedDefinitions = columnObjects.map(function (definition) {
85
- if ((Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) && definition.canFilter && !definition.disabled) {
85
+ if (Array.isArray(col) && col.indexOf(definition) != -1 || definition.id === col.id) {
86
86
  return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, definition), {}, {
87
87
  isVisible: value
88
88
  });
@@ -106,12 +106,9 @@ var CustomizeColumnsTearsheet = function CustomizeColumnsTearsheet(_ref) {
106
106
  React.useEffect(function () {
107
107
  var notFilterableCount = columnObjects.filter(function (col) {
108
108
  return !col.canFilter;
109
- }).length;
110
- var actionCount = columnObjects.filter(function (col) {
111
- return col.id === 'actions';
112
- }).length;
113
- setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount - actionCount);
114
- setTotalColumns(columnObjects.length - notFilterableCount - actionCount);
109
+ });
110
+ setVisibleColumnsCount(getVisibleColumnsCount() - notFilterableCount.length);
111
+ setTotalColumns(columnObjects.length - notFilterableCount.length);
115
112
  }, [getVisibleColumnsCount, columnObjects]);
116
113
  return /*#__PURE__*/React__default["default"].createElement(TearsheetNarrow.TearsheetNarrow, {
117
114
  className: "".concat(blockClass, "__customize-columns-tearsheet"),
@@ -1,8 +1,2 @@
1
- /**
2
- * Copyright IBM Corp. 2023, 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
- declare const useFilterContext: () => any;
8
1
  export default useFilterContext;
2
+ declare function useFilterContext(): any;
@@ -20,7 +20,6 @@ export namespace InlineEditCell {
20
20
  rows: PropTypes.Requireable<(object | null | undefined)[]>;
21
21
  rowSize: PropTypes.Requireable<string>;
22
22
  tableId: PropTypes.Requireable<string>;
23
- cellEditing: PropTypes.Requireable<object>;
24
23
  }>>;
25
24
  let nonEditCell: PropTypes.Requireable<boolean>;
26
25
  let placeholder: PropTypes.Requireable<string>;
@@ -45,8 +45,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
45
45
  var columnIndex = instance.columns.findIndex(function (col) {
46
46
  return col.id === columnId;
47
47
  });
48
- var rowIndex = cell.row.index;
49
- var cellId = "column-".concat(columnIndex, "-row-").concat(rowIndex);
48
+ var cellId = "column-".concat(columnIndex, "-row-").concat(cell.row.index);
50
49
  var _useContext = React.useContext(InlineEditContext.InlineEditContext),
51
50
  state = _useContext.state,
52
51
  dispatch = _useContext.dispatch;
@@ -82,14 +81,6 @@ var InlineEditCell = function InlineEditCell(_ref) {
82
81
  var rowSize = instance.rowSize,
83
82
  onDataUpdate = instance.onDataUpdate;
84
83
  var saveCellData;
85
- if (inEditMode) {
86
- instance.cellEditing = {
87
- cellId: cellId,
88
- columnIndex: columnIndex,
89
- rowIndex: rowIndex,
90
- curCellValue: cellValue
91
- };
92
- }
93
84
  React.useEffect(function () {
94
85
  setInitialValue(value);
95
86
  var columnId = cell.column.id;
@@ -463,7 +454,7 @@ var InlineEditCell = function InlineEditCell(_ref) {
463
454
  "data-inline-type": type,
464
455
  onClick: !nonEditCell ? handleInlineCellClick : addActiveState,
465
456
  onKeyDown: !nonEditCell ? handleKeyDown : null,
466
- className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), inEditMode && (config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue))), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
457
+ className: cx__default["default"]("".concat(blockClass, "__inline-edit--outer-cell-button"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__inline-edit--outer-cell-button--").concat(rowSize), rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--lg"), !rowSize), "".concat(blockClass, "__inline-edit--outer-cell-button--invalid"), config === null || config === void 0 || (_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, cellValue)), "".concat(blockClass, "__static--outer-cell"), !disabledCell))
467
458
  }, !nonEditCell && !disabledCell && renderRegularCell(), (!inEditMode || disabledCell) && /*#__PURE__*/React__default["default"].createElement(InlineEditButton.InlineEditButton, {
468
459
  isActiveCell: cellId === activeCellId,
469
460
  renderIcon: setRenderIcon(),
@@ -487,8 +478,7 @@ InlineEditCell.propTypes = {
487
478
  onDataUpdate: index["default"].func,
488
479
  rows: index["default"].arrayOf(index["default"].object),
489
480
  rowSize: index["default"].string,
490
- tableId: index["default"].string,
491
- cellEditing: index["default"].object
481
+ tableId: index["default"].string
492
482
  }),
493
483
  nonEditCell: index["default"].bool,
494
484
  placeholder: index["default"].string,
@@ -192,8 +192,6 @@ export interface DataGridState<T extends object = any> extends TableCommonProps,
192
192
  onVirtualScroll?: (evt?: boolean) => void;
193
193
  fetchMoreData?: () => void;
194
194
  loadMoreThreshold?: number;
195
- onRowClick?: (row: any, event: any) => void;
196
- onSort?: boolean;
197
195
  }
198
196
  export interface ResizeHeaderProps {
199
197
  resizerProps?: ResizerProps;
@@ -1,8 +1,2 @@
1
- /**
2
- * Copyright IBM Corp. 2022, 2022
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 { useColumnOrder } from 'react-table';
8
1
  export default useColumnOrder;
2
+ import { useColumnOrder } from 'react-table';
@@ -1,9 +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 { Hooks } from 'react-table';
8
- declare const useFiltering: (hooks: Hooks) => void;
9
1
  export default useFiltering;
2
+ declare function useFiltering(hooks: any): void;
@@ -67,13 +67,12 @@ var useFiltering = function useFiltering(hooks) {
67
67
  });
68
68
  }, []);
69
69
  hooks.useInstance.push(function (instance) {
70
- var _ref4 = instance,
71
- filterProps = _ref4.filterProps,
72
- setAllFilters = _ref4.setAllFilters,
73
- setFilter = _ref4.setFilter,
74
- headers = _ref4.headers,
75
- data = _ref4.data,
76
- state = _ref4.state;
70
+ var filterProps = instance.filterProps,
71
+ setAllFilters = instance.setAllFilters,
72
+ setFilter = instance.setFilter,
73
+ headers = instance.headers,
74
+ data = instance.data,
75
+ state = instance.state;
77
76
  var defaultProps = {
78
77
  variation: 'flyout',
79
78
  updateMethod: constants.BATCH,
@@ -89,7 +88,7 @@ var useFiltering = function useFiltering(hooks) {
89
88
  });
90
89
  };
91
90
  Object.assign(instance, {
92
- filterProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, defaultProps), instance === null || instance === void 0 ? void 0 : instance.filterProps),
91
+ filterProps: _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, defaultProps), instance.filterProps),
93
92
  filterTypes: filterTypes,
94
93
  getFilterFlyoutProps: getFilterFlyoutProps,
95
94
  FilterFlyout: FilterFlyout["default"]
@@ -1,6 +1,6 @@
1
1
  export default useFlexResize;
2
2
  /**
3
- * Copyright IBM Corp. 2020, 2024
3
+ * Copyright IBM Corp. 2020, 2023
4
4
  *
5
5
  * This source code is licensed under the Apache-2.0 license found in the
6
6
  * LICENSE file in the root directory of this source tree.
@@ -11,31 +11,31 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
13
 
14
- /* eslint-disable no-unreachable */
15
14
  /**
16
- * Copyright IBM Corp. 2020, 2024
15
+ * Copyright IBM Corp. 2020, 2023
17
16
  *
18
17
  * This source code is licensed under the Apache-2.0 license found in the
19
18
  * LICENSE file in the root directory of this source tree.
20
19
  */
21
20
 
22
21
  var useFlexResize = function useFlexResize(hooks) {
22
+ var spacer = {
23
+ id: 'spacer',
24
+ width: 0,
25
+ disableSortBy: true,
26
+ disableResizing: true
27
+ };
23
28
  hooks.visibleColumns.push(function (columns) {
24
- // always move actions to the end
29
+ // always move actions and spacer to the end
25
30
  var actionsIdx = columns.findIndex(function (col) {
26
31
  return col.isAction;
27
32
  });
28
33
  if (actionsIdx === -1) {
29
- var _lastCol = columns.at(-1);
30
- _lastCol.isFlexCol = true;
31
- return _rollupPluginBabelHelpers.toConsumableArray(columns);
34
+ return [].concat(_rollupPluginBabelHelpers.toConsumableArray(columns), [spacer]);
32
35
  }
33
36
  var cols = _rollupPluginBabelHelpers.toConsumableArray(columns);
34
37
  var actions = cols.splice(actionsIdx, 1)[0];
35
- cols.splice(columns.length, 0, actions);
36
- // the last non-action action column should flex remaining space
37
- var lastCol = columns.at(-2);
38
- lastCol.isFlexCol = true;
38
+ cols.splice(columns.length, 0, spacer, actions);
39
39
  return cols;
40
40
  });
41
41
  var changeProps = function changeProps(props, data) {
@@ -43,7 +43,7 @@ var useFlexResize = function useFlexResize(hooks) {
43
43
  if (!column && data.cell) {
44
44
  column = data.cell.column;
45
45
  }
46
- if (column.isFlexCol) {
46
+ if (column.id === spacer.id) {
47
47
  return [props, {
48
48
  style: {
49
49
  flex: '1 1 0'
@@ -23,23 +23,6 @@ var blockClass = "".concat(settings.pkg.prefix, "--datagrid");
23
23
  var useNestedRows = function useNestedRows(hooks) {
24
24
  useNestedRowExpander["default"](hooks);
25
25
  var useInstance = function useInstance(instance) {
26
- React.useEffect(function () {
27
- var rows = instance.rows;
28
- var defaultExpandedRows = rows.filter(function (row) {
29
- var _row$original;
30
- return row === null || row === void 0 || (_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.defaultExpanded;
31
- });
32
- if (defaultExpandedRows !== null && defaultExpandedRows !== void 0 && defaultExpandedRows.length) {
33
- defaultExpandedRows.map(function (defaultExpandedRow) {
34
- if (!defaultExpandedRow.isExpanded && !defaultExpandedRow.hasExpanded) {
35
- var _defaultExpandedRow$t;
36
- defaultExpandedRow === null || defaultExpandedRow === void 0 || (_defaultExpandedRow$t = defaultExpandedRow.toggleRowExpanded) === null || _defaultExpandedRow$t === void 0 || _defaultExpandedRow$t.call(defaultExpandedRow);
37
- defaultExpandedRow.hasExpanded = true;
38
- return;
39
- }
40
- });
41
- }
42
- }, [instance, instance.rows]);
43
26
  // This useEffect will expand rows if they exist in the initialState obj
44
27
  React.useEffect(function () {
45
28
  var rows = instance.rows,
@@ -71,21 +54,16 @@ var useNestedRows = function useNestedRows(hooks) {
71
54
  }
72
55
  }];
73
56
  };
74
- var getIndentation = function getIndentation(depth) {
75
- return 32 * depth + 16;
76
- }; // row indentation padding
77
57
  var getCellProps = function getCellProps(props, _ref3) {
78
58
  var cell = _ref3.cell,
79
59
  instance = _ref3.instance;
80
- // we add a dynamic -ve margin right only if the cell is resized below minimum width i.e 50px, else we set the width based on indentation at different levels
60
+ // reduce the "first cell"s width to compensate added (left) margin
81
61
  var isFirstCell = instance.columns.findIndex(function (c) {
82
62
  return c.id === cell.column.id;
83
63
  }) === 0;
84
64
  return [props, {
85
65
  style: {
86
- marginRight: isFirstCell && cell.row.depth > 0 && parseInt(props.style.width, 10) <= getIndentation(cell.row.depth) + 50 // indentation padding + expander cell or empty cell width
87
- ? "".concat(parseInt(props.style.width, 10) - (getIndentation(cell.row.depth) + 50), "px") : '',
88
- width: isFirstCell && cell.row.depth > 0 ? parseInt(props.style.width, 10) - getIndentation(cell.row.depth) : props.style.width
66
+ marginRight: "".concat(isFirstCell && cell.row.depth > 0 ? "".concat(-32 * cell.row.depth - 18, "px") : '')
89
67
  }
90
68
  }];
91
69
  };
@@ -1,9 +1,2 @@
1
- /**
2
- * Copyright IBM Corp. 2020, 2023
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 { Hooks } from 'react-table';
8
- declare const useOnRowClick: (hooks: Hooks) => void;
9
1
  export default useOnRowClick;
2
+ declare function useOnRowClick(hooks: any): void;