@thatopen/components 3.2.0 → 3.2.1

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/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;
@@ -21015,7 +21015,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21015
21015
  *
21016
21016
  * @returns An array of IDSSpecification instances created from the parsed data.
21017
21017
  */
21018
- load(data) {
21018
+ load(data, config = { parseNumericString: true }) {
21019
21019
  const result = [];
21020
21020
  const ids = _IDSSpecifications.xmlParser.parse(data).ids;
21021
21021
  const { specifications } = ids;
@@ -21054,7 +21054,11 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21054
21054
  applicabilities.push(...facets2);
21055
21055
  }
21056
21056
  if (facetName === "property") {
21057
- const facets2 = createPropertyFacets(this.components, elements);
21057
+ const facets2 = createPropertyFacets(
21058
+ this.components,
21059
+ elements,
21060
+ config.parseNumericString
21061
+ );
21058
21062
  applicabilities.push(...facets2);
21059
21063
  }
21060
21064
  if (facetName === "partOf") {
@@ -21092,7 +21096,11 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21092
21096
  reqs.push(...facets2);
21093
21097
  }
21094
21098
  if (facetName === "property") {
21095
- const facets2 = createPropertyFacets(this.components, elements);
21099
+ const facets2 = createPropertyFacets(
21100
+ this.components,
21101
+ elements,
21102
+ config.parseNumericString
21103
+ );
21096
21104
  reqs.push(...facets2);
21097
21105
  }
21098
21106
  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.0",
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.1",
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
+ }