@finos/legend-query-builder 4.14.25 → 4.14.26
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/components/QueryBuilderConstantExpressionPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderConstantExpressionPanel.js +20 -8
- package/lib/components/QueryBuilderConstantExpressionPanel.js.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.d.ts.map +1 -1
- package/lib/components/QueryBuilderParametersPanel.js +18 -14
- package/lib/components/QueryBuilderParametersPanel.js.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts +2 -2
- package/lib/components/shared/BasicValueSpecificationEditor.d.ts.map +1 -1
- package/lib/components/shared/BasicValueSpecificationEditor.js +12 -11
- package/lib/components/shared/BasicValueSpecificationEditor.js.map +1 -1
- package/lib/index.css +0 -16
- package/lib/package.json +1 -1
- package/package.json +4 -4
- package/src/components/QueryBuilderConstantExpressionPanel.tsx +37 -21
- package/src/components/QueryBuilderParametersPanel.tsx +14 -9
- package/src/components/shared/BasicValueSpecificationEditor.tsx +69 -49
@@ -70,7 +70,13 @@ import {
|
|
70
70
|
} from '@finos/legend-shared';
|
71
71
|
import { flowResult } from 'mobx';
|
72
72
|
import { observer } from 'mobx-react-lite';
|
73
|
-
import {
|
73
|
+
import {
|
74
|
+
forwardRef,
|
75
|
+
useEffect,
|
76
|
+
useImperativeHandle,
|
77
|
+
useRef,
|
78
|
+
useState,
|
79
|
+
} from 'react';
|
74
80
|
import {
|
75
81
|
instanceValue_setValue,
|
76
82
|
instanceValue_setValues,
|
@@ -204,23 +210,26 @@ const VariableExpressionParameterEditor = observer(
|
|
204
210
|
);
|
205
211
|
|
206
212
|
const StringPrimitiveInstanceValueEditor = observer(
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
213
|
+
forwardRef<
|
214
|
+
HTMLInputElement,
|
215
|
+
{
|
216
|
+
valueSpecification: PrimitiveInstanceValue;
|
217
|
+
className?: string | undefined;
|
218
|
+
setValueSpecification: (val: ValueSpecification) => void;
|
219
|
+
resetValue: () => void;
|
220
|
+
selectorConfig?:
|
221
|
+
| {
|
222
|
+
values: string[] | undefined;
|
223
|
+
isLoading: boolean;
|
224
|
+
reloadValues:
|
225
|
+
| DebouncedFunc<(inputValue: string) => GeneratorFn<void>>
|
226
|
+
| undefined;
|
227
|
+
cleanUpReloadValues?: () => void;
|
228
|
+
}
|
229
|
+
| undefined;
|
230
|
+
obseverContext: ObserverContext;
|
231
|
+
}
|
232
|
+
>(function StringPrimitiveInstanceValueEditor(props, ref) {
|
224
233
|
const {
|
225
234
|
valueSpecification,
|
226
235
|
className,
|
@@ -307,6 +316,7 @@ const StringPrimitiveInstanceValueEditor = observer(
|
|
307
316
|
value={value}
|
308
317
|
placeholder={value === '' ? '(empty)' : undefined}
|
309
318
|
onChange={changeInputValue}
|
319
|
+
ref={ref}
|
310
320
|
/>
|
311
321
|
)}
|
312
322
|
<button
|
@@ -319,7 +329,7 @@ const StringPrimitiveInstanceValueEditor = observer(
|
|
319
329
|
</button>
|
320
330
|
</div>
|
321
331
|
);
|
322
|
-
},
|
332
|
+
}),
|
323
333
|
);
|
324
334
|
|
325
335
|
const BooleanPrimitiveInstanceValueEditor = observer(
|
@@ -367,14 +377,17 @@ const BooleanPrimitiveInstanceValueEditor = observer(
|
|
367
377
|
);
|
368
378
|
|
369
379
|
const NumberPrimitiveInstanceValueEditor = observer(
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
380
|
+
forwardRef<
|
381
|
+
HTMLInputElement,
|
382
|
+
{
|
383
|
+
valueSpecification: PrimitiveInstanceValue;
|
384
|
+
isInteger: boolean;
|
385
|
+
className?: string | undefined;
|
386
|
+
resetValue: () => void;
|
387
|
+
setValueSpecification: (val: ValueSpecification) => void;
|
388
|
+
obseverContext: ObserverContext;
|
389
|
+
}
|
390
|
+
>(function NumberPrimitiveInstanceValueEditor(props, ref) {
|
378
391
|
const {
|
379
392
|
valueSpecification,
|
380
393
|
isInteger,
|
@@ -387,6 +400,7 @@ const NumberPrimitiveInstanceValueEditor = observer(
|
|
387
400
|
(valueSpecification.values[0] as number).toString(),
|
388
401
|
);
|
389
402
|
const inputRef = useRef<HTMLInputElement>(null);
|
403
|
+
useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);
|
390
404
|
const numericValue = isInteger
|
391
405
|
? Number.parseInt(Number(value).toString(), 10)
|
392
406
|
: Number(value);
|
@@ -484,7 +498,7 @@ const NumberPrimitiveInstanceValueEditor = observer(
|
|
484
498
|
</button>
|
485
499
|
</div>
|
486
500
|
);
|
487
|
-
},
|
501
|
+
}),
|
488
502
|
);
|
489
503
|
|
490
504
|
const EnumValueInstanceValueEditor = observer(
|
@@ -947,26 +961,29 @@ const DateInstanceValueEditor = observer(
|
|
947
961
|
*
|
948
962
|
* See https://github.com/finos/legend-studio/pull/1021
|
949
963
|
*/
|
950
|
-
export const BasicValueSpecificationEditor
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
}
|
964
|
+
export const BasicValueSpecificationEditor = forwardRef<
|
965
|
+
HTMLInputElement,
|
966
|
+
{
|
967
|
+
valueSpecification: ValueSpecification;
|
968
|
+
graph: PureModel;
|
969
|
+
obseverContext: ObserverContext;
|
970
|
+
typeCheckOption: TypeCheckOption;
|
971
|
+
className?: string | undefined;
|
972
|
+
setValueSpecification: (val: ValueSpecification) => void;
|
973
|
+
resetValue: () => void;
|
974
|
+
isConstant?: boolean;
|
975
|
+
selectorConfig?:
|
976
|
+
| {
|
977
|
+
values: string[] | undefined;
|
978
|
+
isLoading: boolean;
|
979
|
+
reloadValues:
|
980
|
+
| DebouncedFunc<(inputValue: string) => GeneratorFn<void>>
|
981
|
+
| undefined;
|
982
|
+
cleanUpReloadValues?: () => void;
|
983
|
+
}
|
984
|
+
| undefined;
|
985
|
+
}
|
986
|
+
>(function BasicValueSpecificationEditor(props, ref) {
|
970
987
|
const {
|
971
988
|
className,
|
972
989
|
valueSpecification,
|
@@ -990,6 +1007,7 @@ export const BasicValueSpecificationEditor: React.FC<{
|
|
990
1007
|
resetValue={resetValue}
|
991
1008
|
selectorConfig={selectorConfig}
|
992
1009
|
obseverContext={obseverContext}
|
1010
|
+
ref={ref}
|
993
1011
|
/>
|
994
1012
|
);
|
995
1013
|
case PRIMITIVE_TYPE.BOOLEAN:
|
@@ -1016,6 +1034,7 @@ export const BasicValueSpecificationEditor: React.FC<{
|
|
1016
1034
|
className={className}
|
1017
1035
|
resetValue={resetValue}
|
1018
1036
|
obseverContext={obseverContext}
|
1037
|
+
ref={ref}
|
1019
1038
|
/>
|
1020
1039
|
);
|
1021
1040
|
case PRIMITIVE_TYPE.DATE:
|
@@ -1134,6 +1153,7 @@ export const BasicValueSpecificationEditor: React.FC<{
|
|
1134
1153
|
className={className}
|
1135
1154
|
resetValue={resetValue}
|
1136
1155
|
obseverContext={obseverContext}
|
1156
|
+
ref={ref}
|
1137
1157
|
/>
|
1138
1158
|
);
|
1139
1159
|
}
|
@@ -1141,4 +1161,4 @@ export const BasicValueSpecificationEditor: React.FC<{
|
|
1141
1161
|
}
|
1142
1162
|
|
1143
1163
|
return <UnsupportedValueSpecificationEditor />;
|
1144
|
-
};
|
1164
|
+
});
|