GithubHelp home page GithubHelp logo

pstj-closure's People

Contributors

pstjvn avatar yathit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

yathit

pstj-closure's Issues

RadioGroup allows for more than one selected RadioButton

When using decoration pattern and all radio buttons are also decorated and the selected one is set via the 'value' parameter on the group but is not set on the decorated child the selected child is not reflected in the component which leads to the ability to select more than one option at a time (the first time).

Wrong invalid state on inputs

When resetting the value of an input and it is marked as 'required' the invalid state is enabled and
this way when a form is being reset (input value set to empty string) all inputs are marked as 'error' which confuses the user. Resetting the value to empty string programmatically should not set the invalid state.

Ripple effect and scroll

Currently ripple effects are triggered for items in containers that allow for scrolling. This sends mixed signals to the user, the ripple should only be triggered when there is no scrolling or should be at least canceled when scrolling starts.

Decoration support for DrawerPanel

Most pstj components, such as HeaderPanel supports declarative construction of UI via HTML elements. But the root element, DrawerPanel does not support decoration pattern.

Should my app be construct all UI by code? Is there suggested pattern?

Experiment with alternative ways of lading / using svg icons

Currently the SVG icons are static templates, which bears no benefits other than being able to filter them out on compilation. This benefit however is dwarfed by the amount of work needed to provide the svg code and the renderer that can understand the modes the icon can be in.

Alternatives:

  1. use a text file that will be loaded on demand and contains all svg icons, when icon is needed to be displayed a regular expression should be able to select the group by its name for any supported icon. Example:
<g name="menu,back-arrow,close,plus,checked"><path....></g>

When one of the icons is needed ('close' for example) a regexp will be run through the file and the result will be used as innerHTML for the SVG element

  1. use single template containing all elements and generate text from if (standard for soy templates) then use ids / names to retrieve the desired one. This gives us the possibility for class name minifications but we loose the new lines in the text file.

  2. separate all SVG icons in separate files and load them on demand - this might prove to be volatile to network issues and is only a 'last resort' should all other possibilities fail.

From the 3 options, 2 seem to be a 'best fit' - it will however bump up the size of the whole compiler application a lot. Alternatively it can be loaded as 'module' by closure utils, but it will still require a lot of boilerplate (should the main app is not already 'modulized').

Ideal solution should be

  1. have in memory only the icons that are used by the app (current solution and 3)
  2. small footprint on load time (current solution)
  3. ease of adding new icons (1)
  4. fast access - no need for additional boilerplate (loader) code (current solution and 2)
  5. use the minification algorithms of the compiler (current and 2)
  6. work in offline mode (current, 2, 1 with local cache of the file (indexedDB etc))

Priority of the points:
Most important -> less important
6, 3, 4, 1, 2, 5

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.