Giter Club home page Giter Club logo

Comments (5)

ragingdave avatar ragingdave commented on June 29, 2024

I would totally advocate for add* type methods rather than a cryptic Boolean tacked on

from nova-fields.

bernhardh avatar bernhardh commented on June 29, 2024

I could live with that, but in my eyes, its just splitting hairs.

The current method is just manipulating the css classes of the fields. At the moment, you don't know if it appends or if it overwrites. So to make it not "cryptic", you would have to change these method names as well to "changeInputClass, changeLabelClass", etc. (or updateLabelClass, etc.). So you would not only double the methods, but you would also break current behaviour.

from nova-fields.

beliolfa avatar beliolfa commented on June 29, 2024

Sounds good to me. I’ll take a look on this and think in the best api.

from nova-fields.

ragingdave avatar ragingdave commented on June 29, 2024

I only advocated for clarity since, a setter (inputClasses) and an adder (addInputClass) just seem more straight forward to someone reading the code. Rather than having to hit up documentation (which at the moment doesn't really exist, not blaming anyone), the clear and readable separation of changing the class vs adding a class is clear. Additionally there is already at least one example of this kind of thing in laravel already. For example in the query builder there is select (replacing the current selects) and addSelect ( just adding a new select). I don't think we would need to actually change much of the current names and still end up in a clear functionality description.

Another way of looking at it is in terms of what it is, a POPO. Most attributes are get/set via what they are named at a property level so it would also fall in line with not only normal objects but also most other languages that I can think of off-hand. With an additional function being used to not straight-up change the property, but instead a function that could modify the underlying property.

from nova-fields.

beliolfa avatar beliolfa commented on June 29, 2024

Added the following methods to 0.3.0:

  • addInputClasses
  • addWrapperClasses
  • addFieldClasses
  • addPanelFieldClasses
  • addLabelClasses
  • addPanelLabelClasses
  • addExcerptClasses

from nova-fields.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.