Skip to content

Commit 03b088e

Browse files
committed
Publish v1.3.0
1 parent f367cf6 commit 03b088e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

README.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,20 @@ npm i directus-extension-computed-interface
2020
1. Go to **Settings**, create a new field with type string or number.
2121
2. In the **Interface** panel, choose **Computed** interface. There are 2 options:
2222
1. **Template**: Similar to M2M interface, determine how the field is calculated. Learn more about syntax in the next section.
23-
2. **Display Only**: If the field is an alias and you don't want to save to the database, enable this.
23+
2. **Field Mode**: Choose how the value is displayed.
24+
- **null**: Default option. Show an input with the computed value but still allow manual editing.
25+
- **Display Only**: Show the computed value but will not save it to the database. Usually used for alias fields.
26+
- **Read Only**: Show an input with the computed value and disallow manual editing.
27+
3. **Prefix**: a string to prefix the computed value.
28+
4. **Suffix**: a string to suffix the computed value.
29+
5. **Custom CSS**: an object for inline style binding. Only works with **Display Only** and **Read Only** mode. You can use this option to customize the appearance of the computed value such as font size, color, etc.
2430

2531
# Syntax
32+
33+
The template consists of 2 elements: plain strings & expressions.
34+
- Plain strings are string literal, often used for text interpolation.
35+
- Expressions can contains operators, other fields & numbers. They must be enclosed by `{{` and `}}`.
36+
2637
## Examples
2738
Sum 2 numbers:
2839
```
@@ -143,4 +154,3 @@ Operator | Description
143154

144155
# Limitation
145156
- Cannot parse literal strings (`{{ 's' }}`).
146-
- Cannot use relational fields (`{{ user.name }}`).

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "directus-extension-computed-interface",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Perform computed value based on other fields",
55
"author": {
66
"email": "duydvu98@gmail.com",

0 commit comments

Comments
 (0)