Skip to content

Commit c36e1a5

Browse files
committed
Merge branch 'newDoc' of https://github.com/terminusdb/terminusdb-dashboard into newDoc
2 parents 7fb69f1 + 1d78154 commit c36e1a5

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

packages/tdb-documents-ui/sandbox/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,30 @@ To import css is light or dark mode
1414

1515
```import '@terminusdb/terminusdb-documents-ui/dist/css/terminusdb__darkly.css'``` or
1616
```import '@terminusdb/terminusdb-documents-ui/dist/css/terminusdb__light.css'```
17-
17+
18+
## Props
19+
| props |description |
20+
|-- |--|
21+
|frame |The database Class Frame, or object of all class frames|
22+
|type | document type of interest to be displayed in form|
23+
|mode | create/ edit/ view mode of form|
24+
|formData | formData is the data to be filled in form during Edit or View mode |
25+
|onSubmit | A function which acts as a callback with some custom logic to process data submitted via form|
26+
|onSelect | A function which acts as a callback which provides a UI within the <FrameViwere/> from which user can select another document link. This can be a react component which can be used as search component|
27+
|onTraverse | A function which acts as a callback which gets back the ID of a document on click |
28+
|language | language code parameters to support a wide variety of languages in UI as defined in schema
29+
|showThemeSelector| a Selector to select different themes when using Themes on an application level
30+
|theme | a default theme in which Form will be displayed - if not mentioned ``darkly`` Bootswatch theme will be used by default
31+
32+
33+
## Mandatory Props
34+
| props |Mandatory |
35+
|-- |--|
36+
|frame |true |
37+
|type |true |
38+
|mode |true |
39+
|formData |formData has to be mandatory in Edit or View mode. If nothing to display then pass empty json {}|
40+
1841
## Run sandbox
1942

2043
Run sandbox to get a demo on how to use ``<FrameViewer/>`` component.

packages/tdb-documents-ui/sandbox/src/View.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const View = () => {
4141
formData={getFormData(mode, type, setData)}
4242
onTraverse={handleTraverse}
4343
onSelect={<Search/>}
44-
theme="minty"
44+
theme="darkly"
4545
showThemeSelector={true}
4646
onSubmit={handleSubmit}
4747
type={type}

packages/tdb-documents-ui/src/FrameViewer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Row } from "react-bootstrap"
1111
//import { loadTheme } from "./formActions"
1212

1313
/*
14-
** frame - full json schema of a document
14+
** frame - The database Class Frame, or object of all class frames
1515
** uiFrame - ui json of a document
1616
** type - document type of interest
1717
** mode - create/ edit/ view
@@ -23,6 +23,7 @@ import { Row } from "react-bootstrap"
2323
** compareFormData - used for diff viewers to compare against original or changed data
2424
** language - language code parameters to support a wide variety of languages in Ui as defined in schema
2525
** showThemeSelector - a Select to select differnet themes when using Themes on an application level
26+
** theme - a default theme in which Form will be displayed
2627
*/
2728
export function FrameViewer(props){
2829

0 commit comments

Comments
 (0)