@ulb-darmstadt/shacl-form 1.0.11 → 1.0.13
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 +2 -0
- package/dist/config.d.ts +1 -0
- package/dist/form.d.ts +7 -3
- package/dist/index-with-plugins.d.ts +2 -0
- package/dist/index-with-plugins.js +3 -0
- package/dist/index-with-plugins.js.LICENSE.txt +16 -0
- package/dist/index-with-plugins.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/inputs.d.ts +23 -14
- package/dist/node.d.ts +4 -4
- package/dist/plugin.d.ts +10 -0
- package/dist/plugins/fixed-list.d.ts +8 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/mapbox.d.ts +8 -0
- package/dist/property.d.ts +3 -3
- package/package.json +7 -4
package/dist/inputs.d.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Quad, NamedNode } from 'n3';
|
|
2
2
|
import { Term, Literal } from '@rdfjs/types';
|
|
3
3
|
import { Config } from './config';
|
|
4
|
+
export declare type Editor = HTMLElement & {
|
|
5
|
+
value: string;
|
|
6
|
+
};
|
|
4
7
|
export declare abstract class InputBase extends HTMLElement {
|
|
5
8
|
static idCtr: number;
|
|
6
|
-
|
|
9
|
+
config: Config;
|
|
10
|
+
editor: Editor;
|
|
7
11
|
required: boolean;
|
|
8
12
|
name: string;
|
|
9
13
|
description: string;
|
|
@@ -12,32 +16,37 @@ export declare abstract class InputBase extends HTMLElement {
|
|
|
12
16
|
maxCount: string;
|
|
13
17
|
path: string;
|
|
14
18
|
pattern: string;
|
|
15
|
-
dataType: NamedNode;
|
|
16
|
-
nodeKind: NamedNode;
|
|
17
|
-
constructor(quads: Quad[],
|
|
18
|
-
setValue(value:
|
|
19
|
-
abstract createEditor(quads: Quad[]):
|
|
19
|
+
dataType: NamedNode | undefined;
|
|
20
|
+
nodeKind: NamedNode | null;
|
|
21
|
+
constructor(quads: Quad[], config: Config);
|
|
22
|
+
setValue(value: string): void;
|
|
23
|
+
abstract createEditor(quads: Quad[]): Editor;
|
|
20
24
|
abstract toRDFObject(): Literal | NamedNode | undefined;
|
|
21
25
|
}
|
|
22
26
|
export declare class InputDate extends InputBase {
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
createEditor(quads: Quad[]): Editor;
|
|
28
|
+
setValue(value: string): void;
|
|
25
29
|
toRDFObject(): Literal | undefined;
|
|
26
30
|
}
|
|
27
31
|
export declare class InputText extends InputBase {
|
|
28
|
-
constructor(quads: Quad[],
|
|
29
|
-
createEditor(quads: Quad[]):
|
|
32
|
+
constructor(quads: Quad[], config: Config);
|
|
33
|
+
createEditor(quads: Quad[]): Editor;
|
|
30
34
|
toRDFObject(): Literal | NamedNode | undefined;
|
|
31
35
|
}
|
|
32
36
|
export declare class InputNumber extends InputBase {
|
|
33
|
-
constructor(quads: Quad[],
|
|
34
|
-
createEditor(quads: Quad[]):
|
|
37
|
+
constructor(quads: Quad[], config: Config);
|
|
38
|
+
createEditor(quads: Quad[]): Editor;
|
|
35
39
|
toRDFObject(): Literal | undefined;
|
|
36
40
|
}
|
|
41
|
+
export declare type InputListEntry = Term | {
|
|
42
|
+
label?: string;
|
|
43
|
+
value: string;
|
|
44
|
+
};
|
|
37
45
|
export declare class InputList extends InputBase {
|
|
38
|
-
constructor(quads: Quad[],
|
|
46
|
+
constructor(quads: Quad[], config: Config);
|
|
47
|
+
setListEntries(list: InputListEntry[]): void;
|
|
39
48
|
findLabel(subject: NamedNode, config: Config): string | null;
|
|
40
|
-
createEditor(quads: Quad[]):
|
|
49
|
+
createEditor(quads: Quad[]): Editor;
|
|
41
50
|
toRDFObject(): Literal | NamedNode | undefined;
|
|
42
51
|
}
|
|
43
52
|
export declare function inputFactory(quads: Quad[], config: Config): InputBase;
|
package/dist/node.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BlankNode, NamedNode, Store } from 'n3';
|
|
2
2
|
import { ShaclProperty } from './property';
|
|
3
|
-
import {
|
|
3
|
+
import { ShaclForm } from './form';
|
|
4
4
|
export declare class ShaclNode extends HTMLElement {
|
|
5
|
-
static blankNodeIdCtr: number;
|
|
6
5
|
shaclSubject: NamedNode;
|
|
7
6
|
exportValueSubject: NamedNode | BlankNode;
|
|
8
7
|
targetClass: NamedNode | undefined;
|
|
9
|
-
parent: ShaclNode | ShaclProperty |
|
|
10
|
-
|
|
8
|
+
parent: ShaclNode | ShaclProperty | undefined;
|
|
9
|
+
form: ShaclForm;
|
|
10
|
+
constructor(form: ShaclForm, shaclSubject: NamedNode, parent: ShaclNode | ShaclProperty | undefined, valueSubject: NamedNode | BlankNode | undefined);
|
|
11
11
|
toRDF(graph: Store, subject?: NamedNode | BlankNode): (NamedNode | BlankNode);
|
|
12
12
|
}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ShaclProperty } from './property';
|
|
2
|
+
import { InputBase } from './inputs';
|
|
3
|
+
export declare type Plugins = {
|
|
4
|
+
[predicate: string]: Plugin;
|
|
5
|
+
};
|
|
6
|
+
export declare abstract class Plugin {
|
|
7
|
+
predicate: string;
|
|
8
|
+
constructor(predicate: string);
|
|
9
|
+
abstract createInstance(property: ShaclProperty, value?: string): InputBase;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from '../plugin';
|
|
2
|
+
import { ShaclProperty } from '../property';
|
|
3
|
+
import { InputList, InputListEntry } from '../inputs';
|
|
4
|
+
export declare class FixedListPlugin extends Plugin {
|
|
5
|
+
entries: InputListEntry[] | Promise<InputListEntry[]>;
|
|
6
|
+
constructor(predicate: string, entries: InputListEntry[] | Promise<InputListEntry[]>);
|
|
7
|
+
createInstance(property: ShaclProperty, value?: string): InputList;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputText } from '../inputs';
|
|
2
|
+
import { Plugin } from '../plugin';
|
|
3
|
+
import { ShaclProperty } from '../property';
|
|
4
|
+
export declare class MapBoxPlugin extends Plugin {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
constructor(predicate: string, apiKey: string);
|
|
7
|
+
createInstance(property: ShaclProperty, value?: string): InputText;
|
|
8
|
+
}
|
package/dist/property.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { BlankNode, NamedNode, Quad, Store, Quad_Object } from 'n3';
|
|
2
|
-
import {
|
|
2
|
+
import { ShaclForm } from './form';
|
|
3
3
|
export declare class ShaclProperty extends HTMLElement {
|
|
4
4
|
name: string;
|
|
5
5
|
node: NamedNode | null;
|
|
6
6
|
minCount: number;
|
|
7
7
|
maxCount: number;
|
|
8
8
|
quads: Quad[];
|
|
9
|
-
|
|
9
|
+
form: ShaclForm;
|
|
10
10
|
addButton: HTMLElement;
|
|
11
|
-
constructor(
|
|
11
|
+
constructor(form: ShaclForm, shaclSubject: BlankNode | NamedNode, valueSubject?: NamedNode | BlankNode);
|
|
12
12
|
createPropertyInstance(value?: Quad_Object): HTMLElement;
|
|
13
13
|
updateControls(): void;
|
|
14
14
|
toRDF(graph: Store, subject: NamedNode | BlankNode): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulb-darmstadt/shacl-form",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "SHACL form generator",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,16 +25,18 @@
|
|
|
25
25
|
],
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "npm run clean && webpack --mode production",
|
|
28
|
-
"clean": "
|
|
28
|
+
"clean": "rimraf dist",
|
|
29
29
|
"test": "echo \"no tests specified\" && exit 0",
|
|
30
30
|
"serve": "webpack serve --mode development"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/n3": "^1.10.4",
|
|
34
34
|
"buffer": "^6.0.3",
|
|
35
|
-
"
|
|
35
|
+
"css-loader": "^6.7.3",
|
|
36
|
+
"rimraf": "^4.1.2",
|
|
36
37
|
"save": "^2.9.0",
|
|
37
38
|
"stream-browserify": "^3.0.0",
|
|
39
|
+
"style-loader": "^3.3.1",
|
|
38
40
|
"ts-loader": "^9.4.1",
|
|
39
41
|
"typescript": "^4.8.4",
|
|
40
42
|
"webpack": "^5.75.0",
|
|
@@ -44,6 +46,7 @@
|
|
|
44
46
|
"dependencies": {
|
|
45
47
|
"n3": "^1.16.2",
|
|
46
48
|
"rdf-ext": "^2.1.0",
|
|
47
|
-
"rdf-validate-shacl": "^0.4.5"
|
|
49
|
+
"rdf-validate-shacl": "^0.4.5",
|
|
50
|
+
"uuid": "^9.0.0"
|
|
48
51
|
}
|
|
49
52
|
}
|