Comments (1)
Implementation notes
Tool
The current tool implementation looks like this. The event handler uses the card entities configuration to process and forward the click event
return svg`
<g id="line-${this.toolId}" class="${classMap(this.classes.tool)}" style="${styleMap(this.styles.tool)}"
@click=${e => this._card.handleEvent(e, this._card.config.entities[this.config.entity_index])}>
${this._renderLine()}
</g>
`;
Currently, there is ALWAYS a click handler, as this one is added by default to process the "more-info" popup. This won't be the case anymore with the new tool-based click handlers.
So a click handler should be registered only if
- a
this.config.user_actions.tap_action
is defined - the
actions.action
is eithermore-info
orcall-service
AND anentity_index
is defined - the
actions.action
isnavigate
The slider-tool
is a special one: that one should register its own handlers for click and drag!
EventHandler (Card)
The current eventhandler (card::handleEvent
and card::_handleClick
are both part of the card
class, and should be moved to the baseTool
class.
from swiss-army-knife-card.
Related Issues (20)
- Refactor state building (states, animations) and state display (localization, specifics) HOT 2
- iPhone Custom Element Doesn't exist HOT 10
- Live Update of Entities HOT 3
- e.toLowerCase() is not a function HOT 8
- refactor: Remove custom-card-helpers HOT 1
- refactor: Refactor icon state building HOT 1
- Add Sparkline Graph tool HOT 10
- usersvg - png - animations not beingapplied HOT 17
- After updating to v2.5.1 my buienradar integration gives an error "Cannot read properties of null (reading 'toString') HOT 1
- Error : i.setConfig is not a function HOT 19
- Own toolset template not working HOT 1
- Add Progress Bar based on path tool HOT 1
- Cannot read properties of undefined (reading 'template')
- Safari 17 has scale and rotate issues
- scaling not working on mobile (android) HOT 1
- the ">" and ">=" operator gets ignored HOT 3
- "Null" attributes throw and error (and do not load card) HOT 1
- To make support for the type of user action "hold_action" HOT 3
- Feature: Refresh SVG on animation/time/state/... HOT 1
- Can't use notify service because of entity_id being added HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiss-army-knife-card.