Re: Experiment with UIBase change to classList

2018-03-12 Thread Alex Harui
Hi Carlos, classList was not used earlier because Arrays are cumbersome in MXML. In MXML, folks can add more than one class using space delimited list of strings: In AS, folks can delete classnames via: myLabel.className="SmallFont"; I don't believe your proposal takes these scenarios into a

Re: Experiment with UIBase change to classList

2018-03-12 Thread Piotr Zarzycki
Carlos, I don't see in your examples things which I've asked you in the previous thread. Let me ask you once again. Please test with your code following example. 1) Create custom style. .myCustomStyle { fontSize: 12px; /// some style whatever } 2. Set in your example Compile and check

Experiment with UIBase change to classList

2018-03-12 Thread Carlos Rovira
Hi, I made a branch from jewel branch to try UIBase for you to check (feature/uibase-classlist). My thinking is that classList simplifies all a lot since is a managed list with steroids that is made for you to use. I suppose that when FlexJS was started this API was not known or known but can't b

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi Piotr, don't worry that was some of things I worried so much when working on MDL, and for that reason I made most of the changes I did at that moment. In Jewel I'll be doing the same ;) 2018-03-12 19:34 GMT+01:00 Piotr Zarzycki : > Subclass, change it and remember to test as I pointed with so

Re: [royale-asjs] branch develop updated: Revert "Change order in computeClassNames to get typenames before classNames (just for organization purposes in html output)"

2018-03-12 Thread Carlos Rovira
Ok, Harbs, since I plan to subclass, maybe let the order as it was. I thought that will be adopted by all without much discussion, maybe take it in the subclass with the rest of changes in jewel and let you all see results thanks! 2018-03-12 20:12 GMT+01:00 Harbs : > FYI: My comment was on the b

Re: [royale-asjs] branch develop updated: Revert "Change order in computeClassNames to get typenames before classNames (just for organization purposes in html output)"

2018-03-12 Thread Harbs
FYI: My comment was on the bit in CSSClassList. I don’t have a strong opinion on the order of the class names. > On Mar 12, 2018, at 9:06 PM, carlosrov...@apache.org wrote: > > This is an automated email from the ASF dual-hosted git repository. > > carlosrovira pushed a commit to branch develop

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Piotr Zarzycki
Subclass, change it and remember to test as I pointed with some custom className setted in the example. See what happen. Looking forward to the results. Thanks, Piotr 2018-03-12 19:30 GMT+01:00 Carlos Rovira : > Hi Piotr, > subclass will be most to test the use of element.classList, a part from

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi Piotr, subclass will be most to test the use of element.classList, a part from the reverse order. I think element.classList will remove the need of much code in jewel components about how to setup classes in those components 2018-03-12 19:27 GMT+01:00 Piotr Zarzycki : > Since it is some kind o

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Piotr Zarzycki
Since it is some kind of exception which you are trying to resolve, you should create beads (layouts) which indicates resolution for that exception in their name. - At least that's how I think about PAYG. Btw. Sub classing UIBase to have an different order in className is a bit overkill to me. 20

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
HI Alex, ok, I think I'll be subclassing in my branch and see where I get, in this way the Piotr and Harbs can continue with things as they expect to. In the other way, maybe it could seem that I'm worried to much about how html looks, and maybe things like the layouts can wait, but I think is imp

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Alex Harui
Hi Carlos, These layout classes have worked fine for dozens of example. They are small, simple and stupid. I don't understand why, if you want vertical layout, you want to set a child's display to "inline-block". That would not layout vertically unless you are counting in line-wrapping. To me,

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi Alex, no, I want the normal effect of a vertical layout, since finaly is get in both ways. The problem for me is : 1) people that wants to change it must subclass layout to modify, instead of override css rule 2) there's an excess of html code since in each component inside the layout the curr

Re: TypeNames vs ClassName

2018-03-12 Thread Alex Harui
Hi Carlos, I think people are more uncomfortable with the proposal to use element.classList than any issue about order. It is hard for me to truly understand without seeing code so I think you should push it to your branch. I agree with Piotr that we can't make the users (app dev) use classList.

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi Alex, since Piotr and Harbs seems not to be very comfortable with the change, I can subclass UIBase for Jewel and make that changes there. I don't want to conflict in such central point of the framework, Will it be ok for all of us? 2018-03-12 18:56 GMT+01:00 Alex Harui : > IMO, the order isn

Re: TypeNames vs ClassName

2018-03-12 Thread Alex Harui
IMO, the order isn't going to make or break Royale. Leave it as you have it and we'll see what our users think. -Alex On 3/12/18, 10:49 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira" wrote: >Hi > >sorry guys, I changed it since I thought I would not matter anyone. For me >is just the

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi Piotr. I think is what I just pointed in the response to a Harbs emails. I think once people set typenames and classnames, if we operate all through element.classList, that solves all conflicts, since all classes are in a managed list, if people wants to add or remove they can through the list.

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi sorry guys, I changed it since I thought I would not matter anyone. For me is just the opposite. Feels very strange to me see things right to left, is like description of folders, bread crumbs and something like this that use to be from parent to child, and left to right I do that as well sinc

Re: TypeNames vs ClassName

2018-03-12 Thread Piotr Zarzycki
Carlos, But people are changing className all the time and that's the way how you are changing your component. That was the problem. How do you handle that one ? Change UIBase, your component to your approach. Than in your examples set - What are you get ? 2018-03-12 18:44 GMT+01:00 Carlos Ro

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi Harbs, if once typenames and classnames are set, if UIBase changes the way it manages className to use element.classList, things will be more easy and a matter of use add/remove/toggle methods in element.classList. right? if people changes className directly will be bad, unless he/she wants to

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Alex Harui
On 3/12/18, 10:11 AM, "carlos.rov...@gmail.com on behalf of Carlos Rovira" wrote: >> >> I still don't get why, if your Button is a subcomponent, some framework >> code was setting display style on it unless you were using a layout >>class >> in the component itself. >> > >that's the side effect

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi Piotr, I was reding from the begging and saw when the CSSClassList came. I think Harbs solution is ok, the only problem I see is that in MDL, and Jewel, we need to have functions per class that manages add/remove of classes and override of compute function. That's what I don't like of current

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Piotr Zarzycki
If I would want an Vertical layout which do not affect as much your children - I would create set of layouts beads which applies FlexBox rules or Grid rules to the children. The things is that I would do this the same way - by inline styles instead of css classes. Why ? Look into my previous statem

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
HI Alex 2018-03-12 17:02 GMT+01:00 Alex Harui : > Hi Carlos, > > As I said in my last post, you are welcome to write different layout > classes. We don't all have to agree on "one right answer". There often > isn't one right answer. Code up what you want to see and document why you > like it.

Re: TypeNames vs ClassName

2018-03-12 Thread Piotr Zarzycki
2018-03-12 17:14 GMT+01:00 Alex Harui : > If HTMLElement.classList is exposed to the user (the app developer) then > they can remove any of the items that were added from the typenames. > There is no way to enforce immutability of the typenames. We can choose > to give up on that and require that

Re: TypeNames vs ClassName

2018-03-12 Thread Alex Harui
Sure, the way the code is written in UIBase today. I think he can modify what UIBase className does, but then I think it starts becoming "more work" and not "simple" and PAYG. Of course, I could be wrong... -Alex On 3/12/18, 9:51 AM, "Harbs" wrote: >Right, but Carlos is using: element.classLis

Re: TypeNames vs ClassName

2018-03-12 Thread Piotr Zarzycki
Hi Carlos, That's why we are using Harb's solution with his own class list. If you went through this long thread carefully I have an issue which end up with that solution. The problem was exactly as Harb's mention. Try it yourself. Another great things which Harb's bring up here is why I also lik

Re: TypeNames vs ClassName

2018-03-12 Thread Harbs
Right, but Carlos is using: element.classList.toggle("primary", value); (and similar) That will be overwritten if someone sets myButton.className = “foo_class”; (where myButton is some kind of UIBase) You cannot even do something like this: myButton.className = myButton.className + “ foo_clas

Re: TypeNames vs ClassName

2018-03-12 Thread Alex Harui
Well, it isn't fair if someone writes to element.className, but we control what happens when someone writes to UIBase.className. I just want it to be as simple as possible and PAYG. -Alex On 3/12/18, 9:21 AM, "Harbs" wrote: >I’m pretty sure your solution will only work if the user doesn’t set

Re: TypeNames vs ClassName

2018-03-12 Thread Harbs
I’m pretty sure your solution will only work if the user doesn’t set a className of their own. Setting className overwrites the entire classList. > On Mar 12, 2018, at 5:45 PM, Carlos Rovira wrote: > > Hi > > I made some simplification that works ok in Jewel: > > 1.- remove CSSClassList and u

Re: TypeNames vs ClassName

2018-03-12 Thread Alex Harui
If HTMLElement.classList is exposed to the user (the app developer) then they can remove any of the items that were added from the typenames. There is no way to enforce immutability of the typenames. We can choose to give up on that and require that app developers be careful, but I'd rather not.

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Alex Harui
Hi Carlos, As I said in my last post, you are welcome to write different layout classes. We don't all have to agree on "one right answer". There often isn't one right answer. Code up what you want to see and document why you like it. Our users will then be able to choose. We will probably not

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi I made some simplification that works ok in Jewel: 1.- remove CSSClassList and use element.classList since is native and supported in all browsers we target, this simplifies code, and removes classes from core. 2.- I still need to use some additional code that can be simplified. I'm doing: el

Re: TypeNames vs ClassName

2018-03-12 Thread Carlos Rovira
Hi, long thread and very useful read here. Since Jewel is very similar to MDL in adding/removing classes I want to comment here some things: 1.- I just changed jewel typenames to the constructor and things works ok, I could remove the createElement override 2.- I have into account the use of type

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi, I must say that I was wrong in some part of my argumentation. I though the problem was in UIBase setting up things like display:block, but after looking at layout code since Harbs pointed me try to duplicate it by my side I saw is the vertical layout what was setting the inline styles. For tha

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
2018-03-12 11:29 GMT+01:00 Harbs : > > Can you explain why you care about inline CSS? I’m not getting it. > > As I get the basis of jewel and jewel theme working right, I want to start creating blog examples with the code and I know, people out there that wants to see if we are a option for their

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Harbs
I also care about the HTML output, but in a different way than you (I think). I care that it should be easy to debug and reason out why things are happening. Can you explain why you care about inline CSS? I’m not getting it. If find it much easier to understand inline CSS. It’s sometimes difficu

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi, I see we have very different ways to how we see royale. In the end I see Royale like you, but I care about the output we get in HTML in concrete, since is different than the code we can produce in other outputs like AS3 (and maybe some day in Java, Swift,...). HTML is what is delivered to the

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Harbs
> the frameworks I'm watching are MDL, Semantic and Bootstrap (all top > frameworks) to see what they do in different cases and guide me to find the > best way to implement the HTML Jewel should output in royale in Royale. All > of this frameworks are only HTML/JS/CSS (not builds from other code),

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi Piotr, this issue is affecting all the code since is in basic. You can check my branch and see it yourself, If you see the html code you'll see all buttons with hardcoded style properties. What is not good at all. 2018-03-12 10:20 GMT+01:00 Piotr Zarzycki : > Carlos, > > Does your code with m

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
HI Alex, 2018-03-12 8:17 GMT+01:00 Alex Harui : > IMO some styles (padding, margin, font*) determine the "boxes", other > styles (position, display) place the boxes. I think almost the same > The layouts will likely set > position and display directly on the outer box of a component. can th

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Piotr Zarzycki
Carlos, Does your code with mentioned issue is in jewel branch ? 2018-03-12 10:15 GMT+01:00 Carlos Rovira : > Hi Harbs, > > the frameworks I'm watching are MDL, Semantic and Bootstrap (all top > frameworks) to see what they do in different cases and guide me to find the > best way to implement

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Carlos Rovira
Hi Harbs, the frameworks I'm watching are MDL, Semantic and Bootstrap (all top frameworks) to see what they do in different cases and guide me to find the best way to implement the HTML Jewel should output in royale in Royale. All of this frameworks are only HTML/JS/CSS (not builds from other code

Re: Trying to remove "style" attribute set by Royale. First let's focus on style="display:block"

2018-03-12 Thread Alex Harui
IMO some styles (padding, margin, font*) determine the "boxes", other styles (position, display) place the boxes. The layouts will likely set position and display directly on the outer box of a component. The defaults.css in Basic should not have any styles that determine the boxes. Those styles