@thatopen/components 3.2.0 → 3.2.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/README.md +76 -76
- package/dist/index.cjs +20 -10
- package/dist/index.d.ts +4 -1
- package/dist/index.min.cjs +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.mjs +20 -10
- package/package.json +59 -59
package/dist/index.mjs
CHANGED
|
@@ -20781,7 +20781,7 @@ class IDSSpecification {
|
|
|
20781
20781
|
return xml;
|
|
20782
20782
|
}
|
|
20783
20783
|
}
|
|
20784
|
-
const getParameterValue = (property) => {
|
|
20784
|
+
const getParameterValue = (property, parseNumericString = true) => {
|
|
20785
20785
|
if (!property)
|
|
20786
20786
|
return void 0;
|
|
20787
20787
|
const result = {};
|
|
@@ -20799,7 +20799,7 @@ const getParameterValue = (property) => {
|
|
|
20799
20799
|
if ("enumeration" in restriction) {
|
|
20800
20800
|
result.type = "enumeration";
|
|
20801
20801
|
const enumeration = restriction.enumeration.map(
|
|
20802
|
-
({ value }) => value
|
|
20802
|
+
({ value }) => parseNumericString ? value : String(value)
|
|
20803
20803
|
);
|
|
20804
20804
|
result.parameter = enumeration;
|
|
20805
20805
|
}
|
|
@@ -20893,19 +20893,19 @@ const createMaterialFacets = (components, elements) => {
|
|
|
20893
20893
|
}
|
|
20894
20894
|
return facets;
|
|
20895
20895
|
};
|
|
20896
|
-
const createPropertyFacets = (components, elements) => {
|
|
20896
|
+
const createPropertyFacets = (components, elements, parseNumericString) => {
|
|
20897
20897
|
const facets = [];
|
|
20898
20898
|
for (const element of elements) {
|
|
20899
20899
|
const psetParameter = element.propertySet;
|
|
20900
20900
|
const baseNameParameter = element.baseName;
|
|
20901
|
-
const pset = getParameterValue(psetParameter);
|
|
20902
|
-
const baseName = getParameterValue(baseNameParameter);
|
|
20901
|
+
const pset = getParameterValue(psetParameter, parseNumericString);
|
|
20902
|
+
const baseName = getParameterValue(baseNameParameter, parseNumericString);
|
|
20903
20903
|
if (!(baseName && pset))
|
|
20904
20904
|
continue;
|
|
20905
20905
|
const facet = new IDSProperty(components, pset, baseName);
|
|
20906
20906
|
if (element.cardinality)
|
|
20907
20907
|
facet.cardinality = element.cardinality;
|
|
20908
|
-
const value = getParameterValue(element.value);
|
|
20908
|
+
const value = getParameterValue(element.value, parseNumericString);
|
|
20909
20909
|
facet.value = value;
|
|
20910
20910
|
facet.dataType = element.dataType;
|
|
20911
20911
|
facet.uri = element.uri;
|
|
@@ -20963,6 +20963,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
|
|
|
20963
20963
|
constructor(components) {
|
|
20964
20964
|
super(components);
|
|
20965
20965
|
__publicField(this, "enabled", true);
|
|
20966
|
+
__publicField(this, "IDSInfo");
|
|
20966
20967
|
__publicField(this, "list", new DataMap());
|
|
20967
20968
|
components.add(_IDSSpecifications.uuid, this);
|
|
20968
20969
|
}
|
|
@@ -21015,10 +21016,11 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
|
|
|
21015
21016
|
*
|
|
21016
21017
|
* @returns An array of IDSSpecification instances created from the parsed data.
|
|
21017
21018
|
*/
|
|
21018
|
-
load(data) {
|
|
21019
|
+
load(data, config = { parseNumericString: true }) {
|
|
21019
21020
|
const result = [];
|
|
21020
21021
|
const ids = _IDSSpecifications.xmlParser.parse(data).ids;
|
|
21021
|
-
const { specifications } = ids;
|
|
21022
|
+
const { specifications, info } = ids;
|
|
21023
|
+
this.IDSInfo = { ...info };
|
|
21022
21024
|
if (specifications && specifications.specification) {
|
|
21023
21025
|
const specs = Array.isArray(specifications.specification) ? specifications.specification : [specifications.specification];
|
|
21024
21026
|
for (const spec of specs) {
|
|
@@ -21054,7 +21056,11 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
|
|
|
21054
21056
|
applicabilities.push(...facets2);
|
|
21055
21057
|
}
|
|
21056
21058
|
if (facetName === "property") {
|
|
21057
|
-
const facets2 = createPropertyFacets(
|
|
21059
|
+
const facets2 = createPropertyFacets(
|
|
21060
|
+
this.components,
|
|
21061
|
+
elements,
|
|
21062
|
+
config.parseNumericString
|
|
21063
|
+
);
|
|
21058
21064
|
applicabilities.push(...facets2);
|
|
21059
21065
|
}
|
|
21060
21066
|
if (facetName === "partOf") {
|
|
@@ -21092,7 +21098,11 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
|
|
|
21092
21098
|
reqs.push(...facets2);
|
|
21093
21099
|
}
|
|
21094
21100
|
if (facetName === "property") {
|
|
21095
|
-
const facets2 = createPropertyFacets(
|
|
21101
|
+
const facets2 = createPropertyFacets(
|
|
21102
|
+
this.components,
|
|
21103
|
+
elements,
|
|
21104
|
+
config.parseNumericString
|
|
21105
|
+
);
|
|
21096
21106
|
reqs.push(...facets2);
|
|
21097
21107
|
}
|
|
21098
21108
|
if (facetName === "partOf") {
|
package/package.json
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@thatopen/components",
|
|
3
|
-
"description": "Collection of core functionalities to author BIM apps.",
|
|
4
|
-
"version": "3.2.
|
|
5
|
-
"author": "That Open Company",
|
|
6
|
-
"contributors": [
|
|
7
|
-
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
|
|
8
|
-
"Juan Hoyos (https://github.com/HoyosJuan)",
|
|
9
|
-
"Harry Collin (https://github.com/harrycollin)",
|
|
10
|
-
"Pablo Aguilar (https://github.com/pabloaguilarv"
|
|
11
|
-
],
|
|
12
|
-
"license": "MIT",
|
|
13
|
-
"homepage": "https://github.com/ThatOpen/engine_components/tree/main/packages/components#readme",
|
|
14
|
-
"bugs": {
|
|
15
|
-
"url": "https://github.com/ThatOpen/engine_components/issues"
|
|
16
|
-
},
|
|
17
|
-
"type": "module",
|
|
18
|
-
"main": "dist/index.cjs",
|
|
19
|
-
"module": "dist/index.mjs",
|
|
20
|
-
"types": "dist/index.d.ts",
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"README.md"
|
|
24
|
-
],
|
|
25
|
-
"repository": {
|
|
26
|
-
"type": "git",
|
|
27
|
-
"url": "git+https://github.com/ThatOpen/engine_components/tree/main/packages/components.git"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"dev": "vite --host",
|
|
31
|
-
"test": "jest",
|
|
32
|
-
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
33
|
-
"prepublishOnly": "node ./resources/updateComponentsVersion.mjs && yarn build",
|
|
34
|
-
"publish-repo": "npm publish"
|
|
35
|
-
},
|
|
36
|
-
"publishConfig": {
|
|
37
|
-
"access": "public"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@thatopen/fragments": "~3.2.0",
|
|
41
|
-
"@thatopen/ui": "~3.2.0",
|
|
42
|
-
"@types/convert-units": "2.3.11",
|
|
43
|
-
"@types/three": "0.175.0",
|
|
44
|
-
"stats.js": "^0.17.0",
|
|
45
|
-
"three": "^0.175.0",
|
|
46
|
-
"web-ifc": "0.0.72"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"camera-controls": "^2.9.0",
|
|
50
|
-
"fast-xml-parser": "4.4.1",
|
|
51
|
-
"jszip": "3.10.1",
|
|
52
|
-
"three-mesh-bvh": "0.7.0"
|
|
53
|
-
},
|
|
54
|
-
"peerDependencies": {
|
|
55
|
-
"@thatopen/fragments": "~3.2.0",
|
|
56
|
-
"three": ">=0.175.0",
|
|
57
|
-
"web-ifc": ">=0.0.72"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@thatopen/components",
|
|
3
|
+
"description": "Collection of core functionalities to author BIM apps.",
|
|
4
|
+
"version": "3.2.2",
|
|
5
|
+
"author": "That Open Company",
|
|
6
|
+
"contributors": [
|
|
7
|
+
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
|
|
8
|
+
"Juan Hoyos (https://github.com/HoyosJuan)",
|
|
9
|
+
"Harry Collin (https://github.com/harrycollin)",
|
|
10
|
+
"Pablo Aguilar (https://github.com/pabloaguilarv"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"homepage": "https://github.com/ThatOpen/engine_components/tree/main/packages/components#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/ThatOpen/engine_components/issues"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"main": "dist/index.cjs",
|
|
19
|
+
"module": "dist/index.mjs",
|
|
20
|
+
"types": "dist/index.d.ts",
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/ThatOpen/engine_components/tree/main/packages/components.git"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "vite --host",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
33
|
+
"prepublishOnly": "node ./resources/updateComponentsVersion.mjs && yarn build",
|
|
34
|
+
"publish-repo": "npm publish"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@thatopen/fragments": "~3.2.0",
|
|
41
|
+
"@thatopen/ui": "~3.2.0",
|
|
42
|
+
"@types/convert-units": "2.3.11",
|
|
43
|
+
"@types/three": "0.175.0",
|
|
44
|
+
"stats.js": "^0.17.0",
|
|
45
|
+
"three": "^0.175.0",
|
|
46
|
+
"web-ifc": "0.0.72"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"camera-controls": "^2.9.0",
|
|
50
|
+
"fast-xml-parser": "4.4.1",
|
|
51
|
+
"jszip": "3.10.1",
|
|
52
|
+
"three-mesh-bvh": "0.7.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@thatopen/fragments": "~3.2.0",
|
|
56
|
+
"three": ">=0.175.0",
|
|
57
|
+
"web-ifc": ">=0.0.72"
|
|
58
|
+
}
|
|
59
|
+
}
|