Comments (11)
I guessed that, yes, but I still think there is some value in documenting that x-menuitem
dispatches click
events so you know that's the thing you should listen on.
I agree that this doesn't make sense for everything; x-label
and x-card
don't need click
events.
However, for elements that revolve around a certain (standard) event, I think it makes sense to make that clear in the documentation.
from xel.
I'm planning to implement ./project update-docs
script which should parse each x-*.js
file and update corresponding HTML file with documentation. All required annotations (like @type, @Attribute or @events) are already in place.
from xel.
Sounds like a good plan, although I'm not sure the @events
annotations are currently complete.
Looking at x-button
, https://github.com/jarek-foksa/xel/blob/144043f/elements/x-button.js#L28-L29, only toggle
is documented, while the documentation examples use click
(as you would expect).
x-menuitem
documents no events at all, while listing for click
on them works.
from xel.
Note that x-button
(XButtonElement
) and x-menuitem
(XMenuItemElement
) are inheriting from the standard HTMLElement
, which in turn dispatches the click
event.
It doesn't make sense to document all the standard DOM events like click
, dbclick
, contextmenu
, pointerdown
, pointermove
, pointerup
, lostpointercapture
, etc.
from xel.
i'm looking at the tabs, dont worry, but documentation seems incomplete. How content of each tabs is supposed to works?
from xel.
@tosolini You should listen for "open", "close" and "select" events on <x-doctabs>
. When the event fires, you are responsible for updating manually the visibility of your views to match the current state of <x-doctabs>
.
from xel.
@jarek-foksa thanks but this was clear. I dont understand the correlation between button tab and tab content, usually a typical tab have button with id and related content near or other part of page with same id in the container. In tabs examples i dont see the content at all. For example the x-accordion is clear to understand.
from xel.
<x-tabs>
and <x-doctabs>
widgets are responsible only for drawing the tabs, If you want a given tab to toggle some specific content with given ID, you should implement this behavior yourself.
This functionality is not provided out of the box because some apps might want to load the content associated with the tab asynchronously or perform other optimisations such as disconnecting the content from the DOM tree when it is not toggled.
from xel.
ok understood.
from xel.
The new project website now documents the JavaScript API for each element.
from xel.
Nice!
from xel.
Related Issues (20)
- <x-menu> The status will be deselected
- please fix relative import paths HOT 1
- package.js doesn't process theme files / iconsets on Windows.
- Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'styleMap') at #k (xel.js:1:51212) HOT 3
- Typescript support? HOT 1
- x-tagsinput leaves a trailing comma. HOT 1
- Deprecate global "size" setting HOT 1
- Popover API migration
- CSS Anchor Positioning API migration
- <x-input> Width HOT 1
- Can animation be disabled on elements? HOT 4
- No support for scrolling? HOT 5
- Popovers in <x-buttons> don't close HOT 2
- <x-tab> disabled prop does not work HOT 1
- <x-tooltip> does not work with <x-menuitem> HOT 4
- Some <x-colorselect> events don't work HOT 2
- <x-colorselect> returns selected value in rgb(...) format in some cases HOT 1
- <x-radios> don't have a change event HOT 3
- Support for <x-tooltip> in <x-select>
- "decrement-arrow" has wrong rotation HOT 7
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 xel.