@deephaven/iris-grid 1.18.0 → 1.18.1
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/sidebar/conditional-formatting/ConditionEditor.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionEditor.js +40 -20
- package/dist/sidebar/conditional-formatting/ConditionEditor.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.d.ts +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js +2 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.js.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts +2 -2
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.d.ts.map +1 -1
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js +22 -19
- package/dist/sidebar/conditional-formatting/ConditionalFormattingUtils.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEditor.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"names":[],"mappings":"
|
|
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;AAG3D,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,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CAChE;AA2OD,iBAAS,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CAsNjE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
import { TableUtils } from '@deephaven/jsapi-utils';
|
|
3
4
|
import Log from '@deephaven/log';
|
|
4
5
|
import { Select } from '@deephaven/components';
|
|
@@ -38,7 +39,7 @@ function isNumberConditionValid(condition, value, startValue, endValue) {
|
|
|
38
39
|
}
|
|
39
40
|
return false;
|
|
40
41
|
}
|
|
41
|
-
function getNumberInputs(selectedCondition, handleValueChange, handleStartValueChange, handleEndValueChange, conditionValue, startValue, endValue) {
|
|
42
|
+
function getNumberInputs(selectedCondition, handleValueChange, handleStartValueChange, handleEndValueChange, isInvalid, conditionValue, startValue, endValue) {
|
|
42
43
|
switch (selectedCondition) {
|
|
43
44
|
case NumberCondition.IS_EQUAL:
|
|
44
45
|
case NumberCondition.IS_NOT_EQUAL:
|
|
@@ -48,7 +49,9 @@ function getNumberInputs(selectedCondition, handleValueChange, handleStartValueC
|
|
|
48
49
|
case NumberCondition.LESS_THAN_OR_EQUAL:
|
|
49
50
|
return /*#__PURE__*/_jsx("input", {
|
|
50
51
|
type: "number",
|
|
51
|
-
className:
|
|
52
|
+
className: classNames('form-control', {
|
|
53
|
+
'is-invalid': isInvalid
|
|
54
|
+
}),
|
|
52
55
|
placeholder: "Enter value",
|
|
53
56
|
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
54
57
|
onChange: handleValueChange
|
|
@@ -58,13 +61,17 @@ function getNumberInputs(selectedCondition, handleValueChange, handleStartValueC
|
|
|
58
61
|
className: "d-flex flex-row",
|
|
59
62
|
children: [/*#__PURE__*/_jsx("input", {
|
|
60
63
|
type: "number",
|
|
61
|
-
className:
|
|
64
|
+
className: classNames('form-control', 'd-flex', 'mr-2', {
|
|
65
|
+
'is-invalid': isInvalid
|
|
66
|
+
}),
|
|
62
67
|
placeholder: "Start value",
|
|
63
68
|
value: startValue !== null && startValue !== void 0 ? startValue : '',
|
|
64
69
|
onChange: handleStartValueChange
|
|
65
70
|
}), /*#__PURE__*/_jsx("input", {
|
|
66
71
|
type: "number",
|
|
67
|
-
className:
|
|
72
|
+
className: classNames('form-control', 'd-flex', {
|
|
73
|
+
'is-invalid': isInvalid
|
|
74
|
+
}),
|
|
68
75
|
placeholder: "End value",
|
|
69
76
|
value: endValue !== null && endValue !== void 0 ? endValue : '',
|
|
70
77
|
onChange: handleEndValueChange
|
|
@@ -75,7 +82,7 @@ function getNumberInputs(selectedCondition, handleValueChange, handleStartValueC
|
|
|
75
82
|
return null;
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
function getStringInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
85
|
+
function getStringInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
79
86
|
switch (selectedCondition) {
|
|
80
87
|
case StringCondition.IS_NULL:
|
|
81
88
|
case StringCondition.IS_NOT_NULL:
|
|
@@ -83,14 +90,16 @@ function getStringInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
|
83
90
|
default:
|
|
84
91
|
return /*#__PURE__*/_jsx("input", {
|
|
85
92
|
type: "text",
|
|
86
|
-
className:
|
|
93
|
+
className: classNames('form-control', {
|
|
94
|
+
'is-invalid': isInvalid
|
|
95
|
+
}),
|
|
87
96
|
placeholder: "Enter value",
|
|
88
97
|
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
89
98
|
onChange: handleValueChange
|
|
90
99
|
});
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
|
-
function getDateInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
102
|
+
function getDateInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
94
103
|
switch (selectedCondition) {
|
|
95
104
|
case DateCondition.IS_NULL:
|
|
96
105
|
case DateCondition.IS_NOT_NULL:
|
|
@@ -98,7 +107,9 @@ function getDateInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
|
98
107
|
default:
|
|
99
108
|
return /*#__PURE__*/_jsx("input", {
|
|
100
109
|
type: "text",
|
|
101
|
-
className:
|
|
110
|
+
className: classNames('form-control', {
|
|
111
|
+
'is-invalid': isInvalid
|
|
112
|
+
}),
|
|
102
113
|
placeholder: "Enter value",
|
|
103
114
|
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
104
115
|
onChange: handleValueChange
|
|
@@ -108,7 +119,7 @@ function getDateInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
|
108
119
|
function getBooleanInputs() {
|
|
109
120
|
return null;
|
|
110
121
|
}
|
|
111
|
-
function getCharInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
122
|
+
function getCharInputs(selectedCondition, handleValueChange, isInvalid, conditionValue) {
|
|
112
123
|
switch (selectedCondition) {
|
|
113
124
|
case CharCondition.IS_NULL:
|
|
114
125
|
case CharCondition.IS_NOT_NULL:
|
|
@@ -116,7 +127,9 @@ function getCharInputs(selectedCondition, handleValueChange, conditionValue) {
|
|
|
116
127
|
default:
|
|
117
128
|
return /*#__PURE__*/_jsx("input", {
|
|
118
129
|
type: "text",
|
|
119
|
-
className:
|
|
130
|
+
className: classNames('form-control', {
|
|
131
|
+
'is-invalid': isInvalid
|
|
132
|
+
}),
|
|
120
133
|
maxLength: 1,
|
|
121
134
|
placeholder: "Enter value",
|
|
122
135
|
value: conditionValue !== null && conditionValue !== void 0 ? conditionValue : '',
|
|
@@ -137,6 +150,7 @@ function ConditionEditor(props) {
|
|
|
137
150
|
var [conditionValue, setValue] = useState(config.value);
|
|
138
151
|
var [startValue, setStartValue] = useState(config.start);
|
|
139
152
|
var [endValue, setEndValue] = useState(config.end);
|
|
153
|
+
var [isValid, setIsValid] = useState(true);
|
|
140
154
|
if (selectedColumnType !== prevColumnType) {
|
|
141
155
|
// Column type changed, reset condition and value fields
|
|
142
156
|
setCondition(getDefaultConditionForType(selectedColumnType));
|
|
@@ -191,45 +205,51 @@ function ConditionEditor(props) {
|
|
|
191
205
|
setEndValue(value);
|
|
192
206
|
}, []);
|
|
193
207
|
useEffect(function changeCondition() {
|
|
194
|
-
var
|
|
208
|
+
var isConditionValid = true;
|
|
195
209
|
if (selectedCondition === undefined) {
|
|
196
210
|
log.debug('Unable to create formatting rule. Condition is not selected.');
|
|
197
|
-
|
|
211
|
+
isConditionValid = false;
|
|
198
212
|
} else if (TableUtils.isNumberType(column.type) && !isNumberConditionValid(selectedCondition, conditionValue, startValue, endValue)) {
|
|
199
213
|
log.debug('Unable to create formatting rule. Invalid value', conditionValue);
|
|
200
|
-
|
|
214
|
+
isConditionValid = false;
|
|
201
215
|
} else if (TableUtils.isDateType(column.type) && !isDateConditionValid(dh, selectedCondition, conditionValue)) {
|
|
202
216
|
log.debug('Unable to create formatting rule. Invalid date condition', conditionValue);
|
|
203
|
-
|
|
217
|
+
isConditionValid = false;
|
|
204
218
|
}
|
|
219
|
+
setIsValid(isConditionValid);
|
|
205
220
|
onChange({
|
|
206
221
|
condition: selectedCondition,
|
|
207
222
|
value: conditionValue,
|
|
208
223
|
start: startValue,
|
|
209
224
|
end: endValue
|
|
210
|
-
},
|
|
225
|
+
}, isConditionValid);
|
|
211
226
|
}, [onChange, column.type, dh, selectedCondition, conditionValue, startValue, endValue]);
|
|
212
227
|
var conditionInputs = useMemo(() => {
|
|
213
228
|
if (selectedColumnType === undefined) {
|
|
214
229
|
// Column not selected
|
|
215
230
|
return null;
|
|
216
231
|
}
|
|
232
|
+
|
|
233
|
+
// Show invalid state only when there's a non-empty value that fails validation
|
|
234
|
+
var hasInvalidValue = !isValid && conditionValue !== undefined && conditionValue !== '';
|
|
217
235
|
if (TableUtils.isNumberType(selectedColumnType)) {
|
|
218
|
-
|
|
236
|
+
// For IS_BETWEEN, show invalid on each field only if that field has a value
|
|
237
|
+
var showInvalid = selectedCondition === NumberCondition.IS_BETWEEN ? !isValid && (startValue !== undefined && startValue !== '' || endValue !== undefined && endValue !== '') : hasInvalidValue;
|
|
238
|
+
return getNumberInputs(selectedCondition, handleValueChange, handleStartValueChange, handleEndValueChange, showInvalid, conditionValue, startValue, endValue);
|
|
219
239
|
}
|
|
220
240
|
if (TableUtils.isCharType(selectedColumnType)) {
|
|
221
|
-
return getCharInputs(selectedCondition, handleValueChange, conditionValue);
|
|
241
|
+
return getCharInputs(selectedCondition, handleValueChange, hasInvalidValue, conditionValue);
|
|
222
242
|
}
|
|
223
243
|
if (TableUtils.isStringType(selectedColumnType)) {
|
|
224
|
-
return getStringInputs(selectedCondition, handleValueChange, conditionValue);
|
|
244
|
+
return getStringInputs(selectedCondition, handleValueChange, hasInvalidValue, conditionValue);
|
|
225
245
|
}
|
|
226
246
|
if (TableUtils.isDateType(selectedColumnType)) {
|
|
227
|
-
return getDateInputs(selectedCondition, handleValueChange, conditionValue);
|
|
247
|
+
return getDateInputs(selectedCondition, handleValueChange, hasInvalidValue, conditionValue);
|
|
228
248
|
}
|
|
229
249
|
if (TableUtils.isBooleanType(selectedColumnType)) {
|
|
230
250
|
return getBooleanInputs();
|
|
231
251
|
}
|
|
232
|
-
}, [selectedColumnType, selectedCondition, conditionValue, startValue, endValue, handleValueChange, handleStartValueChange, handleEndValueChange]);
|
|
252
|
+
}, [selectedColumnType, selectedCondition, conditionValue, startValue, endValue, isValid, handleValueChange, handleStartValueChange, handleEndValueChange]);
|
|
233
253
|
return /*#__PURE__*/_jsxs("div", {
|
|
234
254
|
className: "condition-editor mb-2",
|
|
235
255
|
children: [/*#__PURE__*/_jsx(Select, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionEditor.js","names":["React","useCallback","useEffect","useMemo","useState","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","conditionValue","type","className","placeholder","onChange","getStringInputs","getDateInputs","getBooleanInputs","getCharInputs","maxLength","ConditionEditor","props","column","config","dh","selectedColumnType","prevColumnType","setPrevColumnType","setCondition","setValue","setStartValue","start","setEndValue","end","conditions","isNumberType","isCharType","isStringType","isDateType","isBooleanType","handleConditionChange","debug","e","target","changeCondition","isValid","conditionInputs"],"sources":["../../../src/sidebar/conditional-formatting/ConditionEditor.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\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 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=\"form-control\"\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=\"form-control d-flex mr-2\"\n placeholder=\"Start value\"\n value={startValue ?? ''}\n onChange={handleStartValueChange}\n />\n <input\n type=\"number\"\n className=\"form-control d-flex\"\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 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=\"form-control\"\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 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=\"form-control\"\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 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=\"form-control\"\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\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 isValid = true;\n\n if (selectedCondition === undefined) {\n log.debug(\n 'Unable to create formatting rule. Condition is not selected.'\n );\n isValid = 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 isValid = 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 isValid = false;\n }\n\n onChange(\n {\n condition: selectedCondition,\n value: conditionValue,\n start: startValue,\n end: endValue,\n },\n isValid\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 if (TableUtils.isNumberType(selectedColumnType)) {\n return getNumberInputs(\n selectedCondition as NumberCondition,\n handleValueChange,\n handleStartValueChange,\n handleEndValueChange,\n conditionValue,\n startValue,\n endValue\n );\n }\n if (TableUtils.isCharType(selectedColumnType)) {\n return getCharInputs(\n selectedCondition as CharCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isStringType(selectedColumnType)) {\n return getStringInputs(\n selectedCondition as StringCondition,\n handleValueChange,\n conditionValue\n );\n }\n if (TableUtils.isDateType(selectedColumnType)) {\n return getDateInputs(\n selectedCondition as DateCondition,\n handleValueChange,\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 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,SAASC,UAAU,QAAQ,wBAAwB;AAEnD,OAAOC,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAE7CC,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,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AAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe1B,eAAe","ignoreList":[]}
|
|
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","selectedColumnType","prevColumnType","setPrevColumnType","setCondition","setValue","setStartValue","start","setEndValue","end","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,GAAG,MAAM,gBAAgB;AAChC,SAASC,MAAM,QAAQ,uBAAuB;AAAC,SAE7CC,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,GAAGnB,GAAG,CAACoB,MAAM,CAAC,iBAAiB,CAAC;AASzC,IAAMC,gBAAgB,GAAGA,CAAA,KAAYC,SAAS;AAE9C,IAAMC,sBAAsB,GAAG,CAC7BhB,eAAe,CAACiB,QAAQ,EACxBjB,eAAe,CAACkB,YAAY,EAC5BlB,eAAe,CAACmB,UAAU,EAC1BnB,eAAe,CAACoB,YAAY,EAC5BpB,eAAe,CAACqB,qBAAqB,EACrCrB,eAAe,CAACsB,SAAS,EACzBtB,eAA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AClBX,iBAAiB,EACjBC,iBAAiB,EACjB2C,eAAe,EACfvC,cACF,CAAC;IACH;IACA,IAAInE,UAAU,CAACkG,aAAa,CAAChB,kBAAkB,CAAC,EAAE;MAChD,OAAOR,gBAAgB,CAAC,CAAC;IAC3B;EACF,CAAC,EAAE,CACDQ,kBAAkB,EAClBpB,iBAAiB,EACjBK,cAAc,EACdX,UAAU,EACVC,QAAQ,EACRkC,OAAO,EACP5B,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,EAAE4B,qBAAsB;MAAA9D,QAAA,EAE/BwD;IAAU,CACL,CAAC,EACRY,eAAe;EAAA,CACb,CAAC;AAEV;AAEA,eAAe5B,eAAe","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { dh as DhType } from '@deephaven/jsapi-types';
|
|
2
2
|
import { type BaseFormatConfig } from './ConditionalFormattingUtils';
|
|
3
|
-
export declare function makeTernaryFormatRule(config: BaseFormatConfig, prevRule: string): string | undefined;
|
|
3
|
+
export declare function makeTernaryFormatRule(dh: typeof DhType, config: BaseFormatConfig, prevRule: string): string | undefined;
|
|
4
4
|
export declare function makeRowFormatColumn(dh: typeof DhType, rule: string): DhType.CustomColumn;
|
|
5
5
|
export declare function makeColumnFormatColumn(col: DhType.Column, rule: string): DhType.CustomColumn;
|
|
6
6
|
//# sourceMappingURL=ConditionalFormattingAPIUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingAPIUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8BAA8B,CAAC;AAMtC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,OAAO,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,YAAY,CAErB;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,YAAY,CAErB"}
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingAPIUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,8BAA8B,CAAC;AAMtC,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,OAAO,MAAM,EACjB,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAOpB;AAED,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,OAAO,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,YAAY,CAErB;AAED,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,CAAC,MAAM,EAClB,IAAI,EAAE,MAAM,GACX,MAAM,CAAC,YAAY,CAErB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getConditionDBString, getStyleDBString } from "./ConditionalFormattingUtils.js"; // Conditional formatting API utils in a separate file
|
|
2
2
|
// to make ConditionalFormattingUtils.ts easier to test.
|
|
3
3
|
// https://github.com/facebook/jest/issues/936#issuecomment-545080082
|
|
4
|
-
export function makeTernaryFormatRule(config, prevRule) {
|
|
4
|
+
export function makeTernaryFormatRule(dh, config, prevRule) {
|
|
5
5
|
var styleDBString = getStyleDBString(config);
|
|
6
6
|
if (styleDBString === undefined) {
|
|
7
7
|
return undefined;
|
|
8
8
|
}
|
|
9
|
-
var conditionDBString = getConditionDBString(config);
|
|
9
|
+
var conditionDBString = getConditionDBString(dh, config);
|
|
10
10
|
return "".concat(conditionDBString, " ? ").concat(styleDBString, " : ").concat(prevRule);
|
|
11
11
|
}
|
|
12
12
|
export function makeRowFormatColumn(dh, rule) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingAPIUtils.js","names":["getConditionDBString","getStyleDBString","makeTernaryFormatRule","config","prevRule","styleDBString","undefined","conditionDBString","concat","makeRowFormatColumn","
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingAPIUtils.js","names":["getConditionDBString","getStyleDBString","makeTernaryFormatRule","dh","config","prevRule","styleDBString","undefined","conditionDBString","concat","makeRowFormatColumn","rule","Column","formatRowColor","makeColumnFormatColumn","col","formatColor"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingAPIUtils.ts"],"sourcesContent":["import type { dh as DhType } from '@deephaven/jsapi-types';\nimport {\n type BaseFormatConfig,\n getConditionDBString,\n getStyleDBString,\n} from './ConditionalFormattingUtils';\n\n// Conditional formatting API utils in a separate file\n// to make ConditionalFormattingUtils.ts easier to test.\n// https://github.com/facebook/jest/issues/936#issuecomment-545080082\n\nexport function makeTernaryFormatRule(\n dh: typeof DhType,\n config: BaseFormatConfig,\n prevRule: string\n): string | undefined {\n const styleDBString = getStyleDBString(config);\n if (styleDBString === undefined) {\n return undefined;\n }\n const conditionDBString = getConditionDBString(dh, config);\n return `${conditionDBString} ? ${styleDBString} : ${prevRule}`;\n}\n\nexport function makeRowFormatColumn(\n dh: typeof DhType,\n rule: string\n): DhType.CustomColumn {\n return dh.Column.formatRowColor(rule);\n}\n\nexport function makeColumnFormatColumn(\n col: DhType.Column,\n rule: string\n): DhType.CustomColumn {\n return col.formatColor(rule);\n}\n"],"mappings":"SAGEA,oBAAoB,EACpBC,gBAAgB,2CAGlB;AACA;AACA;AAEA,OAAO,SAASC,qBAAqBA,CACnCC,EAAiB,EACjBC,MAAwB,EACxBC,QAAgB,EACI;EACpB,IAAMC,aAAa,GAAGL,gBAAgB,CAACG,MAAM,CAAC;EAC9C,IAAIE,aAAa,KAAKC,SAAS,EAAE;IAC/B,OAAOA,SAAS;EAClB;EACA,IAAMC,iBAAiB,GAAGR,oBAAoB,CAACG,EAAE,EAAEC,MAAM,CAAC;EAC1D,UAAAK,MAAA,CAAUD,iBAAiB,SAAAC,MAAA,CAAMH,aAAa,SAAAG,MAAA,CAAMJ,QAAQ;AAC9D;AAEA,OAAO,SAASK,mBAAmBA,CACjCP,EAAiB,EACjBQ,IAAY,EACS;EACrB,OAAOR,EAAE,CAACS,MAAM,CAACC,cAAc,CAACF,IAAI,CAAC;AACvC;AAEA,OAAO,SAASG,sBAAsBA,CACpCC,GAAkB,EAClBJ,IAAY,EACS;EACrB,OAAOI,GAAG,CAACC,WAAW,CAACL,IAAI,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -92,7 +92,7 @@ export declare function getLabelForStyleType(option: FormatStyleType): string;
|
|
|
92
92
|
export declare function getBackgroundForStyleConfig(config: FormatStyleConfig): string | undefined;
|
|
93
93
|
export declare function getColorForStyleConfig(config: FormatStyleConfig): string | undefined;
|
|
94
94
|
export declare function getStyleDBString(config: BaseFormatConfig): string | undefined;
|
|
95
|
-
export declare function getConditionDBString(config: BaseFormatConfig): string;
|
|
95
|
+
export declare function getConditionDBString(dh: typeof DhType, config: BaseFormatConfig): string;
|
|
96
96
|
export declare function getLabelForNumberCondition(condition: NumberCondition): string;
|
|
97
97
|
export declare function getLabelForStringCondition(condition: StringCondition): string;
|
|
98
98
|
export declare function getLabelForDateCondition(condition: DateCondition): string;
|
|
@@ -106,7 +106,7 @@ export declare function getDefaultStyleConfig(): FormatStyleConfig;
|
|
|
106
106
|
export declare function getShortLabelForNumberCondition(condition: NumberCondition): string;
|
|
107
107
|
export declare function getTextForNumberCondition(columnName: ColumnName, condition: NumberCondition, value: unknown, start: unknown, end: unknown): string;
|
|
108
108
|
export declare function getTextForStringCondition(columnName: ColumnName, condition: StringCondition, value: unknown): string;
|
|
109
|
-
export declare function getTextForDateCondition(columnName: ColumnName, condition: DateCondition, value: unknown): string;
|
|
109
|
+
export declare function getTextForDateCondition(dh: typeof DhType, columnName: ColumnName, condition: DateCondition, value: unknown): string;
|
|
110
110
|
export declare function getTextForBooleanCondition(columnName: ColumnName, condition: BooleanCondition): string;
|
|
111
111
|
export declare function getTextForCharCondition(columnName: ColumnName, condition: CharCondition, value: unknown): string;
|
|
112
112
|
export declare function getShortLabelForConditionType(columnType: string, condition: Condition): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAO3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,aAAa,CAAC;AAElB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,iBAAiB,CAAC;CAC1B;AAED,MAA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BAAkB;IAC/B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,eAAe,CAAC;IACtB,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAmBpE;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,iBAAiB,GACxB,MAAM,GAAG,SAAS,CAsBpB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,iBAAiB,GACxB,MAAM,GAAG,SAAS,CAsBpB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAO7E;
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingUtils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAO3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GACjB,eAAe,GACf,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,aAAa,CAAC;AAElB,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;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,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CA6BT;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,GAAG,OAAO,CAQhE"}
|
|
@@ -162,12 +162,12 @@ function getStringConditionText(config) {
|
|
|
162
162
|
} = config;
|
|
163
163
|
return getTextForStringCondition(column.name, config.condition, value);
|
|
164
164
|
}
|
|
165
|
-
function getDateConditionText(config) {
|
|
165
|
+
function getDateConditionText(dh, config) {
|
|
166
166
|
var {
|
|
167
167
|
column,
|
|
168
168
|
value
|
|
169
169
|
} = config;
|
|
170
|
-
return getTextForDateCondition(column.name, config.condition, value);
|
|
170
|
+
return getTextForDateCondition(dh, column.name, config.condition, value);
|
|
171
171
|
}
|
|
172
172
|
function getBooleanConditionText(config) {
|
|
173
173
|
var {
|
|
@@ -182,7 +182,7 @@ function getCharConditionText(config) {
|
|
|
182
182
|
} = config;
|
|
183
183
|
return getTextForCharCondition(column.name, config.condition, value);
|
|
184
184
|
}
|
|
185
|
-
export function getConditionDBString(config) {
|
|
185
|
+
export function getConditionDBString(dh, config) {
|
|
186
186
|
var {
|
|
187
187
|
column
|
|
188
188
|
} = config;
|
|
@@ -196,7 +196,7 @@ export function getConditionDBString(config) {
|
|
|
196
196
|
return getStringConditionText(config);
|
|
197
197
|
}
|
|
198
198
|
if (TableUtils.isDateType(column.type)) {
|
|
199
|
-
return getDateConditionText(config);
|
|
199
|
+
return getDateConditionText(dh, config);
|
|
200
200
|
}
|
|
201
201
|
if (TableUtils.isBooleanType(column.type)) {
|
|
202
202
|
return getBooleanConditionText(config);
|
|
@@ -471,20 +471,30 @@ export function getTextForStringCondition(columnName, condition, value) {
|
|
|
471
471
|
return "".concat(columnName, " != null");
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
export function getTextForDateCondition(columnName, condition, value) {
|
|
474
|
+
export function getTextForDateCondition(dh, columnName, condition, value) {
|
|
475
|
+
var formattedValue = value;
|
|
476
|
+
if (typeof value === 'string') {
|
|
477
|
+
// The date time formatting may return a timezone that is not supported by the backend (e.g. 'EDT' instead of 'ET')
|
|
478
|
+
// so we need to parse the date time string and reformat it with a supported timezone ID.
|
|
479
|
+
// Note that we know this will be valid because the input value has already been validated with isDateConditionValid.
|
|
480
|
+
var [dateTimeString, ...rest] = value.split(' ');
|
|
481
|
+
var tzCode = rest.join(' ');
|
|
482
|
+
var tz = dh.i18n.TimeZone.getTimeZone(tzCode);
|
|
483
|
+
formattedValue = "".concat(dateTimeString, " ").concat(tz.id);
|
|
484
|
+
}
|
|
475
485
|
switch (condition) {
|
|
476
486
|
case DateCondition.IS_EXACTLY:
|
|
477
|
-
return "".concat(columnName, " == '").concat(
|
|
487
|
+
return "".concat(columnName, " == '").concat(formattedValue, "'");
|
|
478
488
|
case DateCondition.IS_NOT_EXACTLY:
|
|
479
|
-
return "".concat(columnName, " != '").concat(
|
|
489
|
+
return "".concat(columnName, " != '").concat(formattedValue, "'");
|
|
480
490
|
case DateCondition.IS_BEFORE:
|
|
481
|
-
return "".concat(columnName, " < '").concat(
|
|
491
|
+
return "".concat(columnName, " < '").concat(formattedValue, "'");
|
|
482
492
|
case DateCondition.IS_BEFORE_OR_EQUAL:
|
|
483
|
-
return "".concat(columnName, " <= '").concat(
|
|
493
|
+
return "".concat(columnName, " <= '").concat(formattedValue, "'");
|
|
484
494
|
case DateCondition.IS_AFTER:
|
|
485
|
-
return "".concat(columnName, " > '").concat(
|
|
495
|
+
return "".concat(columnName, " > '").concat(formattedValue, "'");
|
|
486
496
|
case DateCondition.IS_AFTER_OR_EQUAL:
|
|
487
|
-
return "".concat(columnName, " >= '").concat(
|
|
497
|
+
return "".concat(columnName, " >= '").concat(formattedValue, "'");
|
|
488
498
|
case DateCondition.IS_NULL:
|
|
489
499
|
return "".concat(columnName, " == null");
|
|
490
500
|
case DateCondition.IS_NOT_NULL:
|
|
@@ -573,7 +583,7 @@ export function getFormatColumns(dh, columns, rules) {
|
|
|
573
583
|
}
|
|
574
584
|
// Stack ternary format conditions by column
|
|
575
585
|
var [prevRule, prevFormatColumn] = (_ref3 = formatterType === FormatterType.CONDITIONAL ? columnFormatConfigMap.get(col.name) : rowFormatConfig) !== null && _ref3 !== void 0 ? _ref3 : ['null', undefined];
|
|
576
|
-
var rule = makeTernaryFormatRule(config, prevRule);
|
|
586
|
+
var rule = makeTernaryFormatRule(dh, config, prevRule);
|
|
577
587
|
if (rule === undefined) {
|
|
578
588
|
log.debug("Ignoring format rule.", config);
|
|
579
589
|
return;
|
|
@@ -622,13 +632,6 @@ export function isDateConditionValid(dh, condition, value) {
|
|
|
622
632
|
log.debug('Invalid timezone string', tzCode);
|
|
623
633
|
return false;
|
|
624
634
|
}
|
|
625
|
-
|
|
626
|
-
// The backend timestamp parsing does not support timezones that end with ST or DT (e.g. EST, EDT)
|
|
627
|
-
// Passing these to the backend will cause the table to fail.
|
|
628
|
-
if (tzCode.toUpperCase().endsWith('ST') || tzCode.toUpperCase().endsWith('DT')) {
|
|
629
|
-
log.debug('Timezone ending with ST or DT not supported', tzCode);
|
|
630
|
-
return false;
|
|
631
|
-
}
|
|
632
635
|
return true;
|
|
633
636
|
}
|
|
634
637
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConditionalFormattingUtils.js","names":["Log","DateUtils","TableUtils","makeColumnFormatColumn","makeRowFormatColumn","makeTernaryFormatRule","log","module","FormatterType","NumberCondition","StringCondition","DateCondition","BooleanCondition","CharCondition","FormatStyleType","getLabelForStyleType","option","NO_FORMATTING","POSITIVE","NEGATIVE","WARN","NEUTRAL","ACCENT_1","ACCENT_2","CUSTOM","getBackgroundForStyleConfig","config","type","customConfig","undefined","background","getColorForStyleConfig","color","getStyleDBString","style","bg","concat","getNumberConditionText","column","value","start","end","getTextForNumberCondition","name","condition","getStringConditionText","getTextForStringCondition","getDateConditionText","getTextForDateCondition","getBooleanConditionText","getTextForBooleanCondition","getCharConditionText","getTextForCharCondition","getConditionDBString","isNumberType","isCharType","isStringType","isDateType","isBooleanType","Error","getLabelForNumberCondition","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","getLabelForStringCondition","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","getLabelForDateCondition","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","getLabelForBooleanCondition","IS_TRUE","IS_FALSE","getLabelForCharCondition","getDefaultConditionForType","columnType","getDefaultValueForType","getConditionConfig","getDefaultConditionConfigForType","getDefaultStyleConfig","getShortLabelForStringCondition","getShortLabelForDateCondition","getShortLabelForBooleanCondition","getShortLabelForCharCondition","getShortLabelForNumberCondition","columnName","getShortLabelForConditionType","getFormatColumns","dh","columns","rules","debug","result","rowFormatConfig","columnFormatConfigMap","Map","forEach","_ref","_ref3","formatterType","col","find","_ref2","prevRule","prevFormatColumn","CONDITIONAL","get","rule","index","indexOf","splice","formatColumn","push","set","isDateConditionValid","dateTimeString","rest","split","tzCode","join","parseDateTimeString","e","i18n","TimeZone","getTimeZone","toUpperCase","endsWith","isSupportedColumn","_ref4"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { DateUtils, TableUtils } from '@deephaven/jsapi-utils';\nimport {\n makeColumnFormatColumn,\n makeRowFormatColumn,\n makeTernaryFormatRule,\n} from './ConditionalFormattingAPIUtils';\nimport { type ColumnName } from '../../CommonTypes';\n\nconst log = Log.module('ConditionalFormattingUtils');\n\nexport type ModelColumn = {\n name: string;\n type: string;\n};\n\nexport type Condition =\n | NumberCondition\n | StringCondition\n | DateCondition\n | BooleanCondition\n | CharCondition;\n\nexport interface BaseFormatConfig {\n column: ModelColumn;\n condition: Condition;\n value?: string;\n start?: string;\n end?: string;\n style: FormatStyleConfig;\n}\n\nexport interface ConditionConfig {\n condition: Condition;\n value?: string;\n start?: string;\n end?: string;\n}\n\nexport type ChangeCallback = (\n ruleConfig: BaseFormatConfig,\n isValid: boolean\n) => void;\n\nexport enum FormatterType {\n CONDITIONAL = 'conditional',\n ROWS = 'rows',\n}\n\nexport interface FormattingRule {\n type: FormatterType;\n config: BaseFormatConfig;\n}\n\nexport enum NumberCondition {\n IS_EQUAL = 'is-equal',\n IS_NOT_EQUAL = 'is-not-equal',\n IS_BETWEEN = 'is-between',\n GREATER_THAN = 'greater-than',\n GREATER_THAN_OR_EQUAL = 'greater-than-or-equal',\n LESS_THAN = 'less-than',\n LESS_THAN_OR_EQUAL = 'less-than-or-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum StringCondition {\n IS_EXACTLY = 'is-exactly',\n IS_NOT_EXACTLY = 'is-not-exactly',\n CONTAINS = 'contains',\n DOES_NOT_CONTAIN = 'does-not-contain',\n STARTS_WITH = 'starts-with',\n ENDS_WITH = 'ends-with',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum DateCondition {\n IS_EXACTLY = 'is-exactly',\n IS_NOT_EXACTLY = 'is-not-exactly',\n IS_BEFORE = 'is-before',\n IS_BEFORE_OR_EQUAL = 'is-before-or-equal',\n IS_AFTER = 'is-after',\n IS_AFTER_OR_EQUAL = 'is-after-or-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum BooleanCondition {\n IS_TRUE = 'is-true',\n IS_FALSE = 'is-false',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum CharCondition {\n IS_EQUAL = 'is-equal',\n IS_NOT_EQUAL = 'is-not-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum FormatStyleType {\n NO_FORMATTING = 'no-formatting',\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n WARN = 'warn',\n NEUTRAL = 'neutral',\n ACCENT_1 = 'accent-1',\n ACCENT_2 = 'accent-2',\n CUSTOM = 'custom',\n}\n\nexport interface FormatStyleConfig {\n type: FormatStyleType;\n customConfig?: {\n color: string;\n background: string;\n };\n}\n\nexport function getLabelForStyleType(option: FormatStyleType): string {\n switch (option) {\n case FormatStyleType.NO_FORMATTING:\n return 'No formatting';\n case FormatStyleType.POSITIVE:\n return 'Positive';\n case FormatStyleType.NEGATIVE:\n return 'Negative';\n case FormatStyleType.WARN:\n return 'Warn';\n case FormatStyleType.NEUTRAL:\n return 'Neutral';\n case FormatStyleType.ACCENT_1:\n return 'Accent 1';\n case FormatStyleType.ACCENT_2:\n return 'Accent 2';\n case FormatStyleType.CUSTOM:\n return 'Custom...';\n }\n}\n\nexport function getBackgroundForStyleConfig(\n config: FormatStyleConfig\n): string | undefined {\n const { type, customConfig } = config;\n switch (type) {\n case FormatStyleType.NO_FORMATTING:\n return undefined;\n case FormatStyleType.POSITIVE:\n return '#9fde6f';\n case FormatStyleType.NEGATIVE:\n return '#ff6087';\n case FormatStyleType.WARN:\n return '#f67f40';\n case FormatStyleType.NEUTRAL:\n return '#ffd95c';\n case FormatStyleType.ACCENT_1:\n return '#78dce8';\n case FormatStyleType.ACCENT_2:\n return '#ab9bf5';\n case FormatStyleType.CUSTOM:\n return customConfig?.background;\n default:\n return undefined;\n }\n}\n\nexport function getColorForStyleConfig(\n config: FormatStyleConfig\n): string | undefined {\n const { type, customConfig } = config;\n switch (type) {\n case FormatStyleType.NO_FORMATTING:\n return undefined;\n case FormatStyleType.POSITIVE:\n return '#526a3f';\n case FormatStyleType.NEGATIVE:\n return '#802f44';\n case FormatStyleType.WARN:\n return '#663318';\n case FormatStyleType.NEUTRAL:\n return '#63562b';\n case FormatStyleType.ACCENT_1:\n return '#3f6469';\n case FormatStyleType.ACCENT_2:\n return '#554d72';\n case FormatStyleType.CUSTOM:\n return customConfig?.color;\n default:\n return undefined;\n }\n}\n\nexport function getStyleDBString(config: BaseFormatConfig): string | undefined {\n const color = getColorForStyleConfig(config.style);\n const bg = getBackgroundForStyleConfig(config.style);\n if (color === undefined || bg === undefined) {\n return undefined;\n }\n return `bgfg(\\`${bg}\\`, \\`${color}\\`)`;\n}\n\nfunction getNumberConditionText(config: BaseFormatConfig): string {\n const { column, value, start, end } = config;\n return getTextForNumberCondition(\n column.name,\n config.condition as NumberCondition,\n value,\n start,\n end\n );\n}\n\nfunction getStringConditionText(config: BaseFormatConfig): string {\n const { column, value } = config;\n return getTextForStringCondition(\n column.name,\n config.condition as StringCondition,\n value\n );\n}\n\nfunction getDateConditionText(config: BaseFormatConfig): string {\n const { column, value } = config;\n return getTextForDateCondition(\n column.name,\n config.condition as DateCondition,\n value\n );\n}\n\nfunction getBooleanConditionText(config: BaseFormatConfig): string {\n const { column } = config;\n return getTextForBooleanCondition(\n column.name,\n config.condition as BooleanCondition\n );\n}\n\nfunction getCharConditionText(config: BaseFormatConfig): string {\n const { column, value } = config;\n return getTextForCharCondition(\n column.name,\n config.condition as CharCondition,\n value\n );\n}\n\nexport function getConditionDBString(config: BaseFormatConfig): string {\n const { column } = config;\n\n if (TableUtils.isNumberType(column.type)) {\n return getNumberConditionText(config);\n }\n if (TableUtils.isCharType(column.type)) {\n return getCharConditionText(config);\n }\n if (TableUtils.isStringType(column.type)) {\n return getStringConditionText(config);\n }\n if (TableUtils.isDateType(column.type)) {\n return getDateConditionText(config);\n }\n if (TableUtils.isBooleanType(column.type)) {\n return getBooleanConditionText(config);\n }\n\n throw new Error('Invalid column type');\n}\n\nexport function getLabelForNumberCondition(condition: NumberCondition): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return 'is equal to';\n case NumberCondition.IS_NOT_EQUAL:\n return 'is not equal to';\n case NumberCondition.IS_BETWEEN:\n return 'is between';\n case NumberCondition.GREATER_THAN:\n return 'greater than';\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return 'greater than or equal to';\n case NumberCondition.LESS_THAN:\n return 'less than';\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return 'less than or equal to';\n case NumberCondition.IS_NULL:\n return 'is null';\n case NumberCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForStringCondition(condition: StringCondition): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return 'is exactly';\n case StringCondition.IS_NOT_EXACTLY:\n return 'is not exactly';\n case StringCondition.CONTAINS:\n return 'contains';\n case StringCondition.DOES_NOT_CONTAIN:\n return 'does not contain';\n case StringCondition.STARTS_WITH:\n return 'starts with';\n case StringCondition.ENDS_WITH:\n return 'ends with';\n case StringCondition.IS_NULL:\n return 'is null';\n case StringCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForDateCondition(condition: DateCondition): string {\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return 'is';\n case DateCondition.IS_NOT_EXACTLY:\n return 'is not';\n case DateCondition.IS_BEFORE:\n return 'is before';\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return 'is before or equal';\n case DateCondition.IS_AFTER:\n return 'is after';\n case DateCondition.IS_AFTER_OR_EQUAL:\n return 'is after or equal';\n case DateCondition.IS_NULL:\n return 'is null';\n case DateCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForBooleanCondition(\n condition: BooleanCondition\n): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return 'is true';\n case BooleanCondition.IS_FALSE:\n return 'is false';\n case BooleanCondition.IS_NULL:\n return 'is null';\n case BooleanCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForCharCondition(condition: CharCondition): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return 'is';\n case CharCondition.IS_NOT_EQUAL:\n return 'is not';\n case CharCondition.IS_NULL:\n return 'is null';\n case CharCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getDefaultConditionForType(columnType: string): Condition {\n if (TableUtils.isNumberType(columnType)) {\n return NumberCondition.IS_EQUAL;\n }\n if (TableUtils.isCharType(columnType)) {\n return CharCondition.IS_EQUAL;\n }\n if (TableUtils.isStringType(columnType)) {\n return StringCondition.IS_EXACTLY;\n }\n if (TableUtils.isDateType(columnType)) {\n return DateCondition.IS_EXACTLY;\n }\n if (TableUtils.isBooleanType(columnType)) {\n return BooleanCondition.IS_TRUE;\n }\n\n throw new Error('Invalid column type');\n}\n\nexport function getDefaultValueForType(columnType: string): string | undefined {\n if (TableUtils.isCharType(columnType)) {\n return '';\n }\n if (TableUtils.isStringType(columnType)) {\n return '';\n }\n return undefined;\n}\n\nexport function getConditionConfig(config: BaseFormatConfig): ConditionConfig {\n const { condition, value, start, end } = config;\n return { condition, value, start, end };\n}\n\nexport function getDefaultConditionConfigForType(\n type: string\n): ConditionConfig {\n return {\n condition: getDefaultConditionForType(type),\n value: getDefaultValueForType(type),\n start: undefined,\n end: undefined,\n };\n}\n\nexport function getDefaultStyleConfig(): FormatStyleConfig {\n return {\n type: FormatStyleType.NO_FORMATTING,\n };\n}\n\nfunction getShortLabelForStringCondition(condition: StringCondition): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return '==';\n case StringCondition.IS_NOT_EXACTLY:\n return '!=';\n case StringCondition.CONTAINS:\n return 'contains';\n case StringCondition.DOES_NOT_CONTAIN:\n return 'does not contain';\n case StringCondition.STARTS_WITH:\n return 'starts with';\n case StringCondition.ENDS_WITH:\n return 'ends with';\n case StringCondition.IS_NULL:\n return 'is null';\n case StringCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForDateCondition(condition: DateCondition): string {\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return '==';\n case DateCondition.IS_NOT_EXACTLY:\n return '!=';\n case DateCondition.IS_BEFORE:\n return '<';\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return '<=';\n case DateCondition.IS_AFTER:\n return '>';\n case DateCondition.IS_AFTER_OR_EQUAL:\n return '>=';\n case DateCondition.IS_NULL:\n return 'is null';\n case DateCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForBooleanCondition(condition: BooleanCondition): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return 'is true';\n case BooleanCondition.IS_FALSE:\n return 'is false';\n case BooleanCondition.IS_NULL:\n return 'is null';\n case BooleanCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForCharCondition(condition: CharCondition): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return '==';\n case CharCondition.IS_NOT_EQUAL:\n return '!=';\n case CharCondition.IS_NULL:\n return 'is null';\n case CharCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getShortLabelForNumberCondition(\n condition: NumberCondition\n): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return '==';\n case NumberCondition.IS_NOT_EQUAL:\n return '!=';\n case NumberCondition.IS_BETWEEN:\n return '==';\n case NumberCondition.GREATER_THAN:\n return '>';\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return '>=';\n case NumberCondition.LESS_THAN:\n return '<';\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return '<=';\n case NumberCondition.IS_NULL:\n return 'is null';\n case NumberCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getTextForNumberCondition(\n columnName: ColumnName,\n condition: NumberCondition,\n value: unknown,\n start: unknown,\n end: unknown\n): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return `${columnName} == ${value}`;\n case NumberCondition.IS_NOT_EQUAL:\n return `${columnName} != ${value}`;\n case NumberCondition.IS_BETWEEN:\n return `${columnName} > ${start} && ${columnName} < ${end}`;\n case NumberCondition.GREATER_THAN:\n return `${columnName} > ${value}`;\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return `${columnName} >= ${value}`;\n case NumberCondition.LESS_THAN:\n return `${columnName} < ${value}`;\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return `${columnName} <= ${value}`;\n case NumberCondition.IS_NULL:\n return `${columnName} == null`;\n case NumberCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForStringCondition(\n columnName: ColumnName,\n condition: StringCondition,\n value: unknown\n): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return `${columnName} == \"${value}\"`;\n case StringCondition.IS_NOT_EXACTLY:\n return `${columnName} != \"${value}\"`;\n case StringCondition.CONTAINS:\n return `${columnName} != null && ${columnName}.contains(\"${value}\")`;\n case StringCondition.DOES_NOT_CONTAIN:\n return `${columnName} != null && !${columnName}.contains(\"${value}\")`;\n case StringCondition.STARTS_WITH:\n return `${columnName} != null && ${columnName}.startsWith(\"${value}\")`;\n case StringCondition.ENDS_WITH:\n return `${columnName} != null && ${columnName}.endsWith(\"${value}\")`;\n case StringCondition.IS_NULL:\n return `${columnName} == null`;\n case StringCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForDateCondition(\n columnName: ColumnName,\n condition: DateCondition,\n value: unknown\n): string {\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return `${columnName} == '${value}'`;\n case DateCondition.IS_NOT_EXACTLY:\n return `${columnName} != '${value}'`;\n case DateCondition.IS_BEFORE:\n return `${columnName} < '${value}'`;\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return `${columnName} <= '${value}'`;\n case DateCondition.IS_AFTER:\n return `${columnName} > '${value}'`;\n case DateCondition.IS_AFTER_OR_EQUAL:\n return `${columnName} >= '${value}'`;\n case DateCondition.IS_NULL:\n return `${columnName} == null`;\n case DateCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForBooleanCondition(\n columnName: ColumnName,\n condition: BooleanCondition\n): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return `${columnName} == true`;\n case BooleanCondition.IS_FALSE:\n return `${columnName} == false`;\n case BooleanCondition.IS_NULL:\n return `${columnName} == null`;\n case BooleanCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForCharCondition(\n columnName: ColumnName,\n condition: CharCondition,\n value: unknown\n): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return `${columnName} == '${value}'`;\n case CharCondition.IS_NOT_EQUAL:\n return `${columnName} != '${value}'`;\n case CharCondition.IS_NULL:\n return `isNull(${columnName})`;\n case CharCondition.IS_NOT_NULL:\n return `!isNull(${columnName})`;\n }\n}\n\nexport function getShortLabelForConditionType(\n columnType: string,\n condition: Condition\n): string {\n if (TableUtils.isNumberType(columnType)) {\n return getShortLabelForNumberCondition(condition as NumberCondition);\n }\n if (TableUtils.isCharType(columnType)) {\n return getShortLabelForCharCondition(condition as CharCondition);\n }\n if (TableUtils.isStringType(columnType)) {\n return getShortLabelForStringCondition(condition as StringCondition);\n }\n if (TableUtils.isDateType(columnType)) {\n return getShortLabelForDateCondition(condition as DateCondition);\n }\n if (TableUtils.isBooleanType(columnType)) {\n return getShortLabelForBooleanCondition(condition as BooleanCondition);\n }\n\n throw new Error('Invalid column type');\n}\n\n/**\n * Get format columns array for the given columns and formatting rules\n * @param columns Available columns\n * @param rules Formatting rules to build the format columns from\n * @returns Array of format columns\n */\nexport function getFormatColumns(\n dh: typeof DhType,\n columns: readonly DhType.Column[],\n rules: readonly FormattingRule[]\n): DhType.CustomColumn[] {\n if (rules === undefined) {\n log.debug(`no rules passed.`);\n return [];\n }\n const result: DhType.CustomColumn[] = [];\n // There can be only one row format custom column\n // and multiple column format custom columns (one per column)\n let rowFormatConfig: [string, DhType.CustomColumn];\n const columnFormatConfigMap = new Map<\n string,\n [string, DhType.CustomColumn]\n >();\n rules.forEach(({ config, type: formatterType }) => {\n const { column } = config;\n // Check both name and type because the type can change\n const col = columns.find(\n ({ name, type }) => name === column.name && type === column.type\n );\n if (col === undefined) {\n log.debug(\n `Column ${column.name}:${column.type} not found. Ignoring format rule.`,\n config\n );\n return;\n }\n // Stack ternary format conditions by column\n const [prevRule, prevFormatColumn] = (formatterType ===\n FormatterType.CONDITIONAL\n ? columnFormatConfigMap.get(col.name)\n : rowFormatConfig) ?? ['null', undefined];\n const rule = makeTernaryFormatRule(config, prevRule);\n if (rule === undefined) {\n log.debug(`Ignoring format rule.`, config);\n return;\n }\n // Replace existing formatColumn with the new stacked format\n const index =\n prevFormatColumn === undefined ? -1 : result.indexOf(prevFormatColumn);\n if (index > -1) {\n result.splice(index, 1);\n }\n const formatColumn =\n formatterType === FormatterType.CONDITIONAL\n ? makeColumnFormatColumn(col, rule)\n : makeRowFormatColumn(dh, rule);\n result.push(formatColumn);\n if (formatterType === FormatterType.CONDITIONAL) {\n columnFormatConfigMap.set(col.name, [rule, formatColumn]);\n } else {\n rowFormatConfig = [rule, formatColumn];\n }\n });\n\n return result;\n}\n\n/**\n * Validate that a given date condition + value pair is valid.\n * @param condition\n * @param value\n */\nexport function isDateConditionValid(\n dh: typeof DhType,\n condition: DateCondition,\n value?: string\n): boolean {\n switch (condition) {\n case DateCondition.IS_NULL:\n case DateCondition.IS_NOT_NULL:\n return true;\n\n default: {\n const [dateTimeString, ...rest] = (value ?? '').split(' ');\n // Reconstitute all tokens after the first ' ' in case the user included garbage data at the end\n // e.g. '2020-01-01 NY blah'\n const tzCode = rest.join(' ');\n\n try {\n DateUtils.parseDateTimeString(dateTimeString);\n } catch (e) {\n log.debug('Invalid datetime string', dateTimeString);\n return false;\n }\n\n try {\n dh.i18n.TimeZone.getTimeZone(tzCode);\n } catch (e) {\n log.debug('Invalid timezone string', tzCode);\n return false;\n }\n\n // The backend timestamp parsing does not support timezones that end with ST or DT (e.g. EST, EDT)\n // Passing these to the backend will cause the table to fail.\n if (\n tzCode.toUpperCase().endsWith('ST') ||\n tzCode.toUpperCase().endsWith('DT')\n ) {\n log.debug('Timezone ending with ST or DT not supported', tzCode);\n return false;\n }\n\n return true;\n }\n }\n}\n\nexport function isSupportedColumn({ type }: ModelColumn): boolean {\n return (\n TableUtils.isNumberType(type) ||\n TableUtils.isChar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CAACsD,YAAY,CAAC7B,IAAI,CAAC,IAC7BzB,UAAU,CAACuD,UAAU,CAAC9B,IAAI,CAAC,IAC3BzB,UAAU,CAACwD,aAAa,CAAC/B,IAAI,CAAC;AAElC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ConditionalFormattingUtils.js","names":["Log","DateUtils","TableUtils","makeColumnFormatColumn","makeRowFormatColumn","makeTernaryFormatRule","log","module","FormatterType","NumberCondition","StringCondition","DateCondition","BooleanCondition","CharCondition","FormatStyleType","getLabelForStyleType","option","NO_FORMATTING","POSITIVE","NEGATIVE","WARN","NEUTRAL","ACCENT_1","ACCENT_2","CUSTOM","getBackgroundForStyleConfig","config","type","customConfig","undefined","background","getColorForStyleConfig","color","getStyleDBString","style","bg","concat","getNumberConditionText","column","value","start","end","getTextForNumberCondition","name","condition","getStringConditionText","getTextForStringCondition","getDateConditionText","dh","getTextForDateCondition","getBooleanConditionText","getTextForBooleanCondition","getCharConditionText","getTextForCharCondition","getConditionDBString","isNumberType","isCharType","isStringType","isDateType","isBooleanType","Error","getLabelForNumberCondition","IS_EQUAL","IS_NOT_EQUAL","IS_BETWEEN","GREATER_THAN","GREATER_THAN_OR_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","IS_NULL","IS_NOT_NULL","getLabelForStringCondition","IS_EXACTLY","IS_NOT_EXACTLY","CONTAINS","DOES_NOT_CONTAIN","STARTS_WITH","ENDS_WITH","getLabelForDateCondition","IS_BEFORE","IS_BEFORE_OR_EQUAL","IS_AFTER","IS_AFTER_OR_EQUAL","getLabelForBooleanCondition","IS_TRUE","IS_FALSE","getLabelForCharCondition","getDefaultConditionForType","columnType","getDefaultValueForType","getConditionConfig","getDefaultConditionConfigForType","getDefaultStyleConfig","getShortLabelForStringCondition","getShortLabelForDateCondition","getShortLabelForBooleanCondition","getShortLabelForCharCondition","getShortLabelForNumberCondition","columnName","formattedValue","dateTimeString","rest","split","tzCode","join","tz","i18n","TimeZone","getTimeZone","id","getShortLabelForConditionType","getFormatColumns","columns","rules","debug","result","rowFormatConfig","columnFormatConfigMap","Map","forEach","_ref","_ref3","formatterType","col","find","_ref2","prevRule","prevFormatColumn","CONDITIONAL","get","rule","index","indexOf","splice","formatColumn","push","set","isDateConditionValid","parseDateTimeString","e","isSupportedColumn","_ref4"],"sources":["../../../src/sidebar/conditional-formatting/ConditionalFormattingUtils.ts"],"sourcesContent":["import Log from '@deephaven/log';\nimport type { dh as DhType } from '@deephaven/jsapi-types';\nimport { DateUtils, TableUtils } from '@deephaven/jsapi-utils';\nimport {\n makeColumnFormatColumn,\n makeRowFormatColumn,\n makeTernaryFormatRule,\n} from './ConditionalFormattingAPIUtils';\nimport { type ColumnName } from '../../CommonTypes';\n\nconst log = Log.module('ConditionalFormattingUtils');\n\nexport type ModelColumn = {\n name: string;\n type: string;\n};\n\nexport type Condition =\n | NumberCondition\n | StringCondition\n | DateCondition\n | BooleanCondition\n | CharCondition;\n\nexport interface BaseFormatConfig {\n column: ModelColumn;\n condition: Condition;\n value?: string;\n start?: string;\n end?: string;\n style: FormatStyleConfig;\n}\n\nexport interface ConditionConfig {\n condition: Condition;\n value?: string;\n start?: string;\n end?: string;\n}\n\nexport type ChangeCallback = (\n ruleConfig: BaseFormatConfig,\n isValid: boolean\n) => void;\n\nexport enum FormatterType {\n CONDITIONAL = 'conditional',\n ROWS = 'rows',\n}\n\nexport interface FormattingRule {\n type: FormatterType;\n config: BaseFormatConfig;\n}\n\nexport enum NumberCondition {\n IS_EQUAL = 'is-equal',\n IS_NOT_EQUAL = 'is-not-equal',\n IS_BETWEEN = 'is-between',\n GREATER_THAN = 'greater-than',\n GREATER_THAN_OR_EQUAL = 'greater-than-or-equal',\n LESS_THAN = 'less-than',\n LESS_THAN_OR_EQUAL = 'less-than-or-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum StringCondition {\n IS_EXACTLY = 'is-exactly',\n IS_NOT_EXACTLY = 'is-not-exactly',\n CONTAINS = 'contains',\n DOES_NOT_CONTAIN = 'does-not-contain',\n STARTS_WITH = 'starts-with',\n ENDS_WITH = 'ends-with',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum DateCondition {\n IS_EXACTLY = 'is-exactly',\n IS_NOT_EXACTLY = 'is-not-exactly',\n IS_BEFORE = 'is-before',\n IS_BEFORE_OR_EQUAL = 'is-before-or-equal',\n IS_AFTER = 'is-after',\n IS_AFTER_OR_EQUAL = 'is-after-or-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum BooleanCondition {\n IS_TRUE = 'is-true',\n IS_FALSE = 'is-false',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum CharCondition {\n IS_EQUAL = 'is-equal',\n IS_NOT_EQUAL = 'is-not-equal',\n IS_NULL = 'is-null',\n IS_NOT_NULL = 'is-not-null',\n}\n\nexport enum FormatStyleType {\n NO_FORMATTING = 'no-formatting',\n POSITIVE = 'positive',\n NEGATIVE = 'negative',\n WARN = 'warn',\n NEUTRAL = 'neutral',\n ACCENT_1 = 'accent-1',\n ACCENT_2 = 'accent-2',\n CUSTOM = 'custom',\n}\n\nexport interface FormatStyleConfig {\n type: FormatStyleType;\n customConfig?: {\n color: string;\n background: string;\n };\n}\n\nexport function getLabelForStyleType(option: FormatStyleType): string {\n switch (option) {\n case FormatStyleType.NO_FORMATTING:\n return 'No formatting';\n case FormatStyleType.POSITIVE:\n return 'Positive';\n case FormatStyleType.NEGATIVE:\n return 'Negative';\n case FormatStyleType.WARN:\n return 'Warn';\n case FormatStyleType.NEUTRAL:\n return 'Neutral';\n case FormatStyleType.ACCENT_1:\n return 'Accent 1';\n case FormatStyleType.ACCENT_2:\n return 'Accent 2';\n case FormatStyleType.CUSTOM:\n return 'Custom...';\n }\n}\n\nexport function getBackgroundForStyleConfig(\n config: FormatStyleConfig\n): string | undefined {\n const { type, customConfig } = config;\n switch (type) {\n case FormatStyleType.NO_FORMATTING:\n return undefined;\n case FormatStyleType.POSITIVE:\n return '#9fde6f';\n case FormatStyleType.NEGATIVE:\n return '#ff6087';\n case FormatStyleType.WARN:\n return '#f67f40';\n case FormatStyleType.NEUTRAL:\n return '#ffd95c';\n case FormatStyleType.ACCENT_1:\n return '#78dce8';\n case FormatStyleType.ACCENT_2:\n return '#ab9bf5';\n case FormatStyleType.CUSTOM:\n return customConfig?.background;\n default:\n return undefined;\n }\n}\n\nexport function getColorForStyleConfig(\n config: FormatStyleConfig\n): string | undefined {\n const { type, customConfig } = config;\n switch (type) {\n case FormatStyleType.NO_FORMATTING:\n return undefined;\n case FormatStyleType.POSITIVE:\n return '#526a3f';\n case FormatStyleType.NEGATIVE:\n return '#802f44';\n case FormatStyleType.WARN:\n return '#663318';\n case FormatStyleType.NEUTRAL:\n return '#63562b';\n case FormatStyleType.ACCENT_1:\n return '#3f6469';\n case FormatStyleType.ACCENT_2:\n return '#554d72';\n case FormatStyleType.CUSTOM:\n return customConfig?.color;\n default:\n return undefined;\n }\n}\n\nexport function getStyleDBString(config: BaseFormatConfig): string | undefined {\n const color = getColorForStyleConfig(config.style);\n const bg = getBackgroundForStyleConfig(config.style);\n if (color === undefined || bg === undefined) {\n return undefined;\n }\n return `bgfg(\\`${bg}\\`, \\`${color}\\`)`;\n}\n\nfunction getNumberConditionText(config: BaseFormatConfig): string {\n const { column, value, start, end } = config;\n return getTextForNumberCondition(\n column.name,\n config.condition as NumberCondition,\n value,\n start,\n end\n );\n}\n\nfunction getStringConditionText(config: BaseFormatConfig): string {\n const { column, value } = config;\n return getTextForStringCondition(\n column.name,\n config.condition as StringCondition,\n value\n );\n}\n\nfunction getDateConditionText(\n dh: typeof DhType,\n config: BaseFormatConfig\n): string {\n const { column, value } = config;\n return getTextForDateCondition(\n dh,\n column.name,\n config.condition as DateCondition,\n value\n );\n}\n\nfunction getBooleanConditionText(config: BaseFormatConfig): string {\n const { column } = config;\n return getTextForBooleanCondition(\n column.name,\n config.condition as BooleanCondition\n );\n}\n\nfunction getCharConditionText(config: BaseFormatConfig): string {\n const { column, value } = config;\n return getTextForCharCondition(\n column.name,\n config.condition as CharCondition,\n value\n );\n}\n\nexport function getConditionDBString(\n dh: typeof DhType,\n config: BaseFormatConfig\n): string {\n const { column } = config;\n\n if (TableUtils.isNumberType(column.type)) {\n return getNumberConditionText(config);\n }\n if (TableUtils.isCharType(column.type)) {\n return getCharConditionText(config);\n }\n if (TableUtils.isStringType(column.type)) {\n return getStringConditionText(config);\n }\n if (TableUtils.isDateType(column.type)) {\n return getDateConditionText(dh, config);\n }\n if (TableUtils.isBooleanType(column.type)) {\n return getBooleanConditionText(config);\n }\n\n throw new Error('Invalid column type');\n}\n\nexport function getLabelForNumberCondition(condition: NumberCondition): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return 'is equal to';\n case NumberCondition.IS_NOT_EQUAL:\n return 'is not equal to';\n case NumberCondition.IS_BETWEEN:\n return 'is between';\n case NumberCondition.GREATER_THAN:\n return 'greater than';\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return 'greater than or equal to';\n case NumberCondition.LESS_THAN:\n return 'less than';\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return 'less than or equal to';\n case NumberCondition.IS_NULL:\n return 'is null';\n case NumberCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForStringCondition(condition: StringCondition): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return 'is exactly';\n case StringCondition.IS_NOT_EXACTLY:\n return 'is not exactly';\n case StringCondition.CONTAINS:\n return 'contains';\n case StringCondition.DOES_NOT_CONTAIN:\n return 'does not contain';\n case StringCondition.STARTS_WITH:\n return 'starts with';\n case StringCondition.ENDS_WITH:\n return 'ends with';\n case StringCondition.IS_NULL:\n return 'is null';\n case StringCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForDateCondition(condition: DateCondition): string {\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return 'is';\n case DateCondition.IS_NOT_EXACTLY:\n return 'is not';\n case DateCondition.IS_BEFORE:\n return 'is before';\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return 'is before or equal';\n case DateCondition.IS_AFTER:\n return 'is after';\n case DateCondition.IS_AFTER_OR_EQUAL:\n return 'is after or equal';\n case DateCondition.IS_NULL:\n return 'is null';\n case DateCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForBooleanCondition(\n condition: BooleanCondition\n): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return 'is true';\n case BooleanCondition.IS_FALSE:\n return 'is false';\n case BooleanCondition.IS_NULL:\n return 'is null';\n case BooleanCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getLabelForCharCondition(condition: CharCondition): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return 'is';\n case CharCondition.IS_NOT_EQUAL:\n return 'is not';\n case CharCondition.IS_NULL:\n return 'is null';\n case CharCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getDefaultConditionForType(columnType: string): Condition {\n if (TableUtils.isNumberType(columnType)) {\n return NumberCondition.IS_EQUAL;\n }\n if (TableUtils.isCharType(columnType)) {\n return CharCondition.IS_EQUAL;\n }\n if (TableUtils.isStringType(columnType)) {\n return StringCondition.IS_EXACTLY;\n }\n if (TableUtils.isDateType(columnType)) {\n return DateCondition.IS_EXACTLY;\n }\n if (TableUtils.isBooleanType(columnType)) {\n return BooleanCondition.IS_TRUE;\n }\n\n throw new Error('Invalid column type');\n}\n\nexport function getDefaultValueForType(columnType: string): string | undefined {\n if (TableUtils.isCharType(columnType)) {\n return '';\n }\n if (TableUtils.isStringType(columnType)) {\n return '';\n }\n return undefined;\n}\n\nexport function getConditionConfig(config: BaseFormatConfig): ConditionConfig {\n const { condition, value, start, end } = config;\n return { condition, value, start, end };\n}\n\nexport function getDefaultConditionConfigForType(\n type: string\n): ConditionConfig {\n return {\n condition: getDefaultConditionForType(type),\n value: getDefaultValueForType(type),\n start: undefined,\n end: undefined,\n };\n}\n\nexport function getDefaultStyleConfig(): FormatStyleConfig {\n return {\n type: FormatStyleType.NO_FORMATTING,\n };\n}\n\nfunction getShortLabelForStringCondition(condition: StringCondition): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return '==';\n case StringCondition.IS_NOT_EXACTLY:\n return '!=';\n case StringCondition.CONTAINS:\n return 'contains';\n case StringCondition.DOES_NOT_CONTAIN:\n return 'does not contain';\n case StringCondition.STARTS_WITH:\n return 'starts with';\n case StringCondition.ENDS_WITH:\n return 'ends with';\n case StringCondition.IS_NULL:\n return 'is null';\n case StringCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForDateCondition(condition: DateCondition): string {\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return '==';\n case DateCondition.IS_NOT_EXACTLY:\n return '!=';\n case DateCondition.IS_BEFORE:\n return '<';\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return '<=';\n case DateCondition.IS_AFTER:\n return '>';\n case DateCondition.IS_AFTER_OR_EQUAL:\n return '>=';\n case DateCondition.IS_NULL:\n return 'is null';\n case DateCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForBooleanCondition(condition: BooleanCondition): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return 'is true';\n case BooleanCondition.IS_FALSE:\n return 'is false';\n case BooleanCondition.IS_NULL:\n return 'is null';\n case BooleanCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nfunction getShortLabelForCharCondition(condition: CharCondition): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return '==';\n case CharCondition.IS_NOT_EQUAL:\n return '!=';\n case CharCondition.IS_NULL:\n return 'is null';\n case CharCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getShortLabelForNumberCondition(\n condition: NumberCondition\n): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return '==';\n case NumberCondition.IS_NOT_EQUAL:\n return '!=';\n case NumberCondition.IS_BETWEEN:\n return '==';\n case NumberCondition.GREATER_THAN:\n return '>';\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return '>=';\n case NumberCondition.LESS_THAN:\n return '<';\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return '<=';\n case NumberCondition.IS_NULL:\n return 'is null';\n case NumberCondition.IS_NOT_NULL:\n return 'is not null';\n }\n}\n\nexport function getTextForNumberCondition(\n columnName: ColumnName,\n condition: NumberCondition,\n value: unknown,\n start: unknown,\n end: unknown\n): string {\n switch (condition) {\n case NumberCondition.IS_EQUAL:\n return `${columnName} == ${value}`;\n case NumberCondition.IS_NOT_EQUAL:\n return `${columnName} != ${value}`;\n case NumberCondition.IS_BETWEEN:\n return `${columnName} > ${start} && ${columnName} < ${end}`;\n case NumberCondition.GREATER_THAN:\n return `${columnName} > ${value}`;\n case NumberCondition.GREATER_THAN_OR_EQUAL:\n return `${columnName} >= ${value}`;\n case NumberCondition.LESS_THAN:\n return `${columnName} < ${value}`;\n case NumberCondition.LESS_THAN_OR_EQUAL:\n return `${columnName} <= ${value}`;\n case NumberCondition.IS_NULL:\n return `${columnName} == null`;\n case NumberCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForStringCondition(\n columnName: ColumnName,\n condition: StringCondition,\n value: unknown\n): string {\n switch (condition) {\n case StringCondition.IS_EXACTLY:\n return `${columnName} == \"${value}\"`;\n case StringCondition.IS_NOT_EXACTLY:\n return `${columnName} != \"${value}\"`;\n case StringCondition.CONTAINS:\n return `${columnName} != null && ${columnName}.contains(\"${value}\")`;\n case StringCondition.DOES_NOT_CONTAIN:\n return `${columnName} != null && !${columnName}.contains(\"${value}\")`;\n case StringCondition.STARTS_WITH:\n return `${columnName} != null && ${columnName}.startsWith(\"${value}\")`;\n case StringCondition.ENDS_WITH:\n return `${columnName} != null && ${columnName}.endsWith(\"${value}\")`;\n case StringCondition.IS_NULL:\n return `${columnName} == null`;\n case StringCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForDateCondition(\n dh: typeof DhType,\n columnName: ColumnName,\n condition: DateCondition,\n value: unknown\n): string {\n let formattedValue = value;\n if (typeof value === 'string') {\n // The date time formatting may return a timezone that is not supported by the backend (e.g. 'EDT' instead of 'ET')\n // so we need to parse the date time string and reformat it with a supported timezone ID.\n // Note that we know this will be valid because the input value has already been validated with isDateConditionValid.\n const [dateTimeString, ...rest] = value.split(' ');\n const tzCode = rest.join(' ');\n const tz = dh.i18n.TimeZone.getTimeZone(tzCode);\n formattedValue = `${dateTimeString} ${tz.id}`;\n }\n\n switch (condition) {\n case DateCondition.IS_EXACTLY:\n return `${columnName} == '${formattedValue}'`;\n case DateCondition.IS_NOT_EXACTLY:\n return `${columnName} != '${formattedValue}'`;\n case DateCondition.IS_BEFORE:\n return `${columnName} < '${formattedValue}'`;\n case DateCondition.IS_BEFORE_OR_EQUAL:\n return `${columnName} <= '${formattedValue}'`;\n case DateCondition.IS_AFTER:\n return `${columnName} > '${formattedValue}'`;\n case DateCondition.IS_AFTER_OR_EQUAL:\n return `${columnName} >= '${formattedValue}'`;\n case DateCondition.IS_NULL:\n return `${columnName} == null`;\n case DateCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForBooleanCondition(\n columnName: ColumnName,\n condition: BooleanCondition\n): string {\n switch (condition) {\n case BooleanCondition.IS_TRUE:\n return `${columnName} == true`;\n case BooleanCondition.IS_FALSE:\n return `${columnName} == false`;\n case BooleanCondition.IS_NULL:\n return `${columnName} == null`;\n case BooleanCondition.IS_NOT_NULL:\n return `${columnName} != null`;\n }\n}\n\nexport function getTextForCharCondition(\n columnName: ColumnName,\n condition: CharCondition,\n value: unknown\n): string {\n switch (condition) {\n case CharCondition.IS_EQUAL:\n return `${columnName} == '${value}'`;\n case CharCondition.IS_NOT_EQUAL:\n return `${columnName} != '${value}'`;\n case CharCondition.IS_NULL:\n return `isNull(${columnName})`;\n case CharCondition.IS_NOT_NULL:\n return `!isNull(${columnName})`;\n }\n}\n\nexport function getShortLabelForConditionType(\n columnType: string,\n condition: Condition\n): string {\n if (TableUtils.isNumberType(columnType)) {\n return getShortLabelForNumberCondition(condition as NumberCondition);\n }\n if (TableUtils.isCharType(columnType)) {\n return getShortLabelForCharCondition(condition as CharCondition);\n }\n if (TableUtils.isStringType(columnType)) {\n return getShortLabelForStringCondition(condition as StringCondition);\n }\n if (TableUtils.isDateType(columnType)) {\n return getShortLabelForDateCondition(condition as DateCondition);\n }\n if (TableUtils.isBooleanType(columnType)) {\n return getShortLabelForBooleanCondition(condition as BooleanCondition);\n }\n\n throw new Error('Invalid column type');\n}\n\n/**\n * Get format columns array for the given columns and formatting rules\n * @param columns Available columns\n * @param rules Formatting rules to build the format columns from\n * @returns Array of format columns\n */\nexport function getFormatColumns(\n dh: typeof DhType,\n columns: readonly DhType.Column[],\n rules: readonly FormattingRule[]\n): DhType.CustomColumn[] {\n if (rules === undefined) {\n log.debug(`no rules passed.`);\n return [];\n }\n const result: DhType.CustomColumn[] = [];\n // There can be only one row format custom column\n // and multiple column format custom columns (one per column)\n let rowFormatConfig: [string, DhType.CustomColumn];\n const columnFormatConfigMap = new Map<\n string,\n [string, DhType.CustomColumn]\n >();\n rules.forEach(({ config, type: formatterType }) => {\n const { column } = config;\n // Check both name and type because the type can change\n const col = columns.find(\n ({ name, type }) => name === column.name && type === column.type\n );\n if (col === undefined) {\n log.debug(\n `Column ${column.name}:${column.type} not found. Ignoring format rule.`,\n config\n );\n return;\n }\n // Stack ternary format conditions by column\n const [prevRule, prevFormatColumn] = (formatterType ===\n FormatterType.CONDITIONAL\n ? columnFormatConfigMap.get(col.name)\n : rowFormatConfig) ?? ['null', undefined];\n const rule = makeTernaryFormatRule(dh, config, prevRule);\n if (rule === undefined) {\n log.debug(`Ignoring format rule.`, config);\n return;\n }\n // Replace existing formatColumn with the new stacked format\n const index =\n prevFormatColumn === undefined ? -1 : result.indexOf(prevFormatColumn);\n if (index > -1) {\n result.splice(index, 1);\n }\n const formatColumn =\n formatterType === FormatterType.CONDITIONAL\n ? makeColumnFormatColumn(col, rule)\n : makeRowFormatColumn(dh, rule);\n result.push(formatColumn);\n if (formatterType === FormatterType.CONDITIONAL) {\n columnFormatConfigMap.set(col.name, [rule, formatColumn]);\n } else {\n rowFormatConfig = [rule, formatColumn];\n }\n });\n\n return result;\n}\n\n/**\n * Validate that a given date condition + value pair is valid.\n * @param condition\n * @param value\n */\nexport function isDateConditionValid(\n dh: typeof DhType,\n condition: DateCondition,\n value?: string\n): boolean {\n switch (condition) {\n case DateCondition.IS_NULL:\n case DateCondition.IS_NOT_NULL:\n return true;\n\n default: {\n const [dateTimeString, ...rest] = (value ?? '').split(' ');\n // Reconstitute all tokens after the first ' ' in case the user included garbage data at the end\n // e.g. '2020-01-01 NY blah'\n const tzCode = rest.join(' ');\n\n try {\n DateUtils.parseDateTimeString(dateTimeString);\n } catch (e) {\n log.debug('Invalid datetime string', dateTimeString);\n return false;\n }\n\n try {\n dh.i18n.TimeZone.getTimeZone(tzCode);\n } catch (e) {\n log.debug('Invalid timezone string', tzCode);\n return false;\n }\n\n return true;\n }\n }\n}\n\nexport function isSupportedColumn({ type }: ModelColumn): boolean {\n return (\n TableUtils.isNumberType(type) ||\n TableUtils.isCharType(type) ||\n TableUtils.isStringType(type) ||\n TableUtils.isDateType(type) ||\n TableUtils.isBooleanType(type)\n );\n}\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,gBAAgB;AAEhC,SAASC,SAAS,EAAEC,UAAU,QAAQ,wBAAwB;AAAC,SAE7DC,sBAAsB,EACtBC,mBAAmB,EACnBC,qBAAqB;AAIvB,IAAMC,GAAG,GAAGN,GAAG,CAACO,MAAM,CAAC,4BAA4B,CAAC;AAmCpD,WAAYC,aAAa,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAUzB,WAAYC,eAAe,0BAAfA,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IAC3BzB,UAAU,CAACyD,aAAa,CAAChC,IAAI,CAAC;AAElC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/iris-grid",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.1",
|
|
4
4
|
"description": "Deephaven Iris Grid",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "ce430c4d4bf89c95a6a9ade1d8bf3a88becad98d"
|
|
85
85
|
}
|