-
Notifications
You must be signed in to change notification settings - Fork 588
/
lte.js
33 lines (32 loc) · 1.13 KB
/
lte.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import React from "react";
import { Grid, Cell } from "@webiny/ui/Grid";
import { Input } from "@webiny/ui/Input";
import { validation } from "@webiny/validation";
export default {
type: "form-editor-field-validator",
name: "form-editor-field-validator-lte",
validator: {
name: "lte",
label: "Smaller or equal",
description: "Entered value must be equal or lower than the provided min value.",
defaultMessage: "Value is too great.",
renderSettings({ Bind }) {
return (
<Grid>
<Cell span={12}>
<Bind
name={"settings.value"}
validators={validation.create("required,numeric")}
>
<Input
type={"number"}
label={"Value"}
description={"This is the greatest value that will be allowed"}
/>
</Bind>
</Cell>
</Grid>
);
}
}
};