From f94d01c93dcb5cdd4e76abcd9229940b7578a9a2 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 30 Nov 2021 13:11:26 +0100 Subject: [PATCH] Split values in multiple props --- src/style_manager/index.js | 10 +++++++++- src/style_manager/model/PropertyComposite.js | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 8eb7c4e94..9f236ebc8 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -566,7 +566,15 @@ export default () => { sectors.map(sector => { sector.getProperties().map(prop => { - this.__upProp(prop, style, parentStyles, opts); + const props = prop.getProperties?.(); + if (props /*&& prop.isDetached?.()*/) { + const fromStyle = prop.get('fromStyle'); + // TODO parentStyles should be as newStyle + const newStyle = fromStyle ? fromStyle(style) : style; + props.forEach(prop => this.__upProp(prop, newStyle, parentStyles, opts)); + } else { + this.__upProp(prop, style, parentStyles, opts); + } }); }); }, diff --git a/src/style_manager/model/PropertyComposite.js b/src/style_manager/model/PropertyComposite.js index b100bae5e..0d78ba3f7 100644 --- a/src/style_manager/model/PropertyComposite.js +++ b/src/style_manager/model/PropertyComposite.js @@ -118,6 +118,10 @@ export default Property.extend({ return this.get('properties').at(index); }, + isDetached() { + return !!this.get('detached'); + }, + getProperties() { return [...this.get('properties').models]; },