GithubHelp home page GithubHelp logo

Styles and Classes on Widgets about widget-core HOT 7 CLOSED

dojo avatar dojo commented on August 21, 2024
Styles and Classes on Widgets

from widget-core.

Comments (7)

novemberborn avatar novemberborn commented on August 21, 2024 1

I wonder if it should be possible to provide state that isn't actually stored anywhere?

Turns out it is, yay!

from widget-core.

kitsonk avatar kitsonk commented on August 21, 2024

Refs #45 in that what we need to do here will essentially effect that as well as #35 to a minor degree.

from widget-core.

novemberborn avatar novemberborn commented on August 21, 2024

Following up from dojo/app#20 (via dojo/widgets#30), should it be possible to specify classes at instantiation time without specifying them in the state?

I suppose these too could be considered "static" and added after getting the widget classes. Then any dynamic stuff needs to come from the state.

from widget-core.

agubler avatar agubler commented on August 21, 2024

classes and styles have been removed as options for widgets and the only way to specify classes outside of statically in the widget is via state, so in answer I don't think so.

from widget-core.

novemberborn avatar novemberborn commented on August 21, 2024

@agubler that makes dojo/app#20 really hard to implement. I wonder if it should be possible to provide state that isn't actually stored anywhere? Otherwise App will have to create IDs for all widgets it instantiates, and might just have to require a default widget store.

I'm actually bringing this up since I'm looking to simplify the dataviz behavior around this kind of config. Sounds like the idea is that you can specify defaults on the class level, and allow customization via state. So I'll try to make that work.

from widget-core.

kitsonk avatar kitsonk commented on August 21, 2024

Turns out it is, yay!

The only caveat/edge case that I don't think we have handled is that if .observeState() after creation, the "local" state will be patched with the observed state, which might result in some surprises. We could change it that the first thing it does when observing state is that it takes any local state and patches that before it starts observing. I suspect that is all a bit of an edge case though.

from widget-core.

novemberborn avatar novemberborn commented on August 21, 2024

The only caveat/edge case that I don't think we have handled is that if .observeState() after creation, the "local" state will be patched with the observed state, which might result in some surprises. We could change it that the first thing it does when observing state is that it takes any local state and patches that before it starts observing. I suspect that is all a bit of an edge case though.

Would be good to avoid surprises like this.

from widget-core.

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.