Browse Source

make layrable as false

dynamic-values-improvements
mohamedsalem401 10 months ago
parent
commit
cee61b8fd3
  1. 7
      packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts
  2. 2
      packages/core/src/dom_components/model/ComponentDataResolverWatchers.ts

7
packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts

@ -169,6 +169,7 @@ export default class ComponentDataCollection extends Component {
private getCollectionItems() {
const firstChild = this.ensureFirstChild();
const initialDisplayValue = firstChild.getStyle()['display'] ?? '';
// TODO: Move to component view
firstChild.addStyle({ display: 'none' }, AvoidStoreOptions);
const components: Component[] = [firstChild];
@ -200,13 +201,13 @@ export default class ComponentDataCollection extends Component {
setCollectionStateMapAndPropagate(firstChild, collectionsStateMap);
// TODO: Move to component view
firstChild.addStyle({ display: '' }, AvoidStoreOptions);
firstChild.addStyle({ display: initialDisplayValue }, AvoidStoreOptions);
continue;
}
const instance = firstChild!.clone({ symbol: true, symbolInv: true });
instance.set('locked', true, AvoidStoreOptions);
instance.set({ locked: true, layerable: false }, AvoidStoreOptions);
setCollectionStateMapAndPropagate(instance, collectionsStateMap);
components.push(instance);
}
@ -335,7 +336,7 @@ export default class ComponentDataCollection extends Component {
}
function setCollectionStateMapAndPropagate(cmp: Component, collectionsStateMap: DataCollectionStateMap) {
cmp.setSymbolOverride(['locked']);
cmp.setSymbolOverride(['locked', 'layerable']);
cmp.syncComponentsCollectionState();
cmp.onCollectionsStateMapUpdate(collectionsStateMap);
}

2
packages/core/src/dom_components/model/ComponentDataResolverWatchers.ts

@ -72,7 +72,7 @@ export class ComponentDataResolverWatchers {
const keys = this.propertyWatcher.getValuesResolvingFromCollections();
const attributesKeys = this.attributeWatcher.getValuesResolvingFromCollections();
const combinedKeys = ['locked', ...keys];
const combinedKeys = ['locked', 'layerable', ...keys];
const haveOverridenAttributes = Object.keys(attributesKeys).length;
if (haveOverridenAttributes) combinedKeys.push('attributes');

Loading…
Cancel
Save