@thatopen/components 3.2.5 → 3.2.6

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
@@ -3540,8 +3540,8 @@ const _IfcLoader = class _IfcLoader extends Component {
3540
3540
  * Loads an IFC file and processes it for 3D visualization.
3541
3541
  *
3542
3542
  * @param data - The Uint8Array containing the IFC file data.
3543
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
3544
- * @param name - Optional name for the fragments model.
3543
+ * @param coordinate - Boolean indicating whether to coordinate the loaded IFC data. Default is true.
3544
+ * @param name - Name for the fragments model.
3545
3545
  * @param config - Optional extra data for loading the IFC.
3546
3546
  *
3547
3547
  * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data.
@@ -17624,6 +17624,7 @@ const _Clipper = class _Clipper extends Component {
17624
17624
  plane.world.renderer.setPlane(false, plane.three);
17625
17625
  plane.dispose();
17626
17626
  this.updateMaterialsAndPlanes();
17627
+ this.onAfterDelete.trigger(plane);
17627
17628
  });
17628
17629
  }
17629
17630
  /** {@link Disposable.dispose} */
@@ -20802,7 +20803,7 @@ class IDSSpecification {
20802
20803
  return xml;
20803
20804
  }
20804
20805
  }
20805
- const getParameterValue = (property, parseNumericString = true) => {
20806
+ const getParameterValue = (property) => {
20806
20807
  if (!property)
20807
20808
  return void 0;
20808
20809
  const result = {};
@@ -20820,7 +20821,13 @@ const getParameterValue = (property, parseNumericString = true) => {
20820
20821
  if ("enumeration" in restriction) {
20821
20822
  result.type = "enumeration";
20822
20823
  const enumeration = restriction.enumeration.map(
20823
- ({ value }) => parseNumericString ? value : String(value)
20824
+ ({ value }) => {
20825
+ if (restriction.base.includes("string"))
20826
+ return String(value);
20827
+ if (restriction.base.includes("integer") || restriction.base.includes("double"))
20828
+ return Number(value);
20829
+ return value;
20830
+ }
20824
20831
  );
20825
20832
  result.parameter = enumeration;
20826
20833
  }
@@ -20914,19 +20921,19 @@ const createMaterialFacets = (components, elements) => {
20914
20921
  }
20915
20922
  return facets;
20916
20923
  };
20917
- const createPropertyFacets = (components, elements, parseNumericString) => {
20924
+ const createPropertyFacets = (components, elements) => {
20918
20925
  const facets = [];
20919
20926
  for (const element of elements) {
20920
20927
  const psetParameter = element.propertySet;
20921
20928
  const baseNameParameter = element.baseName;
20922
- const pset = getParameterValue(psetParameter, parseNumericString);
20923
- const baseName = getParameterValue(baseNameParameter, parseNumericString);
20929
+ const pset = getParameterValue(psetParameter);
20930
+ const baseName = getParameterValue(baseNameParameter);
20924
20931
  if (!(baseName && pset))
20925
20932
  continue;
20926
20933
  const facet = new IDSProperty(components, pset, baseName);
20927
20934
  if (element.cardinality)
20928
20935
  facet.cardinality = element.cardinality;
20929
- const value = getParameterValue(element.value, parseNumericString);
20936
+ const value = getParameterValue(element.value);
20930
20937
  facet.value = value;
20931
20938
  facet.dataType = element.dataType;
20932
20939
  facet.uri = element.uri;
@@ -21037,7 +21044,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21037
21044
  *
21038
21045
  * @returns An array of IDSSpecification instances created from the parsed data.
21039
21046
  */
21040
- load(data, config = { parseNumericString: true }) {
21047
+ load(data) {
21041
21048
  const result = [];
21042
21049
  const ids = _IDSSpecifications.xmlParser.parse(data).ids;
21043
21050
  const { specifications, info } = ids;
@@ -21077,11 +21084,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21077
21084
  applicabilities.push(...facets2);
21078
21085
  }
21079
21086
  if (facetName === "property") {
21080
- const facets2 = createPropertyFacets(
21081
- this.components,
21082
- elements,
21083
- config.parseNumericString
21084
- );
21087
+ const facets2 = createPropertyFacets(this.components, elements);
21085
21088
  applicabilities.push(...facets2);
21086
21089
  }
21087
21090
  if (facetName === "partOf") {
@@ -21119,11 +21122,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21119
21122
  reqs.push(...facets2);
21120
21123
  }
21121
21124
  if (facetName === "property") {
21122
- const facets2 = createPropertyFacets(
21123
- this.components,
21124
- elements,
21125
- config.parseNumericString
21126
- );
21125
+ const facets2 = createPropertyFacets(this.components, elements);
21127
21126
  reqs.push(...facets2);
21128
21127
  }
21129
21128
  if (facetName === "partOf") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@thatopen/components",
3
3
  "description": "Collection of core functionalities to author BIM apps.",
4
- "version": "3.2.5",
4
+ "version": "3.2.6",
5
5
  "author": "That Open Company",
6
6
  "contributors": [
7
7
  "Antonio Gonzalez Viegas (https://github.com/agviegas)",