@thatopen/components 3.1.3 → 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 +33 -12
- package/dist/index.d.ts +19 -7
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +2 -2
- package/dist/index.mjs +33 -12
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -3543,6 +3543,7 @@ const _IfcLoader = class _IfcLoader extends Component {
|
|
|
3543
3543
|
const serializer = new FRAGS.IfcImporter();
|
|
3544
3544
|
serializer.wasm.path = this.settings.wasm.path;
|
|
3545
3545
|
serializer.wasm.absolute = this.settings.wasm.absolute;
|
|
3546
|
+
serializer.webIfcSettings = this.settings.webIfc;
|
|
3546
3547
|
if (config == null ? void 0 : config.instanceCallback)
|
|
3547
3548
|
config.instanceCallback(serializer);
|
|
3548
3549
|
const bytes = await serializer.process({
|
|
@@ -19560,7 +19561,7 @@ class IDSFacet {
|
|
|
19560
19561
|
checks.push(check);
|
|
19561
19562
|
}
|
|
19562
19563
|
}
|
|
19563
|
-
getItemChecks(collector, modelId, item) {
|
|
19564
|
+
getItemChecks(collector, modelId, item, skipIfFails) {
|
|
19564
19565
|
if (!("value" in item._localId && typeof item._localId.value === "number")) {
|
|
19565
19566
|
return null;
|
|
19566
19567
|
}
|
|
@@ -19570,7 +19571,7 @@ class IDSFacet {
|
|
|
19570
19571
|
collector.set(modelId, modelItemResults);
|
|
19571
19572
|
}
|
|
19572
19573
|
let result = modelItemResults.get(item._localId.value);
|
|
19573
|
-
if (result) {
|
|
19574
|
+
if (result && skipIfFails) {
|
|
19574
19575
|
if (!result.pass)
|
|
19575
19576
|
return null;
|
|
19576
19577
|
} else {
|
|
@@ -19716,7 +19717,7 @@ class IDSAttribute extends IDSFacet {
|
|
|
19716
19717
|
// Test cases from buildingSMART repo have been tested and they all match with the expected result
|
|
19717
19718
|
// All invalid cases have been treated as failures
|
|
19718
19719
|
// FragmentsGroup do not hold some of the entities used in the tests
|
|
19719
|
-
async test(items, collector) {
|
|
19720
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
19720
19721
|
const fragments = this._components.get(FragmentsManager);
|
|
19721
19722
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
19722
19723
|
const model = fragments.list.get(modelId);
|
|
@@ -19724,7 +19725,12 @@ class IDSAttribute extends IDSFacet {
|
|
|
19724
19725
|
continue;
|
|
19725
19726
|
const data = await model.getItemsData([...localIds]);
|
|
19726
19727
|
for (const item of data) {
|
|
19727
|
-
const checks = this.getItemChecks(
|
|
19728
|
+
const checks = this.getItemChecks(
|
|
19729
|
+
collector,
|
|
19730
|
+
modelId,
|
|
19731
|
+
item,
|
|
19732
|
+
config.skipIfFails
|
|
19733
|
+
);
|
|
19728
19734
|
if (!checks)
|
|
19729
19735
|
continue;
|
|
19730
19736
|
const attrNames = Object.keys(item);
|
|
@@ -20049,7 +20055,7 @@ class IDSEntity extends IDSFacet {
|
|
|
20049
20055
|
}
|
|
20050
20056
|
}
|
|
20051
20057
|
}
|
|
20052
|
-
async test(items, collector) {
|
|
20058
|
+
async test(items, collector, config) {
|
|
20053
20059
|
const fragments = this._components.get(FragmentsManager);
|
|
20054
20060
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20055
20061
|
const model = fragments.list.get(modelId);
|
|
@@ -20059,7 +20065,12 @@ class IDSEntity extends IDSFacet {
|
|
|
20059
20065
|
for (const item of data) {
|
|
20060
20066
|
if (!("value" in item._category))
|
|
20061
20067
|
continue;
|
|
20062
|
-
const checks = this.getItemChecks(
|
|
20068
|
+
const checks = this.getItemChecks(
|
|
20069
|
+
collector,
|
|
20070
|
+
modelId,
|
|
20071
|
+
item,
|
|
20072
|
+
config.skipIfFails
|
|
20073
|
+
);
|
|
20063
20074
|
if (!checks)
|
|
20064
20075
|
continue;
|
|
20065
20076
|
await this.evalName(item._category.value, checks);
|
|
@@ -20241,7 +20252,7 @@ class IDSProperty extends IDSFacet {
|
|
|
20241
20252
|
}
|
|
20242
20253
|
}
|
|
20243
20254
|
}
|
|
20244
|
-
async test(items, collector) {
|
|
20255
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
20245
20256
|
const fragments = this._components.get(FragmentsManager);
|
|
20246
20257
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20247
20258
|
const model = fragments.list.get(modelId);
|
|
@@ -20256,7 +20267,12 @@ class IDSProperty extends IDSFacet {
|
|
|
20256
20267
|
}
|
|
20257
20268
|
});
|
|
20258
20269
|
for (const item of data) {
|
|
20259
|
-
const checks = this.getItemChecks(
|
|
20270
|
+
const checks = this.getItemChecks(
|
|
20271
|
+
collector,
|
|
20272
|
+
modelId,
|
|
20273
|
+
item,
|
|
20274
|
+
config.skipIfFails
|
|
20275
|
+
);
|
|
20260
20276
|
if (!checks)
|
|
20261
20277
|
continue;
|
|
20262
20278
|
const sets = await this.getPsets(item);
|
|
@@ -20533,7 +20549,7 @@ class IDSMaterial extends IDSFacet {
|
|
|
20533
20549
|
}
|
|
20534
20550
|
}
|
|
20535
20551
|
}
|
|
20536
|
-
async test(items, collector) {
|
|
20552
|
+
async test(items, collector, config = { skipIfFails: true }) {
|
|
20537
20553
|
const fragments = this._components.get(FragmentsManager);
|
|
20538
20554
|
for (const [modelId, localIds] of Object.entries(items)) {
|
|
20539
20555
|
const model = fragments.list.get(modelId);
|
|
@@ -20550,7 +20566,12 @@ class IDSMaterial extends IDSFacet {
|
|
|
20550
20566
|
}
|
|
20551
20567
|
});
|
|
20552
20568
|
for (const item of data) {
|
|
20553
|
-
const checks = this.getItemChecks(
|
|
20569
|
+
const checks = this.getItemChecks(
|
|
20570
|
+
collector,
|
|
20571
|
+
modelId,
|
|
20572
|
+
item,
|
|
20573
|
+
config.skipIfFails
|
|
20574
|
+
);
|
|
20554
20575
|
if (!checks)
|
|
20555
20576
|
continue;
|
|
20556
20577
|
if (!Array.isArray(item.HasAssociations)) {
|
|
@@ -20716,7 +20737,7 @@ class IDSSpecification {
|
|
|
20716
20737
|
* @returns An array representing the test results.
|
|
20717
20738
|
* If no requirements are defined for the specification, an empty array is returned.
|
|
20718
20739
|
*/
|
|
20719
|
-
async test(modelIds) {
|
|
20740
|
+
async test(modelIds, config = { skipIfFails: true }) {
|
|
20720
20741
|
const result = new FRAGS.DataMap();
|
|
20721
20742
|
if (this.requirements.size === 0)
|
|
20722
20743
|
return result;
|
|
@@ -20728,7 +20749,7 @@ class IDSSpecification {
|
|
|
20728
20749
|
await Promise.all(applicabilityPromises);
|
|
20729
20750
|
const requirementPromises = [];
|
|
20730
20751
|
for (const requirement of this.requirements) {
|
|
20731
|
-
requirementPromises.push(requirement.test(entities, result));
|
|
20752
|
+
requirementPromises.push(requirement.test(entities, result, config));
|
|
20732
20753
|
}
|
|
20733
20754
|
await Promise.all(requirementPromises);
|
|
20734
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",
|