@deephaven/iris-grid 1.26.1 → 1.27.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/dist/IrisGridUtils.d.ts +7 -0
- package/dist/IrisGridUtils.d.ts.map +1 -1
- package/dist/IrisGridUtils.js +31 -5
- package/dist/IrisGridUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.d.ts +1 -0
- package/dist/sidebar/conditional-formatting/ConditionEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +177 -167
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js +2 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js +23 -18
- package/dist/sidebar/conditional-formatting/ConditionalFormattingMenu.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts +27 -7
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +172 -122
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/MultiColumnFormatEditor.d.ts +18 -0
- package/dist/sidebar/conditional-formatting/MultiColumnFormatEditor.d.ts.map +1 -0
- package/dist/sidebar/conditional-formatting/{ColumnFormatEditor.js → MultiColumnFormatEditor.js} +110 -22
- package/dist/sidebar/conditional-formatting/MultiColumnFormatEditor.js.map +1 -0
- package/dist/sidebar/conditional-formatting/RowFormatEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js +8 -5
- package/dist/sidebar/conditional-formatting/RowFormatEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js +1 -1
- package/dist/sidebar/conditional-formatting/StyleEditor.js.map +1 -1
- package/package.json +5 -5
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.d.ts +0 -11
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.d.ts.map +0 -1
- package/dist/sidebar/conditional-formatting/ColumnFormatEditor.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEditor.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"ConditionEditor.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAS3D,OAAO,EAOL,KAAK,WAAW,EAChB,KAAK,eAAe,EASrB,MAAM,8BAA8B,CAAC;AAItC,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,OAAO,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AAgID,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA+WjE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -8,31 +8,23 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import { TableUtils } from '@deephaven/jsapi-utils';
|
|
10
10
|
import Log from '@deephaven/log';
|
|
11
|
-
import {
|
|
11
|
+
import { ComboBox, Item, Picker, Section } from '@deephaven/components';
|
|
12
12
|
import { StringCondition, DateCondition, getLabelForNumberCondition, getLabelForDateCondition, getLabelForStringCondition, NumberCondition, getDefaultConditionForType, getLabelForBooleanCondition, BooleanCondition, CharCondition, getLabelForCharCondition, isDateConditionValid, getDefaultValueForType } from "./ConditionalFormattingUtils.js";
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
var log = Log.module('ConditionEditor');
|
|
15
15
|
var DEFAULT_CALLBACK = () => undefined;
|
|
16
|
-
var
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var booleanConditions = [BooleanCondition.IS_TRUE, BooleanCondition.IS_FALSE, BooleanCondition.IS_NULL, BooleanCondition.IS_NOT_NULL].map(option => /*#__PURE__*/_jsx("option", {
|
|
29
|
-
value: option,
|
|
30
|
-
children: getLabelForBooleanCondition(option)
|
|
31
|
-
}, option));
|
|
32
|
-
var charConditions = [CharCondition.IS_EQUAL, CharCondition.IS_NOT_EQUAL, CharCondition.IS_NULL, CharCondition.IS_NOT_NULL].map(option => /*#__PURE__*/_jsx("option", {
|
|
33
|
-
value: option,
|
|
34
|
-
children: getLabelForCharCondition(option)
|
|
35
|
-
}, option));
|
|
16
|
+
var VALUE_PREFIX = 'value-';
|
|
17
|
+
var COLUMN_PREFIX = 'column-';
|
|
18
|
+
var numberValueConditions = [NumberCondition.IS_EQUAL, NumberCondition.IS_NOT_EQUAL, NumberCondition.IS_BETWEEN, NumberCondition.GREATER_THAN, NumberCondition.GREATER_THAN_OR_EQUAL, NumberCondition.LESS_THAN, NumberCondition.LESS_THAN_OR_EQUAL, NumberCondition.IS_NULL, NumberCondition.IS_NOT_NULL];
|
|
19
|
+
var numberColumnConditions = [NumberCondition.IS_EQUAL, NumberCondition.IS_NOT_EQUAL, NumberCondition.GREATER_THAN, NumberCondition.GREATER_THAN_OR_EQUAL, NumberCondition.LESS_THAN, NumberCondition.LESS_THAN_OR_EQUAL];
|
|
20
|
+
var stringValueConditions = [StringCondition.IS_EXACTLY, StringCondition.IS_NOT_EXACTLY, StringCondition.CONTAINS, StringCondition.DOES_NOT_CONTAIN, StringCondition.STARTS_WITH, StringCondition.ENDS_WITH, StringCondition.IS_NULL, StringCondition.IS_NOT_NULL];
|
|
21
|
+
var stringColumnConditions = [StringCondition.IS_EXACTLY, StringCondition.IS_NOT_EXACTLY, StringCondition.CONTAINS, StringCondition.DOES_NOT_CONTAIN, StringCondition.STARTS_WITH, StringCondition.ENDS_WITH];
|
|
22
|
+
var dateValueConditions = [DateCondition.IS_EXACTLY, DateCondition.IS_NOT_EXACTLY, DateCondition.IS_BEFORE, DateCondition.IS_BEFORE_OR_EQUAL, DateCondition.IS_AFTER, DateCondition.IS_AFTER_OR_EQUAL, DateCondition.IS_NULL, DateCondition.IS_NOT_NULL];
|
|
23
|
+
var dateColumnConditions = [DateCondition.IS_EXACTLY, DateCondition.IS_NOT_EXACTLY, DateCondition.IS_BEFORE, DateCondition.IS_BEFORE_OR_EQUAL, DateCondition.IS_AFTER, DateCondition.IS_AFTER_OR_EQUAL];
|
|
24
|
+
var booleanValueConditions = [BooleanCondition.IS_TRUE, BooleanCondition.IS_FALSE, BooleanCondition.IS_EQUAL, BooleanCondition.IS_NOT_EQUAL, BooleanCondition.IS_NULL, BooleanCondition.IS_NOT_NULL];
|
|
25
|
+
var booleanColumnConditions = [BooleanCondition.IS_EQUAL, BooleanCondition.IS_NOT_EQUAL];
|
|
26
|
+
var charValueConditions = [CharCondition.IS_EQUAL, CharCondition.IS_NOT_EQUAL, CharCondition.IS_NULL, CharCondition.IS_NOT_NULL];
|
|
27
|
+
var charColumnConditions = [CharCondition.IS_EQUAL, CharCondition.IS_NOT_EQUAL];
|
|
36
28
|
function isNumberConditionValid(condition, value, startValue, endValue) {
|
|
37
29
|
if (condition === NumberCondition.IS_NULL || condition === NumberCondition.IS_NOT_NULL) {
|
|
38
30
|
return true;
|
|
@@ -45,106 +37,9 @@ function isNumberConditionValid(condition, value, startValue, endValue) {
|
|
|
45
37
|
}
|
|
46
38
|
return false;
|
|
47
39
|
}
|
|
48
|
-
function getNumberInputs(selectedCondition, handleValueChange, handleStartValueChange, handleEndValueChange, isInvalid, conditionValue, startValue, endValue) {
|
|
49
|
-
switch (selectedCondition) {
|
|
50
|
-
case NumberCondition.IS_EQUAL:
|
|
51
|
-
case NumberCondition.IS_NOT_EQUAL:
|
|
52
|
-
case NumberCondition.GREATER_THAN:
|
|
53
|
-
case NumberCondition.GREATER_THAN_OR_EQUAL:
|
|
54
|
-
case NumberCondition.LESS_THAN:
|
|
55
|
-
case NumberCondition.LESS_THAN_OR_EQUAL:
|
|
56
|
-
return /*#__PURE__*/_jsx("input", {
|
|
57
|
-
type: "number",
|
|
58
|
-
className: classNames('form-control', {
|
|
59
|
-
'is-invalid': isInvalid
|
|
60
|
-
}),
|
|
61
|
-
placeholder: "Enter value",
|
|
62
|
-
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
63
|
-
onChange: handleValueChange
|
|
64
|
-
});
|
|
65
|
-
case NumberCondition.IS_BETWEEN:
|
|
66
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
67
|
-
className: "d-flex flex-row",
|
|
68
|
-
children: [/*#__PURE__*/_jsx("input", {
|
|
69
|
-
type: "number",
|
|
70
|
-
className: classNames('form-control', 'd-flex', 'mr-2', {
|
|
71
|
-
'is-invalid': isInvalid
|
|
72
|
-
}),
|
|
73
|
-
placeholder: "Start value",
|
|
74
|
-
value: startValue !== null && startValue !== void 0 ? startValue : '',
|
|
75
|
-
onChange: handleStartValueChange
|
|
76
|
-
}), /*#__PURE__*/_jsx("input", {
|
|
77
|
-
type: "number",
|
|
78
|
-
className: classNames('form-control', 'd-flex', {
|
|
79
|
-
'is-invalid': isInvalid
|
|
80
|
-
}),
|
|
81
|
-
placeholder: "End value",
|
|
82
|
-
value: endValue !== null && endValue !== void 0 ? endValue : '',
|
|
83
|
-
onChange: handleEndValueChange
|
|
84
|
-
})]
|
|
85
|
-
});
|
|
86
|
-
case NumberCondition.IS_NULL:
|
|
87
|
-
case NumberCondition.IS_NOT_NULL:
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function getStringInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
92
|
-
switch (selectedCondition) {
|
|
93
|
-
case StringCondition.IS_NULL:
|
|
94
|
-
case StringCondition.IS_NOT_NULL:
|
|
95
|
-
return null;
|
|
96
|
-
default:
|
|
97
|
-
return /*#__PURE__*/_jsx("input", {
|
|
98
|
-
type: "text",
|
|
99
|
-
className: classNames('form-control', {
|
|
100
|
-
'is-invalid': isInvalid
|
|
101
|
-
}),
|
|
102
|
-
placeholder: "Enter value",
|
|
103
|
-
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
104
|
-
onChange: handleValueChange
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
function getDateInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
109
|
-
switch (selectedCondition) {
|
|
110
|
-
case DateCondition.IS_NULL:
|
|
111
|
-
case DateCondition.IS_NOT_NULL:
|
|
112
|
-
return null;
|
|
113
|
-
default:
|
|
114
|
-
return /*#__PURE__*/_jsx("input", {
|
|
115
|
-
type: "text",
|
|
116
|
-
className: classNames('form-control', {
|
|
117
|
-
'is-invalid': isInvalid
|
|
118
|
-
}),
|
|
119
|
-
placeholder: "Enter value",
|
|
120
|
-
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
121
|
-
onChange: handleValueChange
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function getBooleanInputs() {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
function getCharInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
129
|
-
switch (selectedCondition) {
|
|
130
|
-
case CharCondition.IS_NULL:
|
|
131
|
-
case CharCondition.IS_NOT_NULL:
|
|
132
|
-
return null;
|
|
133
|
-
default:
|
|
134
|
-
return /*#__PURE__*/_jsx("input", {
|
|
135
|
-
type: "text",
|
|
136
|
-
className: classNames('form-control', {
|
|
137
|
-
'is-invalid': isInvalid
|
|
138
|
-
}),
|
|
139
|
-
maxLength: 1,
|
|
140
|
-
placeholder: "Enter value",
|
|
141
|
-
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
142
|
-
onChange: handleValueChange
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
40
|
function ConditionEditor(props) {
|
|
147
41
|
var column = props.column,
|
|
42
|
+
columns = props.columns,
|
|
148
43
|
config = props.config,
|
|
149
44
|
dh = props.dh,
|
|
150
45
|
_props$onChange = props.onChange,
|
|
@@ -154,11 +49,15 @@ function ConditionEditor(props) {
|
|
|
154
49
|
_useState2 = _slicedToArray(_useState, 2),
|
|
155
50
|
prevColumnType = _useState2[0],
|
|
156
51
|
setPrevColumnType = _useState2[1];
|
|
157
|
-
|
|
52
|
+
|
|
53
|
+
// Encode both condition and RHV mode in a single key: 'value-is-equal' or 'column-is-equal'
|
|
54
|
+
var _useState3 = useState(() => "".concat(typeof config.rightHandValue === 'object' ? COLUMN_PREFIX : VALUE_PREFIX).concat(config.condition)),
|
|
158
55
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var
|
|
56
|
+
selectedConditionKey = _useState4[0],
|
|
57
|
+
setConditionKey = _useState4[1];
|
|
58
|
+
var selectedCondition = selectedConditionKey.replace(/^(value|column)-/, '');
|
|
59
|
+
var isColumnMode = selectedConditionKey.startsWith(COLUMN_PREFIX);
|
|
60
|
+
var _useState5 = useState(config.rightHandValue),
|
|
162
61
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
163
62
|
conditionValue = _useState6[0],
|
|
164
63
|
setValue = _useState6[1];
|
|
@@ -176,39 +75,82 @@ function ConditionEditor(props) {
|
|
|
176
75
|
setIsValid = _useState10[1];
|
|
177
76
|
if (selectedColumnType !== prevColumnType) {
|
|
178
77
|
// Column type changed, reset condition and value fields
|
|
179
|
-
|
|
78
|
+
setConditionKey("".concat(VALUE_PREFIX).concat(getDefaultConditionForType(selectedColumnType)));
|
|
180
79
|
setValue(getDefaultValueForType(selectedColumnType));
|
|
181
80
|
setStartValue(undefined);
|
|
182
81
|
setEndValue(undefined);
|
|
183
82
|
setPrevColumnType(selectedColumnType);
|
|
184
83
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
84
|
+
|
|
85
|
+
// Build label helper for any condition enum value
|
|
86
|
+
var getConditionLabel = useCallback(condition => {
|
|
189
87
|
if (TableUtils.isNumberType(selectedColumnType)) {
|
|
190
|
-
return
|
|
88
|
+
return getLabelForNumberCondition(condition);
|
|
191
89
|
}
|
|
192
90
|
if (TableUtils.isCharType(selectedColumnType)) {
|
|
193
|
-
return
|
|
91
|
+
return getLabelForCharCondition(condition);
|
|
194
92
|
}
|
|
195
93
|
if (TableUtils.isStringType(selectedColumnType)) {
|
|
196
|
-
return
|
|
94
|
+
return getLabelForStringCondition(condition);
|
|
197
95
|
}
|
|
198
96
|
if (TableUtils.isDateType(selectedColumnType)) {
|
|
199
|
-
return
|
|
200
|
-
}
|
|
201
|
-
if (TableUtils.isBooleanType(selectedColumnType)) {
|
|
202
|
-
return booleanConditions;
|
|
97
|
+
return getLabelForDateCondition(condition);
|
|
203
98
|
}
|
|
99
|
+
return getLabelForBooleanCondition(condition);
|
|
204
100
|
}, [selectedColumnType]);
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
101
|
+
var _useMemo = useMemo(() => {
|
|
102
|
+
var valueConditions = [];
|
|
103
|
+
var columnConditions = [];
|
|
104
|
+
if (TableUtils.isNumberType(selectedColumnType)) {
|
|
105
|
+
valueConditions = numberValueConditions;
|
|
106
|
+
columnConditions = numberColumnConditions;
|
|
107
|
+
} else if (TableUtils.isCharType(selectedColumnType)) {
|
|
108
|
+
valueConditions = charValueConditions;
|
|
109
|
+
columnConditions = charColumnConditions;
|
|
110
|
+
} else if (TableUtils.isStringType(selectedColumnType)) {
|
|
111
|
+
valueConditions = stringValueConditions;
|
|
112
|
+
columnConditions = stringColumnConditions;
|
|
113
|
+
} else if (TableUtils.isDateType(selectedColumnType)) {
|
|
114
|
+
valueConditions = dateValueConditions;
|
|
115
|
+
columnConditions = dateColumnConditions;
|
|
116
|
+
} else if (TableUtils.isBooleanType(selectedColumnType)) {
|
|
117
|
+
valueConditions = booleanValueConditions;
|
|
118
|
+
columnConditions = booleanColumnConditions;
|
|
119
|
+
}
|
|
120
|
+
return [valueConditions.map(c => /*#__PURE__*/_jsx(Item, {
|
|
121
|
+
children: getConditionLabel(c)
|
|
122
|
+
}, "".concat(VALUE_PREFIX).concat(c))), columnConditions.map(c => /*#__PURE__*/_jsx(Item, {
|
|
123
|
+
children: getConditionLabel(c)
|
|
124
|
+
}, "".concat(COLUMN_PREFIX).concat(c)))];
|
|
125
|
+
}, [selectedColumnType, getConditionLabel]),
|
|
126
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
127
|
+
pickerValueItems = _useMemo2[0],
|
|
128
|
+
pickerColumnItems = _useMemo2[1];
|
|
129
|
+
var handleConditionKeyChange = useCallback(key => {
|
|
130
|
+
if (key == null) return;
|
|
131
|
+
var keyStr = String(key);
|
|
132
|
+
log.debug('handleConditionKeyChange', keyStr);
|
|
133
|
+
var nextIsColumn = keyStr.startsWith(COLUMN_PREFIX);
|
|
134
|
+
if (nextIsColumn && typeof conditionValue !== 'object') {
|
|
135
|
+
// Switching to column mode — default to first compatible column
|
|
136
|
+
var firstCompatible = columns.find(c => {
|
|
137
|
+
if (TableUtils.isNumberType(selectedColumnType)) {
|
|
138
|
+
return TableUtils.isNumberType(c.type);
|
|
139
|
+
}
|
|
140
|
+
return TableUtils.getNormalizedType(selectedColumnType) === TableUtils.getNormalizedType(c.type);
|
|
141
|
+
});
|
|
142
|
+
setValue(firstCompatible != null ? {
|
|
143
|
+
name: firstCompatible.name,
|
|
144
|
+
type: firstCompatible.type
|
|
145
|
+
} : undefined);
|
|
146
|
+
} else if (!nextIsColumn && typeof conditionValue === 'object') {
|
|
147
|
+
// Switching to value mode — clear the column value
|
|
148
|
+
setValue(getDefaultValueForType(selectedColumnType));
|
|
149
|
+
}
|
|
150
|
+
setConditionKey(keyStr);
|
|
151
|
+
}, [columns, selectedColumnType, conditionValue]);
|
|
152
|
+
var handleRightHandValueChange = useCallback(value => {
|
|
153
|
+
log.debug('handleRightHandValueChange', value);
|
|
212
154
|
setValue(value);
|
|
213
155
|
}, []);
|
|
214
156
|
var handleStartValueChange = useCallback(e => {
|
|
@@ -226,17 +168,23 @@ function ConditionEditor(props) {
|
|
|
226
168
|
if (selectedCondition === undefined) {
|
|
227
169
|
log.debug('Unable to create formatting rule. Condition is not selected.');
|
|
228
170
|
isConditionValid = false;
|
|
229
|
-
} else if (TableUtils.isNumberType(column.type) && !isNumberConditionValid(selectedCondition, conditionValue, startValue, endValue)) {
|
|
171
|
+
} else if (TableUtils.isNumberType(column.type) && (selectedCondition === NumberCondition.IS_BETWEEN || typeof conditionValue !== 'object') && !isNumberConditionValid(selectedCondition, typeof conditionValue === 'string' ? conditionValue : undefined, startValue, endValue)) {
|
|
230
172
|
log.debug('Unable to create formatting rule. Invalid value', conditionValue);
|
|
231
173
|
isConditionValid = false;
|
|
232
|
-
} else if (TableUtils.isDateType(column.type) && !isDateConditionValid(dh, selectedCondition, conditionValue)) {
|
|
174
|
+
} else if (TableUtils.isDateType(column.type) && typeof conditionValue !== 'object' && !isDateConditionValid(dh, selectedCondition, conditionValue)) {
|
|
233
175
|
log.debug('Unable to create formatting rule. Invalid date condition', conditionValue);
|
|
234
176
|
isConditionValid = false;
|
|
177
|
+
} else if (TableUtils.isCharType(column.type) && typeof conditionValue !== 'object' && selectedCondition !== CharCondition.IS_NULL && selectedCondition !== CharCondition.IS_NOT_NULL && (conditionValue === undefined || conditionValue.length !== 1)) {
|
|
178
|
+
log.debug('Unable to create formatting rule. Char value must be a single character', conditionValue);
|
|
179
|
+
isConditionValid = false;
|
|
180
|
+
} else if (TableUtils.isBooleanType(column.type) && typeof conditionValue !== 'object' && (selectedCondition === BooleanCondition.IS_EQUAL || selectedCondition === BooleanCondition.IS_NOT_EQUAL) && conditionValue !== 'true' && conditionValue !== 'false' && conditionValue !== 'null') {
|
|
181
|
+
log.debug('Unable to create formatting rule. Boolean comparison requires a column, true, false, or null', conditionValue);
|
|
182
|
+
isConditionValid = false;
|
|
235
183
|
}
|
|
236
184
|
setIsValid(isConditionValid);
|
|
237
185
|
onChange({
|
|
238
186
|
condition: selectedCondition,
|
|
239
|
-
|
|
187
|
+
rightHandValue: conditionValue,
|
|
240
188
|
start: startValue,
|
|
241
189
|
end: endValue
|
|
242
190
|
}, isConditionValid);
|
|
@@ -247,34 +195,96 @@ function ConditionEditor(props) {
|
|
|
247
195
|
return null;
|
|
248
196
|
}
|
|
249
197
|
|
|
250
|
-
//
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return getNumberInputs(selectedCondition, handleValueChange, handleStartValueChange, handleEndValueChange, showInvalid, conditionValue, startValue, endValue);
|
|
256
|
-
}
|
|
257
|
-
if (TableUtils.isCharType(selectedColumnType)) {
|
|
258
|
-
return getCharInputs(selectedCondition, handleValueChange, hasInvalidValue, conditionValue);
|
|
259
|
-
}
|
|
260
|
-
if (TableUtils.isStringType(selectedColumnType)) {
|
|
261
|
-
return getStringInputs(selectedCondition, handleValueChange, hasInvalidValue, conditionValue);
|
|
198
|
+
// IS_NULL/IS_NOT_NULL enum values are identical across all types ('is-null' /
|
|
199
|
+
// 'is-not-null'), so checking one enum covers all.
|
|
200
|
+
// Boolean IS_TRUE/IS_FALSE also never need a value input.
|
|
201
|
+
if (selectedCondition === StringCondition.IS_NULL || selectedCondition === StringCondition.IS_NOT_NULL || selectedCondition === BooleanCondition.IS_TRUE || selectedCondition === BooleanCondition.IS_FALSE) {
|
|
202
|
+
return null;
|
|
262
203
|
}
|
|
263
|
-
|
|
264
|
-
|
|
204
|
+
|
|
205
|
+
// A ModelColumn rightHandValue is always valid (column-vs-column comparison).
|
|
206
|
+
// For string values, check type-specific validity.
|
|
207
|
+
var rhvIsColumn = typeof conditionValue === 'object';
|
|
208
|
+
var hasInvalidValue = !rhvIsColumn && !isValid && conditionValue !== undefined && conditionValue !== '';
|
|
209
|
+
|
|
210
|
+
// Only offer columns that are type-compatible with the condition column so
|
|
211
|
+
// the generated expression is valid (e.g. prevent startsWith(intColumn)).
|
|
212
|
+
// Numbers are cross-compatible (int vs double). Everything else requires the same
|
|
213
|
+
// normalized type. (Note: text types are not compatible (string vs char)
|
|
214
|
+
var compatibleRhvColumns = columns.filter(c => {
|
|
215
|
+
if (TableUtils.isNumberType(selectedColumnType)) {
|
|
216
|
+
return TableUtils.isNumberType(c.type);
|
|
217
|
+
}
|
|
218
|
+
return TableUtils.getNormalizedType(selectedColumnType) === TableUtils.getNormalizedType(c.type);
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
// IS_BETWEEN uses two separate range inputs
|
|
222
|
+
if (TableUtils.isNumberType(selectedColumnType) && selectedCondition === NumberCondition.IS_BETWEEN) {
|
|
223
|
+
var isInvalid = !rhvIsColumn && !isValid && (startValue !== undefined && startValue !== '' || endValue !== undefined && endValue !== '');
|
|
224
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
225
|
+
className: "d-flex flex-row",
|
|
226
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
227
|
+
type: "number",
|
|
228
|
+
className: classNames('form-control', 'd-flex', 'mr-2', {
|
|
229
|
+
'is-invalid': isInvalid
|
|
230
|
+
}),
|
|
231
|
+
placeholder: "Start value",
|
|
232
|
+
value: startValue !== null && startValue !== void 0 ? startValue : '',
|
|
233
|
+
onChange: handleStartValueChange
|
|
234
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
235
|
+
type: "number",
|
|
236
|
+
className: classNames('form-control', 'd-flex', {
|
|
237
|
+
'is-invalid': isInvalid
|
|
238
|
+
}),
|
|
239
|
+
placeholder: "End value",
|
|
240
|
+
value: endValue !== null && endValue !== void 0 ? endValue : '',
|
|
241
|
+
onChange: handleEndValueChange
|
|
242
|
+
})]
|
|
243
|
+
});
|
|
265
244
|
}
|
|
266
|
-
if (
|
|
267
|
-
return
|
|
245
|
+
if (isColumnMode) {
|
|
246
|
+
return /*#__PURE__*/_jsx(ComboBox, {
|
|
247
|
+
"aria-label": "Select a column",
|
|
248
|
+
selectedKey: typeof conditionValue === 'object' ? conditionValue.name : null,
|
|
249
|
+
onChange: key => {
|
|
250
|
+
if (key == null) return;
|
|
251
|
+
var col = compatibleRhvColumns.find(c => c.name === String(key));
|
|
252
|
+
if (col != null) {
|
|
253
|
+
handleRightHandValueChange({
|
|
254
|
+
name: col.name,
|
|
255
|
+
type: col.type
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
children: compatibleRhvColumns.map(c => c.name)
|
|
260
|
+
});
|
|
268
261
|
}
|
|
269
|
-
|
|
262
|
+
return /*#__PURE__*/_jsx("input", {
|
|
263
|
+
type: TableUtils.isNumberType(selectedColumnType) ? 'number' : 'text',
|
|
264
|
+
className: classNames('form-control', {
|
|
265
|
+
'is-invalid': hasInvalidValue
|
|
266
|
+
}),
|
|
267
|
+
value: typeof conditionValue === 'string' ? conditionValue : '',
|
|
268
|
+
placeholder: "Enter a value",
|
|
269
|
+
onChange: e => handleRightHandValueChange(e.target.value)
|
|
270
|
+
});
|
|
271
|
+
}, [columns, selectedColumnType, selectedCondition, conditionValue, startValue, endValue, isValid, handleRightHandValueChange, handleStartValueChange, handleEndValueChange, isColumnMode]);
|
|
270
272
|
return /*#__PURE__*/_jsxs("div", {
|
|
271
273
|
className: "condition-editor mb-2",
|
|
272
|
-
children: [/*#__PURE__*/
|
|
273
|
-
|
|
274
|
+
children: [/*#__PURE__*/_jsxs(Picker, {
|
|
275
|
+
selectedKey: selectedConditionKey,
|
|
276
|
+
"aria-label": "Select condition",
|
|
274
277
|
"data-testid": "condition-select",
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
+
width: "100%",
|
|
279
|
+
UNSAFE_className: "mb-2",
|
|
280
|
+
onChange: handleConditionKeyChange,
|
|
281
|
+
children: [/*#__PURE__*/_jsx(Section, {
|
|
282
|
+
title: "Value",
|
|
283
|
+
children: pickerValueItems
|
|
284
|
+
}), /*#__PURE__*/_jsx(Section, {
|
|
285
|
+
title: "Column",
|
|
286
|
+
children: pickerColumnItems
|
|
287
|
+
})]
|
|
278
288
|
}), conditionInputs]
|
|
279
289
|
});
|
|
280
290
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEditor.js","names":["React","useCallback","useEffect","useMemo","useState","classNames","TableUtils","Log","Select","StringCondition","DateCondition","getLabelForNumberCondition","getLabelForDateCondition","getLabelForStringCondition","NumberCondition","getDefaultConditionForType","getLabelForBooleanCondition","BooleanCondition","CharCondition","getLabelForCharCondition","isDateConditionValid","getDefaultValueForType","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","numberConditionOptions","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","map","option","value","children","stringConditions","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","dateConditions","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","booleanConditions","IS_TRUE","IS_FALSE","charConditions","isNumberConditionValid","condition","startValue","endValue","Number","isNaN","parseFloat","getNumberInputs","selectedCondition","handleValueChange","handleStartValueChange","handleEndValueChange","isInvalid","conditionValue","type","className","placeholder","onChange","getStringInputs","getDateInputs","getBooleanInputs","getCharInputs","maxLength","ConditionEditor","props","column","config","dh","_props$onChange","selectedColumnType","_useState","_useState2","_slicedToArray","prevColumnType","setPrevColumnType","_useState3","_useState4","setCondition","_useState5","_useState6","setValue","_useState7","start","_useState8","setStartValue","_useState9","end","_useState0","setEndValue","_useState1","_useState10","isValid","setIsValid","conditions","isNumberType","isCharType","isStringType","isDateType","isBooleanType","handleConditionChange","debug","e","target","changeCondition","isConditionValid","conditionInputs","hasInvalidValue","showInvalid"],"sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport classNames from 'classnames';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport { Select } from '@deephaven/components';\nimport {\n StringCondition,\n DateCondition,\n getLabelForNumberCondition,\n getLabelForDateCondition,\n getLabelForStringCondition,\n NumberCondition,\n type ModelColumn,\n type ConditionConfig,\n getDefaultConditionForType,\n getLabelForBooleanCondition,\n BooleanCondition,\n CharCondition,\n type Condition,\n getLabelForCharCondition,\n isDateConditionValid,\n getDefaultValueForType,\n} from './ConditionalFormattingUtils';\n\nconst log = Log.module('ConditionEditor');\n\nexport interface ConditionEditorProps {\n dh: typeof DhType;\n column: ModelColumn;\n config: ConditionConfig;\n onChange?: (config: ConditionConfig, isValid: boolean) => void;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nconst numberConditionOptions = [\n NumberCondition.IS_EQUAL,\n NumberCondition.IS_NOT_EQUAL,\n NumberCondition.IS_BETWEEN,\n NumberCondition.GREATER_THAN,\n NumberCondition.GREATER_THAN_OR_EQUAL,\n NumberCondition.LESS_THAN,\n NumberCondition.LESS_THAN_OR_EQUAL,\n NumberCondition.IS_NULL,\n NumberCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForNumberCondition(option)}\n </option>\n));\n\nconst stringConditions = [\n StringCondition.IS_EXACTLY,\n StringCondition.IS_NOT_EXACTLY,\n StringCondition.CONTAINS,\n StringCondition.DOES_NOT_CONTAIN,\n StringCondition.STARTS_WITH,\n StringCondition.ENDS_WITH,\n StringCondition.IS_NULL,\n StringCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForStringCondition(option)}\n </option>\n));\n\nconst dateConditions = [\n DateCondition.IS_EXACTLY,\n DateCondition.IS_NOT_EXACTLY,\n DateCondition.IS_BEFORE,\n DateCondition.IS_BEFORE_OR_EQUAL,\n DateCondition.IS_AFTER,\n DateCondition.IS_AFTER_OR_EQUAL,\n DateCondition.IS_NULL,\n DateCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForDateCondition(option)}\n </option>\n));\n\nconst booleanConditions = [\n BooleanCondition.IS_TRUE,\n BooleanCondition.IS_FALSE,\n BooleanCondition.IS_NULL,\n BooleanCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForBooleanCondition(option)}\n </option>\n));\n\nconst charConditions = [\n CharCondition.IS_EQUAL,\n CharCondition.IS_NOT_EQUAL,\n CharCondition.IS_NULL,\n CharCondition.IS_NOT_NULL,\n].map(option => (\n <option key={option} value={option}>\n {getLabelForCharCondition(option)}\n </option>\n));\n\nfunction isNumberConditionValid(\n condition: NumberCondition,\n value?: string,\n startValue?: string,\n endValue?: string\n): boolean {\n if (\n condition === NumberCondition.IS_NULL ||\n condition === NumberCondition.IS_NOT_NULL\n ) {\n return true;\n }\n if (\n condition === NumberCondition.IS_BETWEEN &&\n startValue != null &&\n startValue !== '' &&\n !Number.isNaN(Number.parseFloat(startValue)) &&\n endValue != null &&\n endValue !== '' &&\n !Number.isNaN(Number.parseFloat(endValue))\n ) {\n return true;\n }\n if (\n condition !== NumberCondition.IS_BETWEEN &&\n value !== undefined &&\n value !== '' &&\n !Number.isNaN(Number.parseFloat(value))\n ) {\n return true;\n }\n return false;\n}\n\nfunction getNumberInputs(\n selectedCondition: NumberCondition,\n handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n handleStartValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n handleEndValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n isInvalid: boolean,\n conditionValue?: string,\n startValue?: string,\n endValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case NumberCondition.IS_EQUAL:\n case NumberCondition.IS_NOT_EQUAL:\n case NumberCondition.GREATER_THAN:\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n case NumberCondition.LESS_THAN:\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return (\n <input\n type=\"number\"\n className={classNames('form-control', { 'is-invalid': isInvalid })}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n case NumberCondition.IS_BETWEEN:\n return (\n <div className=\"d-flex flex-row\">\n <input\n type=\"number\"\n className={classNames('form-control', 'd-flex', 'mr-2', {\n 'is-invalid': isInvalid,\n })}\n placeholder=\"Start value\"\n value={startValue ?? ''}\n onChange={handleStartValueChange}\n />\n <input\n type=\"number\"\n className={classNames('form-control', 'd-flex', {\n 'is-invalid': isInvalid,\n })}\n placeholder=\"End value\"\n value={endValue ?? ''}\n onChange={handleEndValueChange}\n />\n </div>\n );\n case NumberCondition.IS_NULL:\n case NumberCondition.IS_NOT_NULL:\n return null;\n }\n}\n\nfunction getStringInputs(\n selectedCondition: StringCondition,\n handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n isInvalid: boolean,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case StringCondition.IS_NULL:\n case StringCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className={classNames('form-control', { 'is-invalid': isInvalid })}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getDateInputs(\n selectedCondition: DateCondition,\n handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n isInvalid: boolean,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case DateCondition.IS_NULL:\n case DateCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className={classNames('form-control', { 'is-invalid': isInvalid })}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction getBooleanInputs(): null {\n return null;\n}\n\nfunction getCharInputs(\n selectedCondition: CharCondition,\n handleValueChange: (e: React.ChangeEvent<HTMLInputElement>) => void,\n isInvalid: boolean,\n conditionValue?: string\n): JSX.Element | null {\n switch (selectedCondition) {\n case CharCondition.IS_NULL:\n case CharCondition.IS_NOT_NULL:\n return null;\n default:\n return (\n <input\n type=\"text\"\n className={classNames('form-control', { 'is-invalid': isInvalid })}\n maxLength={1}\n placeholder=\"Enter value\"\n value={conditionValue ?? ''}\n onChange={handleValueChange}\n />\n );\n }\n}\n\nfunction ConditionEditor(props: ConditionEditorProps): JSX.Element {\n const { column, config, dh, onChange = DEFAULT_CALLBACK } = props;\n const selectedColumnType = column.type;\n const [prevColumnType, setPrevColumnType] = useState(selectedColumnType);\n const [selectedCondition, setCondition] = useState(config.condition);\n const [conditionValue, setValue] = useState(config.value);\n const [startValue, setStartValue] = useState(config.start);\n const [endValue, setEndValue] = useState(config.end);\n const [isValid, setIsValid] = useState(true);\n\n if (selectedColumnType !== prevColumnType) {\n // Column type changed, reset condition and value fields\n setCondition(getDefaultConditionForType(selectedColumnType));\n setValue(getDefaultValueForType(selectedColumnType));\n setStartValue(undefined);\n setEndValue(undefined);\n setPrevColumnType(selectedColumnType);\n }\n\n const conditions = useMemo(() => {\n if (selectedColumnType === undefined) {\n return [];\n }\n if (TableUtils.isNumberType(selectedColumnType)) {\n return numberConditionOptions;\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return charConditions;\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return stringConditions;\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return dateConditions;\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return booleanConditions;\n }\n }, [selectedColumnType]);\n\n const handleConditionChange = useCallback((value: string) => {\n log.debug('handleConditionChange', value);\n setCondition(value as Condition);\n }, []);\n\n const handleValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n log.debug('handleValueChange', value);\n setValue(value);\n },\n []\n );\n\n const handleStartValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n log.debug('handleStartValueChange', value);\n setStartValue(value);\n },\n []\n );\n\n const handleEndValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n log.debug('handleEndValueChange', value);\n setEndValue(value);\n },\n []\n );\n\n useEffect(\n function changeCondition() {\n let isConditionValid = true;\n\n if (selectedCondition === undefined) {\n log.debug(\n 'Unable to create formatting rule. Condition is not selected.'\n );\n isConditionValid = false;\n } else if (\n TableUtils.isNumberType(column.type) &&\n !isNumberConditionValid(\n selectedCondition as NumberCondition,\n conditionValue,\n startValue,\n endValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid value',\n conditionValue\n );\n isConditionValid = false;\n } else if (\n TableUtils.isDateType(column.type) &&\n !isDateConditionValid(\n dh,\n selectedCondition as DateCondition,\n conditionValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid date condition',\n conditionValue\n );\n isConditionValid = false;\n }\n\n setIsValid(isConditionValid);\n onChange(\n {\n condition: selectedCondition,\n value: conditionValue,\n start: startValue,\n end: endValue,\n },\n isConditionValid\n );\n },\n [\n onChange,\n column.type,\n dh,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n ]\n );\n\n const conditionInputs = useMemo(() => {\n if (selectedColumnType === undefined) {\n // Column not selected\n return null;\n }\n\n // Show invalid state only when there's a non-empty value that fails validation\n const hasInvalidValue =\n !isValid && conditionValue !== undefined && conditionValue !== '';\n\n if (TableUtils.isNumberType(selectedColumnType)) {\n // For IS_BETWEEN, show invalid on each field only if that field has a value\n const showInvalid =\n selectedCondition === NumberCondition.IS_BETWEEN\n ? !isValid &&\n ((startValue !== undefined && startValue !== '') ||\n (endValue !== undefined && endValue !== ''))\n : hasInvalidValue;\n\n return getNumberInputs(\n selectedCondition as NumberCondition,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n showInvalid,\n conditionValue,\n startValue,\n endValue\n );\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return getCharInputs(\n selectedCondition as CharCondition,\n handleValueChange,\n hasInvalidValue,\n conditionValue\n );\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return getStringInputs(\n selectedCondition as StringCondition,\n handleValueChange,\n hasInvalidValue,\n conditionValue\n );\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return getDateInputs(\n selectedCondition as DateCondition,\n handleValueChange,\n hasInvalidValue,\n conditionValue\n );\n }\n if (TableUtils.isBooleanType(selectedColumnType)) {\n return getBooleanInputs();\n }\n }, [\n selectedColumnType,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n isValid,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n ]);\n\n return (\n <div className=\"condition-editor mb-2\">\n <Select\n value={selectedCondition}\n data-testid=\"condition-select\"\n className=\"custom-select mb-2\"\n onChange={handleConditionChange}\n >\n {conditions}\n </Select>\n {conditionInputs}\n </div>\n );\n}\n\nexport default ConditionEditor;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,G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AE;MAC7C,OAAOV,aAAa,CAClBX,iBAAiB,EACjBC,iBAAiB,EACjByD,eAAe,EACfrD,cACF,CAAC;IACH;IACA,IAAInE,UAAU,CAACgH,aAAa,CAAC7B,kBAAkB,CAAC,EAAE;MAChD,OAAOT,gBAAgB,CAAC,CAAC;IAC3B;EACF,CAAC,EAAE,CACDS,kBAAkB,EAClBrB,iBAAiB,EACjBK,cAAc,EACdX,UAAU,EACVC,QAAQ,EACRgD,OAAO,EACP1C,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB,CACrB,CAAC;EAEF,oBACE9C,KAAA;IAAKkD,SAAS,EAAC,uBAAuB;IAAAhC,QAAA,gBACpCpB,IAAA,CAACf,MAAM;MACLkC,KAAK,EAAE0B,iBAAkB;MACzB,eAAY,kBAAkB;MAC9BO,SAAS,EAAC,oBAAoB;MAC9BE,QAAQ,EAAE0C,qBAAsB;MAAA5E,QAAA,EAE/BsE;IAAU,CACL,CAAC,EACRY,eAAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe1C,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConditionEditor.js","names":["React","useCallback","useEffect","useMemo","useState","classNames","TableUtils","Log","ComboBox","Item","Picker","Section","StringCondition","DateCondition","getLabelForNumberCondition","getLabelForDateCondition","getLabelForStringCondition","NumberCondition","getDefaultConditionForType","getLabelForBooleanCondition","BooleanCondition","CharCondition","getLabelForCharCondition","isDateConditionValid","getDefaultValueForType","jsx","_jsx","jsxs","_jsxs","log","module","DEFAULT_CALLBACK","undefined","VALUE_PREFIX","COLUMN_PREFIX","numberValueConditions","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","numberColumnConditions","stringValueConditions","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","stringColumnConditions","dateValueConditions","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","dateColumnConditions","booleanValueConditions","IS_TRUE","IS_FALSE","booleanColumnConditions","charValueConditions","charColumnConditions","isNumberConditionValid","condition","value","startValue","endValue","Number","isNaN","parseFloat","ConditionEditor","props","column","columns","config","dh","_props$onChange","onChange","selectedColumnType","type","_useState","_useState2","_slicedToArray","prevColumnType","setPrevColumnType","_useState3","concat","rightHandValue","_useState4","selectedConditionKey","setConditionKey","selectedCondition","replace","isColumnMode","startsWith","_useState5","_useState6","conditionValue","setValue","_useState7","start","_useState8","setStartValue","_useState9","end","_useState0","setEndValue","_useState1","_useState10","isValid","setIsValid","getConditionLabel","isNumberType","isCharType","isStringType","isDateType","_useMemo","valueConditions","columnConditions","isBooleanType","map","c","children","_useMemo2","pickerValueItems","pickerColumnItems","handleConditionKeyChange","key","keyStr","String","debug","nextIsColumn","firstCompatible","find","getNormalizedType","name","handleRightHandValueChange","handleStartValueChange","e","target","handleEndValueChange","changeCondition","isConditionValid","length","conditionInputs","rhvIsColumn","hasInvalidValue","compatibleRhvColumns","filter","isInvalid","className","placeholder","selectedKey","col","width","UNSAFE_className","title"],"sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport classNames from 'classnames';\nimport { TableUtils } from '@deephaven/jsapi-utils';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\nimport {\n ComboBox,\n Item,\n type ItemKey,\n Picker,\n Section,\n} from '@deephaven/components';\nimport {\n StringCondition,\n DateCondition,\n getLabelForNumberCondition,\n getLabelForDateCondition,\n getLabelForStringCondition,\n NumberCondition,\n type ModelColumn,\n type ConditionConfig,\n getDefaultConditionForType,\n getLabelForBooleanCondition,\n BooleanCondition,\n CharCondition,\n type Condition,\n getLabelForCharCondition,\n isDateConditionValid,\n getDefaultValueForType,\n} from './ConditionalFormattingUtils';\n\nconst log = Log.module('ConditionEditor');\n\nexport interface ConditionEditorProps {\n dh: typeof DhType;\n column: ModelColumn;\n columns: ModelColumn[];\n config: ConditionConfig;\n onChange?: (config: ConditionConfig, isValid: boolean) => void;\n}\n\nconst DEFAULT_CALLBACK = (): void => undefined;\n\nconst VALUE_PREFIX = 'value-';\nconst COLUMN_PREFIX = 'column-';\n\nconst numberValueConditions = [\n NumberCondition.IS_EQUAL,\n NumberCondition.IS_NOT_EQUAL,\n NumberCondition.IS_BETWEEN,\n NumberCondition.GREATER_THAN,\n NumberCondition.GREATER_THAN_OR_EQUAL,\n NumberCondition.LESS_THAN,\n NumberCondition.LESS_THAN_OR_EQUAL,\n NumberCondition.IS_NULL,\n NumberCondition.IS_NOT_NULL,\n];\n\nconst numberColumnConditions = [\n NumberCondition.IS_EQUAL,\n NumberCondition.IS_NOT_EQUAL,\n NumberCondition.GREATER_THAN,\n NumberCondition.GREATER_THAN_OR_EQUAL,\n NumberCondition.LESS_THAN,\n NumberCondition.LESS_THAN_OR_EQUAL,\n];\n\nconst stringValueConditions = [\n StringCondition.IS_EXACTLY,\n StringCondition.IS_NOT_EXACTLY,\n StringCondition.CONTAINS,\n StringCondition.DOES_NOT_CONTAIN,\n StringCondition.STARTS_WITH,\n StringCondition.ENDS_WITH,\n StringCondition.IS_NULL,\n StringCondition.IS_NOT_NULL,\n];\n\nconst stringColumnConditions = [\n StringCondition.IS_EXACTLY,\n StringCondition.IS_NOT_EXACTLY,\n StringCondition.CONTAINS,\n StringCondition.DOES_NOT_CONTAIN,\n StringCondition.STARTS_WITH,\n StringCondition.ENDS_WITH,\n];\n\nconst dateValueConditions = [\n DateCondition.IS_EXACTLY,\n DateCondition.IS_NOT_EXACTLY,\n DateCondition.IS_BEFORE,\n DateCondition.IS_BEFORE_OR_EQUAL,\n DateCondition.IS_AFTER,\n DateCondition.IS_AFTER_OR_EQUAL,\n DateCondition.IS_NULL,\n DateCondition.IS_NOT_NULL,\n];\n\nconst dateColumnConditions = [\n DateCondition.IS_EXACTLY,\n DateCondition.IS_NOT_EXACTLY,\n DateCondition.IS_BEFORE,\n DateCondition.IS_BEFORE_OR_EQUAL,\n DateCondition.IS_AFTER,\n DateCondition.IS_AFTER_OR_EQUAL,\n];\n\nconst booleanValueConditions = [\n BooleanCondition.IS_TRUE,\n BooleanCondition.IS_FALSE,\n BooleanCondition.IS_EQUAL,\n BooleanCondition.IS_NOT_EQUAL,\n BooleanCondition.IS_NULL,\n BooleanCondition.IS_NOT_NULL,\n];\n\nconst booleanColumnConditions = [\n BooleanCondition.IS_EQUAL,\n BooleanCondition.IS_NOT_EQUAL,\n];\n\nconst charValueConditions = [\n CharCondition.IS_EQUAL,\n CharCondition.IS_NOT_EQUAL,\n CharCondition.IS_NULL,\n CharCondition.IS_NOT_NULL,\n];\n\nconst charColumnConditions = [\n CharCondition.IS_EQUAL,\n CharCondition.IS_NOT_EQUAL,\n];\n\nfunction isNumberConditionValid(\n condition: NumberCondition,\n value?: string,\n startValue?: string,\n endValue?: string\n): boolean {\n if (\n condition === NumberCondition.IS_NULL ||\n condition === NumberCondition.IS_NOT_NULL\n ) {\n return true;\n }\n if (\n condition === NumberCondition.IS_BETWEEN &&\n startValue != null &&\n startValue !== '' &&\n !Number.isNaN(Number.parseFloat(startValue)) &&\n endValue != null &&\n endValue !== '' &&\n !Number.isNaN(Number.parseFloat(endValue))\n ) {\n return true;\n }\n if (\n condition !== NumberCondition.IS_BETWEEN &&\n value !== undefined &&\n value !== '' &&\n !Number.isNaN(Number.parseFloat(value))\n ) {\n return true;\n }\n return false;\n}\n\nfunction ConditionEditor(props: ConditionEditorProps): JSX.Element {\n const { column, columns, config, dh, onChange = DEFAULT_CALLBACK } = props;\n const selectedColumnType = column.type;\n const [prevColumnType, setPrevColumnType] = useState(selectedColumnType);\n\n // Encode both condition and RHV mode in a single key: 'value-is-equal' or 'column-is-equal'\n const [selectedConditionKey, setConditionKey] = useState(\n () =>\n `${\n typeof config.rightHandValue === 'object' ? COLUMN_PREFIX : VALUE_PREFIX\n }${config.condition}`\n );\n const selectedCondition = selectedConditionKey.replace(\n /^(value|column)-/,\n ''\n ) as Condition;\n const isColumnMode = selectedConditionKey.startsWith(COLUMN_PREFIX);\n\n const [conditionValue, setValue] = useState<string | ModelColumn | undefined>(\n config.rightHandValue\n );\n const [startValue, setStartValue] = useState(config.start);\n const [endValue, setEndValue] = useState(config.end);\n const [isValid, setIsValid] = useState(true);\n\n if (selectedColumnType !== prevColumnType) {\n // Column type changed, reset condition and value fields\n setConditionKey(\n `${VALUE_PREFIX}${getDefaultConditionForType(selectedColumnType)}`\n );\n setValue(getDefaultValueForType(selectedColumnType));\n setStartValue(undefined);\n setEndValue(undefined);\n setPrevColumnType(selectedColumnType);\n }\n\n // Build label helper for any condition enum value\n const getConditionLabel = useCallback(\n (condition: Condition): string => {\n if (TableUtils.isNumberType(selectedColumnType)) {\n return getLabelForNumberCondition(condition as NumberCondition);\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return getLabelForCharCondition(condition as CharCondition);\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return getLabelForStringCondition(condition as StringCondition);\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return getLabelForDateCondition(condition as DateCondition);\n }\n return getLabelForBooleanCondition(condition as BooleanCondition);\n },\n [selectedColumnType]\n );\n\n const [pickerValueItems, pickerColumnItems] = useMemo(() => {\n let valueConditions: Condition[] = [];\n let columnConditions: Condition[] = [];\n if (TableUtils.isNumberType(selectedColumnType)) {\n valueConditions = numberValueConditions;\n columnConditions = numberColumnConditions;\n } else if (TableUtils.isCharType(selectedColumnType)) {\n valueConditions = charValueConditions;\n columnConditions = charColumnConditions;\n } else if (TableUtils.isStringType(selectedColumnType)) {\n valueConditions = stringValueConditions;\n columnConditions = stringColumnConditions;\n } else if (TableUtils.isDateType(selectedColumnType)) {\n valueConditions = dateValueConditions;\n columnConditions = dateColumnConditions;\n } else if (TableUtils.isBooleanType(selectedColumnType)) {\n valueConditions = booleanValueConditions;\n columnConditions = booleanColumnConditions;\n }\n return [\n valueConditions.map(c => (\n <Item key={`${VALUE_PREFIX}${c}`}>{getConditionLabel(c)}</Item>\n )),\n columnConditions.map(c => (\n <Item key={`${COLUMN_PREFIX}${c}`}>{getConditionLabel(c)}</Item>\n )),\n ];\n }, [selectedColumnType, getConditionLabel]);\n\n const handleConditionKeyChange = useCallback(\n (key: ItemKey | null) => {\n if (key == null) return;\n const keyStr = String(key);\n log.debug('handleConditionKeyChange', keyStr);\n const nextIsColumn = keyStr.startsWith(COLUMN_PREFIX);\n if (nextIsColumn && typeof conditionValue !== 'object') {\n // Switching to column mode — default to first compatible column\n const firstCompatible = columns.find(c => {\n if (TableUtils.isNumberType(selectedColumnType)) {\n return TableUtils.isNumberType(c.type);\n }\n return (\n TableUtils.getNormalizedType(selectedColumnType) ===\n TableUtils.getNormalizedType(c.type)\n );\n });\n setValue(\n firstCompatible != null\n ? { name: firstCompatible.name, type: firstCompatible.type }\n : undefined\n );\n } else if (!nextIsColumn && typeof conditionValue === 'object') {\n // Switching to value mode — clear the column value\n setValue(getDefaultValueForType(selectedColumnType));\n }\n setConditionKey(keyStr);\n },\n [columns, selectedColumnType, conditionValue]\n );\n\n const handleRightHandValueChange = useCallback(\n (value: string | ModelColumn | undefined) => {\n log.debug('handleRightHandValueChange', value);\n setValue(value);\n },\n []\n );\n\n const handleStartValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n log.debug('handleStartValueChange', value);\n setStartValue(value);\n },\n []\n );\n\n const handleEndValueChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const { value } = e.target;\n log.debug('handleEndValueChange', value);\n setEndValue(value);\n },\n []\n );\n\n useEffect(\n function changeCondition() {\n let isConditionValid = true;\n\n if (selectedCondition === undefined) {\n log.debug(\n 'Unable to create formatting rule. Condition is not selected.'\n );\n isConditionValid = false;\n } else if (\n TableUtils.isNumberType(column.type) &&\n (selectedCondition === NumberCondition.IS_BETWEEN ||\n typeof conditionValue !== 'object') &&\n !isNumberConditionValid(\n selectedCondition as NumberCondition,\n typeof conditionValue === 'string' ? conditionValue : undefined,\n startValue,\n endValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid value',\n conditionValue\n );\n isConditionValid = false;\n } else if (\n TableUtils.isDateType(column.type) &&\n typeof conditionValue !== 'object' &&\n !isDateConditionValid(\n dh,\n selectedCondition as DateCondition,\n conditionValue\n )\n ) {\n log.debug(\n 'Unable to create formatting rule. Invalid date condition',\n conditionValue\n );\n isConditionValid = false;\n } else if (\n TableUtils.isCharType(column.type) &&\n typeof conditionValue !== 'object' &&\n selectedCondition !== CharCondition.IS_NULL &&\n selectedCondition !== CharCondition.IS_NOT_NULL &&\n (conditionValue === undefined || conditionValue.length !== 1)\n ) {\n log.debug(\n 'Unable to create formatting rule. Char value must be a single character',\n conditionValue\n );\n isConditionValid = false;\n } else if (\n TableUtils.isBooleanType(column.type) &&\n typeof conditionValue !== 'object' &&\n (selectedCondition === BooleanCondition.IS_EQUAL ||\n selectedCondition === BooleanCondition.IS_NOT_EQUAL) &&\n conditionValue !== 'true' &&\n conditionValue !== 'false' &&\n conditionValue !== 'null'\n ) {\n log.debug(\n 'Unable to create formatting rule. Boolean comparison requires a column, true, false, or null',\n conditionValue\n );\n isConditionValid = false;\n }\n\n setIsValid(isConditionValid);\n onChange(\n {\n condition: selectedCondition,\n rightHandValue: conditionValue,\n start: startValue,\n end: endValue,\n },\n isConditionValid\n );\n },\n [\n onChange,\n column.type,\n dh,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n ]\n );\n\n const conditionInputs = useMemo(() => {\n if (selectedColumnType === undefined) {\n // Column not selected\n return null;\n }\n\n // IS_NULL/IS_NOT_NULL enum values are identical across all types ('is-null' /\n // 'is-not-null'), so checking one enum covers all.\n // Boolean IS_TRUE/IS_FALSE also never need a value input.\n if (\n selectedCondition === StringCondition.IS_NULL ||\n selectedCondition === StringCondition.IS_NOT_NULL ||\n selectedCondition === BooleanCondition.IS_TRUE ||\n selectedCondition === BooleanCondition.IS_FALSE\n ) {\n return null;\n }\n\n // A ModelColumn rightHandValue is always valid (column-vs-column comparison).\n // For string values, check type-specific validity.\n const rhvIsColumn = typeof conditionValue === 'object';\n const hasInvalidValue =\n !rhvIsColumn &&\n !isValid &&\n conditionValue !== undefined &&\n conditionValue !== '';\n\n // Only offer columns that are type-compatible with the condition column so\n // the generated expression is valid (e.g. prevent startsWith(intColumn)).\n // Numbers are cross-compatible (int vs double). Everything else requires the same\n // normalized type. (Note: text types are not compatible (string vs char)\n const compatibleRhvColumns = columns.filter(c => {\n if (TableUtils.isNumberType(selectedColumnType)) {\n return TableUtils.isNumberType(c.type);\n }\n return (\n TableUtils.getNormalizedType(selectedColumnType) ===\n TableUtils.getNormalizedType(c.type)\n );\n });\n\n // IS_BETWEEN uses two separate range inputs\n if (\n TableUtils.isNumberType(selectedColumnType) &&\n selectedCondition === NumberCondition.IS_BETWEEN\n ) {\n const isInvalid =\n !rhvIsColumn &&\n !isValid &&\n ((startValue !== undefined && startValue !== '') ||\n (endValue !== undefined && endValue !== ''));\n return (\n <div className=\"d-flex flex-row\">\n <input\n type=\"number\"\n className={classNames('form-control', 'd-flex', 'mr-2', {\n 'is-invalid': isInvalid,\n })}\n placeholder=\"Start value\"\n value={startValue ?? ''}\n onChange={handleStartValueChange}\n />\n <input\n type=\"number\"\n className={classNames('form-control', 'd-flex', {\n 'is-invalid': isInvalid,\n })}\n placeholder=\"End value\"\n value={endValue ?? ''}\n onChange={handleEndValueChange}\n />\n </div>\n );\n }\n\n if (isColumnMode) {\n return (\n <ComboBox\n aria-label=\"Select a column\"\n selectedKey={\n typeof conditionValue === 'object' ? conditionValue.name : null\n }\n onChange={key => {\n if (key == null) return;\n const col = compatibleRhvColumns.find(c => c.name === String(key));\n if (col != null) {\n handleRightHandValueChange({ name: col.name, type: col.type });\n }\n }}\n >\n {compatibleRhvColumns.map(c => c.name)}\n </ComboBox>\n );\n }\n\n return (\n <input\n type={TableUtils.isNumberType(selectedColumnType) ? 'number' : 'text'}\n className={classNames('form-control', {\n 'is-invalid': hasInvalidValue,\n })}\n value={typeof conditionValue === 'string' ? conditionValue : ''}\n placeholder=\"Enter a value\"\n onChange={e => handleRightHandValueChange(e.target.value)}\n />\n );\n }, [\n columns,\n selectedColumnType,\n selectedCondition,\n conditionValue,\n startValue,\n endValue,\n isValid,\n handleRightHandValueChange,\n handleStartValueChange,\n handleEndValueChange,\n isColumnMode,\n ]);\n\n return (\n <div className=\"condition-editor mb-2\">\n <Picker\n selectedKey={selectedConditionKey}\n aria-label=\"Select condition\"\n data-testid=\"condition-select\"\n width=\"100%\"\n UNSAFE_className=\"mb-2\"\n onChange={handleConditionKeyChange}\n >\n <Section title=\"Value\">{pickerValueItems}</Section>\n <Section title=\"Column\">{pickerColumnItems}</Section>\n </Picker>\n {conditionInputs}\n </div>\n );\n}\n\nexport default ConditionEditor;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,OAAOC,UAAU,MAAM,YAAY;AACnC,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SACEC,QAAQ,EACRC,IAAI,EAEJC,MAAM,EACNC,OAAO,QACF,uBAAuB;AAAC,SAE7BC,eAAe,EACfC,aAAa,EACbC,0BAA0B,EAC1BC,wBAAwB,EACxBC,0BAA0B,EAC1BC,eAAe,EAGfC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,gBAAgB,EAChBC,aAAa,EAEbC,wBAAwB,EACxBC,oBAAoB,EACpBC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAGxB,IAAMC,GAAG,GAAGtB,GAAG,CAACuB,MAAM,CAAC,iBAAiB,CAAC;AAUzC,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,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oBACErE,KAAA;IAAK8H,SAAS,EAAC,uBAAuB;IAAA5B,QAAA,gBACpClG,KAAA,CAAClB,MAAM;MACLkJ,WAAW,EAAE/D,oBAAqB;MAClC,cAAW,kBAAkB;MAC7B,eAAY,kBAAkB;MAC9BiE,KAAK,EAAC,MAAM;MACZC,gBAAgB,EAAC,MAAM;MACvB9E,QAAQ,EAAEiD,wBAAyB;MAAAJ,QAAA,gBAEnCpG,IAAA,CAACf,OAAO;QAACqJ,KAAK,EAAC,OAAO;QAAAlC,QAAA,EAAEE;MAAgB,CAAU,CAAC,eACnDtG,IAAA,CAACf,OAAO;QAACqJ,KAAK,EAAC,QAAQ;QAAAlC,QAAA,EAAEG;MAAiB,CAAU,CAAC;IAAA,CAC/C,CAAC,EACRmB,eAAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe1E,eAAe","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ import classNames from 'classnames';
|
|
|
9
9
|
import { Button } from '@deephaven/components';
|
|
10
10
|
import Log from '@deephaven/log';
|
|
11
11
|
import { FormatColumnWhereIcon, FormatRowWhereIcon } from "../icons/index.js";
|
|
12
|
-
import
|
|
12
|
+
import MultiColumnFormatEditor from "./MultiColumnFormatEditor.js";
|
|
13
13
|
import RowFormatEditor from "./RowFormatEditor.js";
|
|
14
14
|
import { FormatterType, isSupportedColumn } from "./ConditionalFormattingUtils.js";
|
|
15
15
|
import "./ConditionalFormatEditor.css";
|
|
@@ -104,7 +104,7 @@ function ConditionalFormatEditor(props) {
|
|
|
104
104
|
})
|
|
105
105
|
}, type))
|
|
106
106
|
})]
|
|
107
|
-
}), selectedFormatter === FormatterType.CONDITIONAL && /*#__PURE__*/_jsx(
|
|
107
|
+
}), selectedFormatter === FormatterType.CONDITIONAL && /*#__PURE__*/_jsx(MultiColumnFormatEditor, {
|
|
108
108
|
columns: columns,
|
|
109
109
|
dh: dh,
|
|
110
110
|
config: rule === null || rule === void 0 ? void 0 : rule.config,
|