@entryscape/rdforms 10.3.1 → 10.3.2
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/dist/rdforms.bmd.js +4 -4
- package/dist/rdforms.bootstrap.js +4 -4
- package/dist/rdforms.jquery.js +3 -3
- package/dist/rdforms.node.js +1 -1
- package/dist/rdforms.react.js +8 -8
- package/package.json +1 -1
- package/src/model/engine.js +1 -1
- package/src/template/Item.js +1 -0
- package/src/view/Editor.js +1 -1
- package/src/view/View.js +32 -18
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@entryscape/rdforms",
|
|
3
3
|
"description": "RDForms (aka RDF Forms) is a JavaScript library that uses templates to describe how to edit, present and validate RDF. The library is intended to be used in web applications to ease the burden of developers to deal natively with RDF.",
|
|
4
4
|
"keywords": ["RDF", "editor", "metadata", "application profile", "linked data"],
|
|
5
|
-
"version": "10.3.
|
|
5
|
+
"version": "10.3.2",
|
|
6
6
|
"main": "dist/rdforms.node.js",
|
|
7
7
|
"browser": "dist/rdforms.react.js",
|
|
8
8
|
"module": "main.js",
|
package/src/model/engine.js
CHANGED
|
@@ -357,7 +357,7 @@ const _matchTextItem = (pb, item) => {
|
|
|
357
357
|
if (_noDibbs(stmt) && _isPatternMatch(item, stmt)) {
|
|
358
358
|
const ntMatch = _isNodeTypeMatch(item, stmt);
|
|
359
359
|
const dtMatch = _isDataTypeMatch(item, stmt);
|
|
360
|
-
if ((ntMatch && dtMatch) || _fuzzy) {
|
|
360
|
+
if ((ntMatch && (dtMatch || item.hasStyle('relaxedDatatypeMatch'))) || _fuzzy) {
|
|
361
361
|
_dibbs(stmt);
|
|
362
362
|
let matchingCode = ntMatch ? CODES.OK : CODES.WRONG_NODETYPE;
|
|
363
363
|
if (!dtMatch) {
|
package/src/template/Item.js
CHANGED
package/src/view/Editor.js
CHANGED
|
@@ -18,7 +18,7 @@ const showNow = (editor, item, bindings, includeLevel) => {
|
|
|
18
18
|
const prop = item.getProperty();
|
|
19
19
|
if (bindings.length > 0) {
|
|
20
20
|
if (prop) {
|
|
21
|
-
return !editor.
|
|
21
|
+
return !editor.filterItem(item);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
// Take care of layout grouping by checking recursively.
|
package/src/view/View.js
CHANGED
|
@@ -3,6 +3,7 @@ import renderingContext from './renderingContext';
|
|
|
3
3
|
import GroupBinding from '../model/GroupBinding';
|
|
4
4
|
import * as engine from '../model/engine';
|
|
5
5
|
import { bindingReport } from '../model/validate';
|
|
6
|
+
import {namespaces} from "@entryscape/rdfjson";
|
|
6
7
|
|
|
7
8
|
let viewCounter = 0;
|
|
8
9
|
export default class View {
|
|
@@ -286,24 +287,37 @@ export default class View {
|
|
|
286
287
|
}
|
|
287
288
|
|
|
288
289
|
filterBinding(binding) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
//
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
290
|
+
return this.filterItem(binding.getItem());
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
filterItem(itemToCheck) {
|
|
294
|
+
const filterPredicates = this._getFilterPredicates();
|
|
295
|
+
|
|
296
|
+
const filter = (item, fp) => {
|
|
297
|
+
// Exclude based on item id.
|
|
298
|
+
const id = item.getId();
|
|
299
|
+
if (id && fp && Object.keys(fp).includes(id)) {
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
// Exclude if property matches.
|
|
303
|
+
const prop = item.getProperty();
|
|
304
|
+
if (fp && prop) {
|
|
305
|
+
return fp[prop] === true || fp[namespaces.shortenKnown(prop)] === true;
|
|
306
|
+
}
|
|
307
|
+
if (fp && item.getType() === 'group' && !item.getProperty()) {
|
|
308
|
+
// Checks one level below if there is a child that is visible
|
|
309
|
+
const childBindings = item.getChildren() || [];
|
|
310
|
+
let hasNonFilteredChild = false;
|
|
311
|
+
childBindings.forEach((child) => {
|
|
312
|
+
if (!filter(child, fp)) {
|
|
313
|
+
hasNonFilteredChild = true;
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
return !hasNonFilteredChild;
|
|
317
|
+
}
|
|
318
|
+
return false;
|
|
319
|
+
};
|
|
320
|
+
return filter(itemToCheck, filterPredicates);
|
|
307
321
|
}
|
|
308
322
|
|
|
309
323
|
filterProperty(property) {
|