@almadar/ui 2.9.1 → 2.9.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/dist/runtime/index.js +7 -2
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -184,9 +184,14 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
184
184
|
notify: optionsRef.current?.notify,
|
|
185
185
|
enrichPattern: (pattern) => {
|
|
186
186
|
const patternType = pattern?.type;
|
|
187
|
-
if (
|
|
187
|
+
if (patternType && isEntityAwarePattern(patternType) && fetchedDataContext) {
|
|
188
188
|
const patternRecord = pattern;
|
|
189
|
-
if (
|
|
189
|
+
if (typeof patternRecord.entity === "string") {
|
|
190
|
+
const records = fetchedDataContext.getData(patternRecord.entity);
|
|
191
|
+
if (records.length > 0) {
|
|
192
|
+
return { type: patternType, ...patternRecord, entity: records };
|
|
193
|
+
}
|
|
194
|
+
} else if (!patternRecord.entity && linkedEntity) {
|
|
190
195
|
const records = fetchedDataContext.getData(linkedEntity);
|
|
191
196
|
if (records.length > 0) {
|
|
192
197
|
return { type: patternType, ...patternRecord, entity: records };
|