@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.cjs CHANGED
@@ -3559,8 +3559,8 @@ const _IfcLoader = class _IfcLoader extends Component {
3559
3559
  * Loads an IFC file and processes it for 3D visualization.
3560
3560
  *
3561
3561
  * @param data - The Uint8Array containing the IFC file data.
3562
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
3563
- * @param name - Optional name for the fragments model.
3562
+ * @param coordinate - Boolean indicating whether to coordinate the loaded IFC data. Default is true.
3563
+ * @param name - Name for the fragments model.
3564
3564
  * @param config - Optional extra data for loading the IFC.
3565
3565
  *
3566
3566
  * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data.
@@ -17643,6 +17643,7 @@ const _Clipper = class _Clipper extends Component {
17643
17643
  plane.world.renderer.setPlane(false, plane.three);
17644
17644
  plane.dispose();
17645
17645
  this.updateMaterialsAndPlanes();
17646
+ this.onAfterDelete.trigger(plane);
17646
17647
  });
17647
17648
  }
17648
17649
  /** {@link Disposable.dispose} */
@@ -20821,7 +20822,7 @@ class IDSSpecification {
20821
20822
  return xml;
20822
20823
  }
20823
20824
  }
20824
- const getParameterValue = (property, parseNumericString = true) => {
20825
+ const getParameterValue = (property) => {
20825
20826
  if (!property)
20826
20827
  return void 0;
20827
20828
  const result = {};
@@ -20839,7 +20840,13 @@ const getParameterValue = (property, parseNumericString = true) => {
20839
20840
  if ("enumeration" in restriction) {
20840
20841
  result.type = "enumeration";
20841
20842
  const enumeration = restriction.enumeration.map(
20842
- ({ value }) => parseNumericString ? value : String(value)
20843
+ ({ value }) => {
20844
+ if (restriction.base.includes("string"))
20845
+ return String(value);
20846
+ if (restriction.base.includes("integer") || restriction.base.includes("double"))
20847
+ return Number(value);
20848
+ return value;
20849
+ }
20843
20850
  );
20844
20851
  result.parameter = enumeration;
20845
20852
  }
@@ -20933,19 +20940,19 @@ const createMaterialFacets = (components, elements) => {
20933
20940
  }
20934
20941
  return facets;
20935
20942
  };
20936
- const createPropertyFacets = (components, elements, parseNumericString) => {
20943
+ const createPropertyFacets = (components, elements) => {
20937
20944
  const facets = [];
20938
20945
  for (const element of elements) {
20939
20946
  const psetParameter = element.propertySet;
20940
20947
  const baseNameParameter = element.baseName;
20941
- const pset = getParameterValue(psetParameter, parseNumericString);
20942
- const baseName = getParameterValue(baseNameParameter, parseNumericString);
20948
+ const pset = getParameterValue(psetParameter);
20949
+ const baseName = getParameterValue(baseNameParameter);
20943
20950
  if (!(baseName && pset))
20944
20951
  continue;
20945
20952
  const facet = new IDSProperty(components, pset, baseName);
20946
20953
  if (element.cardinality)
20947
20954
  facet.cardinality = element.cardinality;
20948
- const value = getParameterValue(element.value, parseNumericString);
20955
+ const value = getParameterValue(element.value);
20949
20956
  facet.value = value;
20950
20957
  facet.dataType = element.dataType;
20951
20958
  facet.uri = element.uri;
@@ -21056,7 +21063,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21056
21063
  *
21057
21064
  * @returns An array of IDSSpecification instances created from the parsed data.
21058
21065
  */
21059
- load(data, config = { parseNumericString: true }) {
21066
+ load(data) {
21060
21067
  const result = [];
21061
21068
  const ids = _IDSSpecifications.xmlParser.parse(data).ids;
21062
21069
  const { specifications, info } = ids;
@@ -21096,11 +21103,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21096
21103
  applicabilities.push(...facets2);
21097
21104
  }
21098
21105
  if (facetName === "property") {
21099
- const facets2 = createPropertyFacets(
21100
- this.components,
21101
- elements,
21102
- config.parseNumericString
21103
- );
21106
+ const facets2 = createPropertyFacets(this.components, elements);
21104
21107
  applicabilities.push(...facets2);
21105
21108
  }
21106
21109
  if (facetName === "partOf") {
@@ -21138,11 +21141,7 @@ const _IDSSpecifications = class _IDSSpecifications extends Component {
21138
21141
  reqs.push(...facets2);
21139
21142
  }
21140
21143
  if (facetName === "property") {
21141
- const facets2 = createPropertyFacets(
21142
- this.components,
21143
- elements,
21144
- config.parseNumericString
21145
- );
21144
+ const facets2 = createPropertyFacets(this.components, elements);
21146
21145
  reqs.push(...facets2);
21147
21146
  }
21148
21147
  if (facetName === "partOf") {
package/dist/index.d.ts CHANGED
@@ -2186,9 +2186,7 @@ export declare class IDSSpecifications extends Component {
2186
2186
  *
2187
2187
  * @returns An array of IDSSpecification instances created from the parsed data.
2188
2188
  */
2189
- load(data: string, config?: {
2190
- parseNumericString: boolean;
2191
- }): IDSSpecification[];
2189
+ load(data: string): IDSSpecification[];
2192
2190
  /**
2193
2191
  * Exports the IDSSpecifications data into an XML string.
2194
2192
  *
@@ -2289,8 +2287,8 @@ export declare class IfcLoader extends Component implements Disposable_2 {
2289
2287
  * Loads an IFC file and processes it for 3D visualization.
2290
2288
  *
2291
2289
  * @param data - The Uint8Array containing the IFC file data.
2292
- * @param coordinate - Optional boolean indicating whether to coordinate the loaded IFC data. Default is true.
2293
- * @param name - Optional name for the fragments model.
2290
+ * @param coordinate - Boolean indicating whether to coordinate the loaded IFC data. Default is true.
2291
+ * @param name - Name for the fragments model.
2294
2292
  * @param config - Optional extra data for loading the IFC.
2295
2293
  *
2296
2294
  * @returns A Promise that resolves to the FragmentsModel containing the loaded and processed IFC data.