@almadar/ui 2.11.4 → 2.11.5
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 +8 -1
- package/package.json +1 -1
package/dist/runtime/index.js
CHANGED
|
@@ -193,7 +193,14 @@ function useTraitStateMachine(traitBindings, slotsActions, options) {
|
|
|
193
193
|
);
|
|
194
194
|
const linkedEntity = binding.linkedEntity || "";
|
|
195
195
|
const entityId = payload?.entityId;
|
|
196
|
-
const entityData =
|
|
196
|
+
const entityData = (() => {
|
|
197
|
+
if (!linkedEntity || !fetchedDataContext) return payload || {};
|
|
198
|
+
if (entityId) {
|
|
199
|
+
return fetchedDataContext.getById(linkedEntity, entityId) || {};
|
|
200
|
+
}
|
|
201
|
+
const records = fetchedDataContext.getData(linkedEntity);
|
|
202
|
+
return records[0] || payload || {};
|
|
203
|
+
})();
|
|
197
204
|
const pendingSlots = /* @__PURE__ */ new Map();
|
|
198
205
|
const slotSource = {
|
|
199
206
|
trait: binding.trait.name,
|