I’m implementing this:
http://opensource.adobe.com/spectrum-css/2.7.2/docs/#tabs---too-many 
<http://opensource.adobe.com/spectrum-css/2.7.2/docs/#tabs---too-many>

The current display is not the latest. In the current implementation, the 
dropdown is structured like this:
https://github.com/adobe/spectrum-css/blob/master/docs/tabs/tabs-toomany.yml 
<https://github.com/adobe/spectrum-css/blob/master/docs/tabs/tabs-toomany.yml>

While the normal structure is like this:
https://github.com/adobe/spectrum-css/blob/master/docs/tabs/tabs.yml 
<https://github.com/adobe/spectrum-css/blob/master/docs/tabs/tabs.yml>

The spectrum css requires a specific structure, so I can’t use media queries.

FWIW, [DefaultProperty] does what we want.

Thanks Alex,
Harbs

> On Jan 22, 2019, at 8:51 PM, Carlos Rovira <[email protected]> wrote:
> 
> Hi,
> 
> So if I understand right: You want a tabbar navigation that when the user
> goes to mobile or shrinks the browser changes the visual to a dropdown
> right?
> 
> For me the change should not happen at the level you are proposing. The
> component declaration in MXML is the same for both views (the data and
> structure), you only want to change representation.
> And for me that's in the realm of CSS with responsiveness. So doing a media
> query in CSS to arrange things in a way or another depending on the width
> of the browser window.
> 
> That's the same we do in Jewel for Drawer, NumericStepper, ComboBox, and
> more...
> 
> HTH
> 
> Carlos
> 
> 
> 
> El mar., 22 ene. 2019 a las 17:43, Alex Harui (<[email protected]>)
> escribió:
> 
>> The compiler supports a special property called mxmlContent that defers
>> the creation of the MXML tags assigned to that property until a bit later
>> in the lifecycle in order to try to make sure other properties are set up
>> before the children in the mxmlContent are.  All other mxml tags are
>> created at constructor time.  mxmlContent is the [DefaultProperty] of
>> Royale containers so instead having everyone type "mxmlContent" tags over
>> and over again, you just skip having to type "mxmlContent".
>> 
>> So, one option is to define other properties to hold other sets of
>> children.  They will be instantiated at constructor time, but you can store
>> them anywhere.  IMO, it is bad practice to store UI widgets in the model,
>> but some components have both a data model and a presentation model that
>> holds things that are about the view (DataGrid rowHeight for example) and
>> not about the data itself.
>> 
>> Another option is to think of this component like a Navigator like
>> ViewStack.  Then you'd have two containers in the mxmlContent, one that
>> holds the tabs or the tabbar itself and another that holds the "complex one
>> with a dropdown".
>> 
>> Yet another option is to think of it sort of like Panel.  Panel has both a
>> TitleBar and mxmlContent.  You can specify a completely different TitleBar
>> for a Panel.
>> 
>> HTH,
>> -Alex
>> 
>> On 1/22/19, 1:12 AM, "Harbs" <[email protected]> wrote:
>> 
>>    We are working on a component which has two (very different) views
>> depending on available space.
>> 
>>    I’d like to have some markup which would look like this:
>>    <foo:TabBar>
>>    <foo:Tab text=“Tab 1”/>
>>    <foo:Tab text=“Tab 2”/>
>>    <foo:Tab text=“Tab 3”/>
>>    <foo:Tab text=“Tab 4”/>
>>    </foo:TabBar>
>> 
>>    The internal structure would change from a relatively simple one to a
>> complex one with a dropdown when there’s little space.
>> 
>>    I’d like to have a TabModel which would have an array of the tabs
>> specified. I’d have a separate view which is responsible for actually
>> adding the elements. My question is how to have the MXML children added to
>> the model instead of the default behavior where they are added as elements.
>> 
>>    Thanks,
>>    Harbs
>> 
>> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira

Reply via email to