@thatopen/components 3.1.4 → 3.1.5
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 +0 -16
- package/dist/index.cjs +32 -12
- package/dist/index.d.ts +19 -7
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +1 -1
- package/dist/index.mjs +32 -12
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -19561,7 +19561,7 @@ class IDSFacet {
|
|
|
19561
19561
|
checks.push(check);
|
|
19562
19562
|
}
|
|
19563
19563
|
}
|
|
19564
|
-
getItemChecks(collector, modelId, item) {
|
|
19564
|
+
getItemChecks(collector, modelId, item, skipIfFails) {
|
|
19565
19565
|
if (!("value" in item._localId && typeof item._localId.value === "number")) {
|
|
19566
19566
|
return null;
|
|
19567
19567
|
}
|
|
@@ -19571,7 +19571,7 @@ class IDSFacet {
|
|
|
19571
19571
|
collector.set(modelId, modelItemResults);
|
|
19572
19572
|
}
|
|
19573
19573
|
let result = modelItemResults.get(item._localId.value);
|
|
19574
|
-
if (result) {
|
|
19574
|
+
if (result && skipIfFails) {
|
|
19575
19575
|
if (!result.pass)
|
|
19576
19576
|
return null;
|
|
19577
19577
|
} else {
|
|
@@ -19717,7 +19717,7 @@ class IDSAttribute extends IDSFacet {
|
|
|
19717
19717
|
// Test cases from buildingSMART repo have been tested and they all match with the expected result
|
|
19718
19718
|
// All invalid cases have been treated as failures
|
|
19719
19719
|
// FragmentsGroup do not hold some of the entities used in the tests
|
|
19720
|
-
async test(items, collector) {
|
|
19720
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
19721
19721
|
const fragments = this._components.get(FragmentsManager);
|
|
19722
19722
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
19723
19723
|
const model = fragments.list.get(modelId);
|
|
@@ -19725,7 +19725,12 @@ class IDSAttribute extends IDSFacet {
|
|
|
19725
19725
|
continue;
|
|
19726
19726
|
const data = await model.getItemsData([...localIds]);
|
|
19727
19727
|
for (const item of data) {
|
|
19728
|
-
const checks = this.getItemChecks(
|
|
19728
|
+
const checks = this.getItemChecks(
|
|
19729
|
+
collector,
|
|
19730
|
+
modelId,
|
|
19731
|
+
item,
|
|
19732
|
+
config.skipIfFails
|
|
19733
|
+
);
|
|
19729
19734
|
if (!checks)
|
|
19730
19735
|
continue;
|
|
19731
19736
|
const attrNames = Object.keys(item);
|
|
@@ -20050,7 +20055,7 @@ class IDSEntity extends IDSFacet {
|
|
|
20050
20055
|
}
|
|
20051
20056
|
}
|
|
20052
20057
|
}
|
|
20053
|
-
async test(items, collector) {
|
|
20058
|
+
async test(items, collector, config) {
|
|
20054
20059
|
const fragments = this._components.get(FragmentsManager);
|
|
20055
20060
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20056
20061
|
const model = fragments.list.get(modelId);
|
|
@@ -20060,7 +20065,12 @@ class IDSEntity extends IDSFacet {
|
|
|
20060
20065
|
for (const item of data) {
|
|
20061
20066
|
if (!("value" in item._category))
|
|
20062
20067
|
continue;
|
|
20063
|
-
const checks = this.getItemChecks(
|
|
20068
|
+
const checks = this.getItemChecks(
|
|
20069
|
+
collector,
|
|
20070
|
+
modelId,
|
|
20071
|
+
item,
|
|
20072
|
+
config.skipIfFails
|
|
20073
|
+
);
|
|
20064
20074
|
if (!checks)
|
|
20065
20075
|
continue;
|
|
20066
20076
|
await this.evalName(item._category.value, checks);
|
|
@@ -20242,7 +20252,7 @@ class IDSProperty extends IDSFacet {
|
|
|
20242
20252
|
}
|
|
20243
20253
|
}
|
|
20244
20254
|
}
|
|
20245
|
-
async test(items, collector) {
|
|
20255
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
20246
20256
|
const fragments = this._components.get(FragmentsManager);
|
|
20247
20257
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20248
20258
|
const model = fragments.list.get(modelId);
|
|
@@ -20257,7 +20267,12 @@ class IDSProperty extends IDSFacet {
|
|
|
20257
20267
|
}
|
|
20258
20268
|
});
|
|
20259
20269
|
for (const item of data) {
|
|
20260
|
-
const checks = this.getItemChecks(
|
|
20270
|
+
const checks = this.getItemChecks(
|
|
20271
|
+
collector,
|
|
20272
|
+
modelId,
|
|
20273
|
+
item,
|
|
20274
|
+
config.skipIfFails
|
|
20275
|
+
);
|
|
20261
20276
|
if (!checks)
|
|
20262
20277
|
continue;
|
|
20263
20278
|
const sets = await this.getPsets(item);
|
|
@@ -20534,7 +20549,7 @@ class IDSMaterial extends IDSFacet {
|
|
|
20534
20549
|
}
|
|
20535
20550
|
}
|
|
20536
20551
|
}
|
|
20537
|
-
async test(items, collector) {
|
|
20552
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
20538
20553
|
const fragments = this._components.get(FragmentsManager);
|
|
20539
20554
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20540
20555
|
const model = fragments.list.get(modelId);
|
|
@@ -20551,7 +20566,12 @@ class IDSMaterial extends IDSFacet {
|
|
|
20551
20566
|
}
|
|
20552
20567
|
});
|
|
20553
20568
|
for (const item of data) {
|
|
20554
|
-
const checks = this.getItemChecks(
|
|
20569
|
+
const checks = this.getItemChecks(
|
|
20570
|
+
collector,
|
|
20571
|
+
modelId,
|
|
20572
|
+
item,
|
|
20573
|
+
config.skipIfFails
|
|
20574
|
+
);
|
|
20555
20575
|
if (!checks)
|
|
20556
20576
|
continue;
|
|
20557
20577
|
if (!Array.isArray(item.HasAssociations)) {
|
|
@@ -20717,7 +20737,7 @@ class IDSSpecification {
|
|
|
20717
20737
|
* @returns An array representing the test results.
|
|
20718
20738
|
* If no requirements are defined for the specification, an empty array is returned.
|
|
20719
20739
|
*/
|
|
20720
|
-
async test(modelIds) {
|
|
20740
|
+
async test(modelIds, config = { skipIfFails: true }) {
|
|
20721
20741
|
const result = new FRAGS.DataMap();
|
|
20722
20742
|
if (this.requirements.size === 0)
|
|
20723
20743
|
return result;
|
|
@@ -20729,7 +20749,7 @@ class IDSSpecification {
|
|
|
20729
20749
|
await Promise.all(applicabilityPromises);
|
|
20730
20750
|
const requirementPromises = [];
|
|
20731
20751
|
for (const requirement of this.requirements) {
|
|
20732
|
-
requirementPromises.push(requirement.test(entities, result));
|
|
20752
|
+
requirementPromises.push(requirement.test(entities, result, config));
|
|
20733
20753
|
}
|
|
20734
20754
|
await Promise.all(requirementPromises);
|
|
20735
20755
|
return result;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thatopen/components",
|
|
3
3
|
"description": "Collection of core functionalities to author BIM apps.",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.5",
|
|
5
5
|
"author": "That Open Company",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
|
|
8
8
|
"Juan Hoyos (https://github.com/HoyosJuan)",
|
|
9
|
-
"Harry Collin (https://github.com/harrycollin)"
|
|
9
|
+
"Harry Collin (https://github.com/harrycollin)",
|
|
10
|
+
"Pablo Aguilar (https://github.com/pabloaguilarv"
|
|
10
11
|
],
|
|
11
12
|
"license": "MIT",
|
|
12
13
|
"homepage": "https://github.com/ThatOpen/engine_components/tree/main/packages/components#readme",
|