@graphcore/react-kernel 0.2.3 → 0.2.5
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/api/predicate.d.ts +12 -0
- package/dist/components/Access/useAccess.d.ts +1 -0
- package/dist/components/Strategy/StrategyForm.d.ts +29 -0
- package/dist/graphcore-react-kernel.cjs.js +3 -3
- package/dist/graphcore-react-kernel.es.js +1771 -1328
- package/dist/hooks/useEditable.d.ts +16 -0
- package/dist/hooks/useStrategy.d.ts +16 -0
- package/dist/lib/index.d.ts +9 -3
- package/dist/state/entityGraph/entityAccessors.d.ts +1 -0
- package/dist/state/entityGraph/hooks.d.ts +6 -0
- package/dist/state/entityGraph/index.d.ts +1 -1
- package/dist/state/entityGraph/store.d.ts +3 -0
- package/dist/state/entityGraph/types.d.ts +8 -0
- package/dist/state/graphCoreBridge/types.d.ts +1 -0
- package/dist/state/queryResults.d.ts +12 -0
- package/dist/state/registryDirectoryStore.d.ts +10 -0
- package/dist/state/useEntityQuery.d.ts +10 -4
- package/dist/utils/StrategyRequestBuilder.d.ts +1 -2
- package/dist/views/EntityView.d.ts +16 -7
- package/dist/views/PlacementContext.d.ts +4 -0
- package/package.json +1 -1
package/dist/api/predicate.d.ts
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
* (persistence/ENTITY_REPOSITORY_TECHNICAL_TDD.md, Wire encoding).
|
|
5
5
|
*/
|
|
6
6
|
export type Scalar = string | number | boolean | null;
|
|
7
|
+
/** Exclusive (`gt`, `lt`) or inclusive (`gte`, `lte`); at most one lower and one upper. */
|
|
8
|
+
export type Bounds = {
|
|
9
|
+
gt?: string | number;
|
|
10
|
+
gte?: string | number;
|
|
11
|
+
lt?: string | number;
|
|
12
|
+
lte?: string | number;
|
|
13
|
+
};
|
|
7
14
|
export type Predicate = {
|
|
8
15
|
equal: {
|
|
9
16
|
field: string;
|
|
@@ -24,6 +31,10 @@ export type Predicate = {
|
|
|
24
31
|
field: string;
|
|
25
32
|
values: Scalar[];
|
|
26
33
|
};
|
|
34
|
+
} | {
|
|
35
|
+
range: {
|
|
36
|
+
field: string;
|
|
37
|
+
} & Bounds;
|
|
27
38
|
} | {
|
|
28
39
|
all_of: Predicate[];
|
|
29
40
|
} | {
|
|
@@ -33,5 +44,6 @@ export declare const equal: (field: string, value: Scalar) => Predicate;
|
|
|
33
44
|
export declare const inValues: (field: string, values: Scalar[]) => Predicate;
|
|
34
45
|
export declare const containsValue: (field: string, value: Scalar) => Predicate;
|
|
35
46
|
export declare const containsAny: (field: string, values: Scalar[]) => Predicate;
|
|
47
|
+
export declare const range: (field: string, bounds: Bounds) => Predicate;
|
|
36
48
|
export declare const allOf: (...predicates: Predicate[]) => Predicate;
|
|
37
49
|
export declare const anyOf: (...predicates: Predicate[]) => Predicate;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type Values = Record<string, unknown>;
|
|
3
|
+
export type StrategyFormProps = {
|
|
4
|
+
/** The strategy's name, as registered on the backend. */
|
|
5
|
+
strategy: string;
|
|
6
|
+
target: string | null;
|
|
7
|
+
/** Shown until the user edits a field; pass live entity values here. */
|
|
8
|
+
initial?: Values;
|
|
9
|
+
/** Controlled: the values to show, with `onChange` receiving each edit (pair with `useEditable`). */
|
|
10
|
+
value?: Values | null;
|
|
11
|
+
onChange?: (patch: Values) => void;
|
|
12
|
+
/** The params to show, in order. Default: every param the form can render. */
|
|
13
|
+
fields?: string[];
|
|
14
|
+
/** Params sent with every submit but never shown, such as `base_version`. */
|
|
15
|
+
hidden?: Values;
|
|
16
|
+
labels?: Record<string, string>;
|
|
17
|
+
submitLabel?: string;
|
|
18
|
+
onDone?: (result: Values) => void;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* A form for one strategy, built from its request schema: text, number and
|
|
22
|
+
* true/false fields, enums as a select, and lists of strings. A string whose
|
|
23
|
+
* `maxLength` is over 200 is a text area. Params of any other shape are left
|
|
24
|
+
* out; send them through `hidden`, or write the form by hand. Uncontrolled, it
|
|
25
|
+
* shows `initial` until edited and keeps its own draft; controlled, it shows
|
|
26
|
+
* `value` and reports edits to `onChange`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function StrategyForm({ strategy, target, initial, value, onChange, fields, hidden, labels, submitLabel, onDone, }: StrategyFormProps): React.JSX.Element;
|
|
29
|
+
export {};
|