How to use the @bentley/presentation-components.ContentBuilder.createPropertyRecord function in @bentley/presentation-components

To help you get started, we’ve selected a few @bentley/presentation-components examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imodeljs / imodeljs / presentation / testing / src / ContentBuilder.ts View on Github external
if (!content)
      return [];

    const records: PropertyRecord[] = [];

    const sortedFields = content.descriptor.fields.sort((f1, f2) => {
      if (f1.name > f2.name)
        return -1;
      if (f1.name < f2.name)
        return 1;
      return 0;
    });

    for (const field of sortedFields) {
      for (const set of content.contentSet) {
        const record = PresentationContentBuilder.createPropertyRecord(field, set);
        records.push(record);
      }
    }

    return records;
  }