@entryscape/rdforms 10.16.0 → 10.17.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/dist/rdforms.bootstrap.js +1 -1
- package/dist/rdforms.bootstrap.js.LICENSE.txt +0 -35
- package/dist/rdforms.jquery.js +1 -1
- package/dist/rdforms.jquery.js.LICENSE.txt +0 -35
- package/dist/rdforms.node.js +37 -36
- package/dist/rdforms.react.js +17 -17
- package/dist/rdforms.react.js.LICENSE.txt +0 -35
- package/package.json +17 -17
- package/src/template/Item.js +2 -0
- package/src/view/Editor.js +1 -1
- package/src/view/Presenter.js +2 -1
- package/src/view/ValidationPresenter.js +1 -1
- package/src/view/View.js +4 -1
- package/src/view/bootstrap/labels.js +6 -0
- package/src/view/react/labels.js +64 -82
- package/src/view/react/style.css +11 -1
- package/src/view/resources/rdforms.css +1 -2
|
@@ -5,13 +5,6 @@
|
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/*!
|
|
9
|
-
* The buffer module from node.js, for the browser.
|
|
10
|
-
*
|
|
11
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
12
|
-
* @license MIT
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
8
|
/*!
|
|
16
9
|
* jQuery JavaScript Library v3.7.1
|
|
17
10
|
* https://jquery.com/
|
|
@@ -23,34 +16,6 @@
|
|
|
23
16
|
* Date: 2023-08-28T13:37Z
|
|
24
17
|
*/
|
|
25
18
|
|
|
26
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
27
|
-
|
|
28
19
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
29
20
|
|
|
30
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Character class utilities for XML NS 1.0 edition 3.
|
|
34
|
-
*
|
|
35
|
-
* @author Louis-Dominique Dubeau
|
|
36
|
-
* @license MIT
|
|
37
|
-
* @copyright Louis-Dominique Dubeau
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Character classes and associated utilities for the 2nd edition of XML 1.1.
|
|
42
|
-
*
|
|
43
|
-
* @author Louis-Dominique Dubeau
|
|
44
|
-
* @license MIT
|
|
45
|
-
* @copyright Louis-Dominique Dubeau
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Character classes and associated utilities for the 5th edition of XML 1.0.
|
|
50
|
-
*
|
|
51
|
-
* @author Louis-Dominique Dubeau
|
|
52
|
-
* @license MIT
|
|
53
|
-
* @copyright Louis-Dominique Dubeau
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
21
|
//! moment.js
|
package/dist/rdforms.node.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
/******/ "use strict";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/ 229
|
|
6
|
-
|
|
5
|
+
/***/ 229
|
|
6
|
+
(module) {
|
|
7
7
|
|
|
8
8
|
module.exports = require("node-fetch");
|
|
9
9
|
|
|
10
|
-
/***/ }
|
|
10
|
+
/***/ }
|
|
11
11
|
|
|
12
12
|
/******/ });
|
|
13
13
|
/************************************************************************/
|
|
@@ -409,7 +409,7 @@ class Item {
|
|
|
409
409
|
this._bundle = bundle;
|
|
410
410
|
itemCount += 1;
|
|
411
411
|
this._internalId = itemCount;
|
|
412
|
-
this._styles = ['heading', 'invisible', 'invisibleGroup', 'stars', 'commentOn', 'multiline', 'horizontalRadioButtons', 'verticalRadioButtons', 'horizontalCheckBoxes', 'verticalCheckBoxes', 'nonEditable', 'expandable', 'compact', 'nonCompact', 'dropDown', 'table', 'firstcolumnfixedtable', 'tree', 'externalLink', 'internalLink', 'noLink', 'image', 'label', 'tooltip', 'strictmatch', 'relaxedDatatypeMatch', 'viewAllTranslations', 'filterTranslations', 'email', 'atLeastOneChild', 'atMostOneChild', 'exactlyOneChild', 'noLabelInPresent', 'autoInitDate', 'autoUpdateDate', 'autoUUID', 'autoValue', 'showURI', 'showLink', 'showValue', 'showDescriptionInPresent', 'showDescriptionInEdit', 'textAsChoice', 'preserveOrderOfChoices', 'linkWithLabel', 'deprecated', 'inline', 'truncate', 'noTruncate', 'card', 'cardInPresent', 'cardInEdit'];
|
|
412
|
+
this._styles = ['heading', 'invisible', 'invisibleInPresent', 'invisibleInEdit', 'invisibleGroup', 'stars', 'commentOn', 'multiline', 'horizontalRadioButtons', 'verticalRadioButtons', 'horizontalCheckBoxes', 'verticalCheckBoxes', 'nonEditable', 'expandable', 'compact', 'nonCompact', 'dropDown', 'table', 'firstcolumnfixedtable', 'tree', 'externalLink', 'internalLink', 'noLink', 'image', 'label', 'tooltip', 'strictmatch', 'relaxedDatatypeMatch', 'viewAllTranslations', 'filterTranslations', 'email', 'atLeastOneChild', 'atMostOneChild', 'exactlyOneChild', 'noLabelInPresent', 'autoInitDate', 'autoUpdateDate', 'autoUUID', 'autoValue', 'showURI', 'showLink', 'showValue', 'showDescriptionInPresent', 'showDescriptionInEdit', 'textAsChoice', 'preserveOrderOfChoices', 'linkWithLabel', 'deprecated', 'inline', 'truncate', 'noTruncate', 'card', 'cardInPresent', 'cardInEdit'];
|
|
413
413
|
this._getLocalizedValue = utils.getLocalizedValue;
|
|
414
414
|
}
|
|
415
415
|
|
|
@@ -1686,7 +1686,7 @@ class ValueBinding extends Binding {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
}
|
|
1688
1688
|
;// ./src/model/CODES.js
|
|
1689
|
-
/* harmony default export */ const
|
|
1689
|
+
/* harmony default export */ const CODES = ({
|
|
1690
1690
|
UNKNOWN: 'unknown',
|
|
1691
1691
|
// Used as a marker initially, to not mark everything red initially
|
|
1692
1692
|
OK: 'correct',
|
|
@@ -1744,9 +1744,9 @@ class ChoiceBinding extends ValueBinding {
|
|
|
1744
1744
|
this.setValue(choice.value, choice, silent);
|
|
1745
1745
|
}
|
|
1746
1746
|
if (choice && choice.mismatch) {
|
|
1747
|
-
this.setMatchingCode(
|
|
1748
|
-
} else if ((!choice || !choice.mismatch) && this.getMatchingCode() ===
|
|
1749
|
-
this.setMatchingCode(
|
|
1747
|
+
this.setMatchingCode(CODES.WRONG_VALUE);
|
|
1748
|
+
} else if ((!choice || !choice.mismatch) && this.getMatchingCode() === CODES.WRONG_VALUE) {
|
|
1749
|
+
this.setMatchingCode(CODES.OK);
|
|
1750
1750
|
}
|
|
1751
1751
|
}
|
|
1752
1752
|
getChoice() {
|
|
@@ -1832,19 +1832,19 @@ class CardinalityTracker {
|
|
|
1832
1832
|
}
|
|
1833
1833
|
setDepsOk(ok) {
|
|
1834
1834
|
if (this._depsOk !== ok) {
|
|
1835
|
-
this._code =
|
|
1835
|
+
this._code = CODES.UNKNOWN;
|
|
1836
1836
|
this._depsOk = ok;
|
|
1837
1837
|
this.cardinalityChanged();
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
1840
|
increment() {
|
|
1841
1841
|
this._counter += 1;
|
|
1842
|
-
this._code =
|
|
1842
|
+
this._code = CODES.UNKNOWN;
|
|
1843
1843
|
this._checkCounter();
|
|
1844
1844
|
}
|
|
1845
1845
|
decrement() {
|
|
1846
1846
|
this._counter -= 1;
|
|
1847
|
-
this._code =
|
|
1847
|
+
this._code = CODES.UNKNOWN;
|
|
1848
1848
|
this._checkCounter();
|
|
1849
1849
|
}
|
|
1850
1850
|
getCounter() {
|
|
@@ -1854,7 +1854,7 @@ class CardinalityTracker {
|
|
|
1854
1854
|
this._checkCounter();
|
|
1855
1855
|
}
|
|
1856
1856
|
touch() {
|
|
1857
|
-
this._code =
|
|
1857
|
+
this._code = CODES.UNKNOWN;
|
|
1858
1858
|
this.cardinalityChanged();
|
|
1859
1859
|
}
|
|
1860
1860
|
|
|
@@ -2396,7 +2396,7 @@ const _createTextItem = (parentBinding, item) => {
|
|
|
2396
2396
|
const groupURIBinding = new GroupURIBinding({
|
|
2397
2397
|
item,
|
|
2398
2398
|
statement: null,
|
|
2399
|
-
matchingCode:
|
|
2399
|
+
matchingCode: CODES.OK
|
|
2400
2400
|
});
|
|
2401
2401
|
parentBinding.addChildBinding(groupURIBinding);
|
|
2402
2402
|
return groupURIBinding;
|
|
@@ -2586,11 +2586,11 @@ const _matchGroupItem = (pb, item) => {
|
|
|
2586
2586
|
if (pMatch && ntMatch || _fuzzy) {
|
|
2587
2587
|
constStmts = _findStatementsForConstraints(graph, stmt.getValue(), item);
|
|
2588
2588
|
if (constStmts !== undefined || _fuzzy) {
|
|
2589
|
-
let matchingCode = !ntMatch ?
|
|
2589
|
+
let matchingCode = !ntMatch ? CODES.WRONG_NODETYPE : CODES.OK;
|
|
2590
2590
|
if (!pMatch) {
|
|
2591
|
-
matchingCode =
|
|
2591
|
+
matchingCode = CODES.WRONG_PATTERN;
|
|
2592
2592
|
} else if (constStmts === undefined) {
|
|
2593
|
-
matchingCode =
|
|
2593
|
+
matchingCode = CODES.MISSING_CONSTRAINTS;
|
|
2594
2594
|
}
|
|
2595
2595
|
_dibbs(stmt);
|
|
2596
2596
|
groupBinding = new GroupBinding({
|
|
@@ -2600,7 +2600,7 @@ const _matchGroupItem = (pb, item) => {
|
|
|
2600
2600
|
matchingCode
|
|
2601
2601
|
});
|
|
2602
2602
|
bindings.push(groupBinding);
|
|
2603
|
-
if (matchingCode ===
|
|
2603
|
+
if (matchingCode === CODES.OK) {
|
|
2604
2604
|
_matchGroupItemChildren(groupBinding); // Recursive call
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
@@ -2677,7 +2677,7 @@ const _matchTextItem = (pb, item) => {
|
|
|
2677
2677
|
bindings.push(new GroupURIBinding({
|
|
2678
2678
|
item,
|
|
2679
2679
|
statement: null,
|
|
2680
|
-
matchingCode:
|
|
2680
|
+
matchingCode: CODES.OK
|
|
2681
2681
|
}));
|
|
2682
2682
|
} else {
|
|
2683
2683
|
pb.getGraph().find(pb.getChildrenRootUri(), item.getProperty()).forEach(stmt => {
|
|
@@ -2686,9 +2686,9 @@ const _matchTextItem = (pb, item) => {
|
|
|
2686
2686
|
const dtMatch = _isDataTypeMatch(item, stmt);
|
|
2687
2687
|
if (ntMatch && (dtMatch || item.hasStyle('relaxedDatatypeMatch')) || _fuzzy) {
|
|
2688
2688
|
_dibbs(stmt);
|
|
2689
|
-
let matchingCode = ntMatch ?
|
|
2689
|
+
let matchingCode = ntMatch ? CODES.OK : CODES.WRONG_NODETYPE;
|
|
2690
2690
|
if (!dtMatch) {
|
|
2691
|
-
matchingCode =
|
|
2691
|
+
matchingCode = CODES.WRONG_DATATYPE;
|
|
2692
2692
|
}
|
|
2693
2693
|
bindings.push(new ValueBinding({
|
|
2694
2694
|
item,
|
|
@@ -2717,13 +2717,13 @@ const _matchChoiceItem = (pb, item) => {
|
|
|
2717
2717
|
const choice = _findChoice(item, stmt.getValue(), stmt.getGraph());
|
|
2718
2718
|
if (choice !== undefined) {
|
|
2719
2719
|
_dibbs(stmt);
|
|
2720
|
-
let matchingCode = !ntMatch ?
|
|
2720
|
+
let matchingCode = !ntMatch ? CODES.WRONG_NODETYPE : CODES.OK;
|
|
2721
2721
|
if (!dtMatch) {
|
|
2722
|
-
matchingCode =
|
|
2722
|
+
matchingCode = CODES.WRONG_DATATYPE;
|
|
2723
2723
|
} else if (!pMatch) {
|
|
2724
|
-
matchingCode =
|
|
2724
|
+
matchingCode = CODES.WRONG_PATTERN;
|
|
2725
2725
|
} else if (choice.mismatch) {
|
|
2726
|
-
matchingCode =
|
|
2726
|
+
matchingCode = CODES.WRONG_VALUE;
|
|
2727
2727
|
}
|
|
2728
2728
|
bindings.push(new ChoiceBinding({
|
|
2729
2729
|
item,
|
|
@@ -3224,7 +3224,7 @@ const detectLevel = profile => {
|
|
|
3224
3224
|
fuzzyMatch,
|
|
3225
3225
|
matchPathBelowBinding,
|
|
3226
3226
|
findBindingRelativeToParentBinding,
|
|
3227
|
-
CODES:
|
|
3227
|
+
CODES: CODES
|
|
3228
3228
|
});
|
|
3229
3229
|
;// ./src/template/ItemStore.js
|
|
3230
3230
|
|
|
@@ -3662,11 +3662,12 @@ const registerBundles = (itemStore, bundles = []) => bundles.map(bundle => itemS
|
|
|
3662
3662
|
return registeredBundles;
|
|
3663
3663
|
});
|
|
3664
3664
|
;// ./src/model/validate.js
|
|
3665
|
+
/* unused harmony import specifier */ var validate_CODES;
|
|
3665
3666
|
|
|
3666
3667
|
|
|
3667
3668
|
|
|
3668
3669
|
const _clearMatchingCodes = binding => {
|
|
3669
|
-
binding.setMatchingCode(
|
|
3670
|
+
binding.setMatchingCode(validate_CODES.OK);
|
|
3670
3671
|
if (binding.getItem().getType() === 'group') {
|
|
3671
3672
|
binding.getChildBindings().forEach(childBinding => _clearMatchingCodes(childBinding));
|
|
3672
3673
|
}
|
|
@@ -3739,7 +3740,7 @@ const doNotProceedFurther = (groupBinding, childItem) => {
|
|
|
3739
3740
|
return false;
|
|
3740
3741
|
};
|
|
3741
3742
|
const _createReport = (groupbinding, report, firstLevel) => {
|
|
3742
|
-
if (groupbinding.getMatchingCode() !==
|
|
3743
|
+
if (groupbinding.getMatchingCode() !== CODES.OK) {
|
|
3743
3744
|
return undefined;
|
|
3744
3745
|
}
|
|
3745
3746
|
const groupitem = groupbinding.getItem();
|
|
@@ -3763,11 +3764,11 @@ const _createReport = (groupbinding, report, firstLevel) => {
|
|
|
3763
3764
|
const nrOfValid = _countValidBindings(bindings);
|
|
3764
3765
|
let code;
|
|
3765
3766
|
if (nrOfValid > 1 && (groupitem.hasStyle('disjoint') || groupitem.hasStyle('atMostOneChild'))) {
|
|
3766
|
-
code =
|
|
3767
|
+
code = CODES.AT_MOST_ONE_CHILD;
|
|
3767
3768
|
} else if (nrOfValid !== 1 && groupitem.hasStyle('exactlyOneChild')) {
|
|
3768
|
-
code =
|
|
3769
|
+
code = CODES.EXACTLY_ONE_CHILD;
|
|
3769
3770
|
} else if (nrOfValid === 0 && groupitem.hasStyle('atLeastOneChild')) {
|
|
3770
|
-
code =
|
|
3771
|
+
code = CODES.AT_LEAST_ONE_CHILD;
|
|
3771
3772
|
}
|
|
3772
3773
|
if (code) {
|
|
3773
3774
|
updateViaCardinalityTracker([groupbinding], code);
|
|
@@ -3794,9 +3795,9 @@ const _createReport = (groupbinding, report, firstLevel) => {
|
|
|
3794
3795
|
report.errors.push({
|
|
3795
3796
|
parentBinding: groupbinding,
|
|
3796
3797
|
item: childItem,
|
|
3797
|
-
code:
|
|
3798
|
+
code: CODES.TOO_FEW_VALUES_MIN
|
|
3798
3799
|
});
|
|
3799
|
-
updateViaCardinalityTracker(bindings,
|
|
3800
|
+
updateViaCardinalityTracker(bindings, CODES.TOO_FEW_VALUES_MIN);
|
|
3800
3801
|
/* let counter = 0;
|
|
3801
3802
|
bindings.forEach((binding) => {
|
|
3802
3803
|
if (!binding.isValid()) {
|
|
@@ -3810,7 +3811,7 @@ const _createReport = (groupbinding, report, firstLevel) => {
|
|
|
3810
3811
|
report.warnings.push({
|
|
3811
3812
|
parentBinding: groupbinding,
|
|
3812
3813
|
item: childItem,
|
|
3813
|
-
code:
|
|
3814
|
+
code: CODES.TOO_FEW_VALUES_PREF
|
|
3814
3815
|
});
|
|
3815
3816
|
// updateViaCardinalityTracker(bindings, CODES.TOO_FEW_VALUES_PREF);
|
|
3816
3817
|
}
|
|
@@ -3818,9 +3819,9 @@ const _createReport = (groupbinding, report, firstLevel) => {
|
|
|
3818
3819
|
report.errors.push({
|
|
3819
3820
|
parentBinding: groupbinding,
|
|
3820
3821
|
item: childItem,
|
|
3821
|
-
code:
|
|
3822
|
+
code: CODES.TOO_MANY_VALUES
|
|
3822
3823
|
});
|
|
3823
|
-
updateViaCardinalityTracker(bindings,
|
|
3824
|
+
updateViaCardinalityTracker(bindings, CODES.TOO_MANY_VALUES);
|
|
3824
3825
|
/* let counter = 0;
|
|
3825
3826
|
bindings.forEach((binding) => {
|
|
3826
3827
|
if (binding.isValid()) {
|
|
@@ -3836,7 +3837,7 @@ const _createReport = (groupbinding, report, firstLevel) => {
|
|
|
3836
3837
|
}
|
|
3837
3838
|
groupbinding.getChildBindings().forEach(binding => {
|
|
3838
3839
|
const item = binding.getItem();
|
|
3839
|
-
if (binding.getMatchingCode() !==
|
|
3840
|
+
if (binding.getMatchingCode() !== CODES.OK) {
|
|
3840
3841
|
report.errors.push({
|
|
3841
3842
|
parentBinding: binding,
|
|
3842
3843
|
item,
|