@ulb-darmstadt/shacl-form 1.3.8 → 1.4.0
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/README.md +4 -4
- package/dist/exports.d.ts +1 -0
- package/dist/form-bootstrap.js +1 -1
- package/dist/form-default.js +1 -1
- package/dist/form-material.js +2 -2
- package/dist/plugins/leaflet.d.ts +18 -0
- package/dist/plugins/leaflet.js +2 -0
- package/dist/plugins/leaflet.js.LICENSE.txt +4 -0
- package/dist/plugins/map-util.d.ts +5 -0
- package/dist/plugins/mapbox.d.ts +1 -5
- package/dist/plugins/mapbox.js +1 -1
- package/dist/util.d.ts +1 -1
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ Validates the form data against the SHACL shapes graph and displays validation r
|
|
|
91
91
|
```typescript
|
|
92
92
|
registerPlugin(plugin: Plugin)
|
|
93
93
|
```
|
|
94
|
-
Register a [plugin](./src/plugin.ts) to customize editing/viewing certain property values. Plugins handle specific RDF predicates or `xsd:datatype`s or both. Examples: [Mapbox](./src/plugins/mapbox.ts), [FixedList](./src/plugins/fixed-list.ts)
|
|
94
|
+
Register a [plugin](./src/plugin.ts) to customize editing/viewing certain property values. Plugins handle specific RDF predicates or `xsd:datatype`s or both. Examples: [Leaflet](./src/plugins/leaflet.ts), [Mapbox](./src/plugins/mapbox.ts), [FixedList](./src/plugins/fixed-list.ts)
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
97
|
setTheme(theme: Theme)
|
|
@@ -198,11 +198,11 @@ Properties of inherited shapes are displayed first.
|
|
|
198
198
|
|
|
199
199
|
Plugins can modify rendering of the form and add functionality to edit and view certain RDF datatypes or predicates (or a combination of both). As an example, the JavaScript of [this page](https://ulb-darmstadt.github.io/shacl-form/#example) contains the following code:
|
|
200
200
|
```typescript
|
|
201
|
-
import {
|
|
201
|
+
import { LeafletPlugin } from '@ulb-darmstadt/shacl-form/plugins/leaflet.js'
|
|
202
202
|
const form = document.getElementById("shacl-form")
|
|
203
|
-
form.registerPlugin(new
|
|
203
|
+
form.registerPlugin(new LeafletPlugin({ datatype: 'http://www.opengis.net/ont/geosparql#wktLiteral' }))
|
|
204
204
|
```
|
|
205
|
-
In effect, whenever a SHACL property has an `sh:datatype` of `http://www.opengis.net/ont/geosparql#wktLiteral`, the plugin is called to create the editor and/or viewer HTML elements. This specific plugin uses [
|
|
205
|
+
In effect, whenever a SHACL property has an `sh:datatype` of `http://www.opengis.net/ont/geosparql#wktLiteral`, the plugin is called to create the editor and/or viewer HTML elements. This specific plugin uses [Leaflet](https://leafletjs.com/) to edit or view geometry in format [well known text](http://giswiki.org/wiki/Well_Known_Text) on a map.
|
|
206
206
|
Custom plugins can be built by extending class [Plugin](https://github.com/ULB-Darmstadt/shacl-form/blob/main/src/plugin.ts#L40).
|
|
207
207
|
|
|
208
208
|
### Property grouping and collapsing
|
package/dist/exports.d.ts
CHANGED