Coder Social home page Coder Social logo

vaadin / web-components Goto Github PK

View Code? Open in Web Editor NEW
401.0 17.0 78.0 129.29 MB

A set of high-quality standards based web components for enterprise web applications. Part of Vaadin 20+

Home Page: https://vaadin.com/docs/latest/components

JavaScript 95.07% Shell 0.01% TypeScript 2.29% HTML 2.62%
vaadin webcomponents custom-elements ui-components ui-kit design-system design-systems hacktoberfest web-components

web-components's Introduction

Vaadin logo

Vaadin web components

Vaadin components is an evolving set of high-quality web components for business web applications.

Build Follow on Twitter

Installation

Install the components that you need from npm:

npm install @vaadin/grid

Usage

Live demo →

Import the component's JavaScript module, use the component in your HTML, and control it with JavaScript:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Vaadin example</title>
  </head>
  <body>
    <!-- Use web components in your HTML like regular built-in elements. -->
    <vaadin-grid theme="row-dividers" column-reordering-allowed multi-sort>
      <vaadin-grid-selection-column auto-select frozen></vaadin-grid-selection-column>
      <vaadin-grid-sort-column width="9em" path="firstName"></vaadin-grid-sort-column>
      <vaadin-grid-sort-column width="9em" path="lastName"></vaadin-grid-sort-column>
      <vaadin-grid-column width="9em" path="address.city"></vaadin-grid-column>
    </vaadin-grid>

    <!-- Vaadin web components use standard JavaScript modules. -->
    <script type="module">
      // Importing the following modules registers <vaadin-grid> and its column
      // elements so that you can use them in this page.
      import '@vaadin/grid/vaadin-grid.js';
      import '@vaadin/grid/vaadin-grid-selection-column.js';
      import '@vaadin/grid/vaadin-grid-sort-column.js';

      // Use component's properties to populate data.
      const grid = document.querySelector('vaadin-grid');
      fetch('https://demo.vaadin.com/demo-data/1.0/people?count=200')
        .then((res) => res.json())
        .then((json) => (grid.items = json.result));
    </script>
  </body>
</html>

Serve your HTML with a development server that supports bare module specifiers, such as @web/dev-server:

npm i -g @web/dev-server
web-dev-server --node-resolve --open

Components

This project contains components for Vaadin 20+. Please see individual repositories for older Vaadin versions.

Core Components

The components below are licensed under the Apache License 2.0.

Component npm version (latest) npm version (next) Issues
<vaadin-accordion> npm version npm version Issues
<vaadin-app-layout> npm version npm version Issues
<vaadin-avatar> npm version npm version Issues
<vaadin-avatar-group> npm version npm version Issues
<vaadin-button> npm version npm version Issues
<vaadin-checkbox> npm version npm version Issues
<vaadin-checkbox-group> npm version npm version Issues
<vaadin-combo-box> npm version npm version Issues
<vaadin-confirm-dialog> npm version npm version Issues
<vaadin-context-menu> npm version npm version Issues
<vaadin-custom-field> npm version npm version Issues
<vaadin-date-picker> npm version npm version Issues
<vaadin-date-time-picker> npm version npm version Issues
<vaadin-details> npm version npm version Issues
<vaadin-dialog> npm version npm version Issues
<vaadin-email-field> npm version npm version Issues
<vaadin-form-layout> npm version npm version Issues
<vaadin-grid> npm version npm version Issues
<vaadin-horizontal-layout> npm version npm version Issues
<vaadin-icon> npm version npm version Issues
<vaadin-icons> npm version npm version Issues
<vaadin-integer-field> npm version npm version Issues
<vaadin-item> npm version npm version Issues
<vaadin-list-box> npm version npm version Issues
<vaadin-login> npm version npm version Issues
<vaadin-menu-bar> npm version npm version Issues
<vaadin-message-input> npm version npm version Issues
<vaadin-message-list> npm version npm version Issues
<vaadin-multi-select-combo-box> npm version npm version Issues
<vaadin-notification> npm version npm version Issues
<vaadin-number-field> npm version npm version Issues
<vaadin-password-field> npm version npm version Issues
<vaadin-progress-bar> npm version npm version Issues
<vaadin-radio-group> npm version npm version Issues
<vaadin-scroller> npm version npm version Issues
<vaadin-select> npm version npm version Issues
<vaadin-side-nav> npm version npm version Issues
<vaadin-split-layout> npm version npm version Issues
<vaadin-tabs> npm version npm version Issues
<vaadin-tabsheet> npm version npm version Issues
<vaadin-text-area> npm version npm version Issues
<vaadin-text-field> npm version npm version Issues
<vaadin-time-picker> npm version npm version Issues
<vaadin-tooltip> npm version npm version Issues
<vaadin-upload> npm version npm version Issues
<vaadin-virtual-list> npm version npm version Issues

Pro Components

The components below are licensed under Vaadin Commercial License and Service Terms and available as part of the Vaadin Pro Subscription.

Component npm version (latest) npm version (next) Issues
<vaadin-board> npm version npm version Issues
<vaadin-charts> npm version npm version Issues
<vaadin-cookie-consent> npm version npm version Issues
<vaadin-crud> npm version npm version Issues
<vaadin-grid-pro> npm version npm version Issues
<vaadin-map> npm version npm version Issues
<vaadin-rich-text-editor> npm version npm version Issues

Browser support

Desktop:

  • Chrome (evergreen)
  • Firefox (evergreen)
  • Safari 15 or newer
  • Edge (Chromium, evergreen)

Mobile:

  • Chrome (evergreen) for Android (4.4 or newer)
  • Safari for iOS (15 or newer)

Documentation

Check out our design system documentation.

Examples

Are you looking for an example project to get started? Visit start.vaadin.com to create a Vaadin app.

Questions

For help and support questions, please use Vaadin Forum.

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs.

Contributing

Read the contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.

Development

See the Development guide for how to set up and develop this project locally.

LICENSE

For specific package(s), check the LICENSE file under the package folder.

web-components's People

Contributors

alvarezguille avatar artur- avatar dependabot[bot] avatar diegocardoso avatar h00k00 avatar haprog avatar jarski avatar jouni avatar limonte avatar manolo avatar oluwasayo avatar pekam avatar peppe avatar platosha avatar ripla avatar rogozinds avatar samiheikki avatar saulis avatar shadikhani avatar sissbruecker avatar sohrabtaee avatar sosa-vaadin avatar tehapo avatar tomivirkki avatar ugur-vaadin avatar vaadin-bot avatar vicsstar avatar vursen avatar web-padawan avatar yuriy-fix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-components's Issues

[context-menu] Prevent over-scroll

When the context menu is opened, it is still possible to scroll the parent element.

In PR vaadin/vaadin-context-menu#33 there were two tries to fix this, one based on adding/removing a pixel to scroll which seems not very reliable, and another based on cssing the body which is better, but only covers the case of the body. Probably the best solution should be based on javascript wheel, touchstart and touchmove events.

[date-picker] Mouse scroll sensitivity affects the usability of the scrollers

We need to test the scroller on as many platforms as possible (OS X, Windows, Linux) and as many different mouse types as we can find in the office, and try out different scroll speed adjustments which the OS offers to see how they affect the scrolling speed compared to other scrollable elements on a webpage.

[combo-box] Multi-select

We have initial designs for this feature (mockups), but we need to write some end user scenarios to validate the designs (useful for user testing).

  • Adding multi values
    • Order of selected items
    • MVP: keep all values visible in closed input
  • Editing multi values
    • Keyboard navigation: select "chips/tokens" (not cursor between them)
  • Removing multi values

pdf/excel export

Any clue to export the content to PDF/Excel (web component version)?

Thanks, great grid!
--Nick

[upload] Implement file preview

It’s important to have file preview thumbnails when picking files from Photo Library. In this case the files have the same name (“image.jpeg”). It’s impossible to distinguish between them and find out if a wrong photo has been uploaded.

Suggestion done during the UX testing

[date-picker] Range select

Range selection has currently been designed to work within one date picker.

We should evaluate different scenarios if they are better served with to individual pickers instead, or if we can and need to improve the single picker design in some way to accommodate more scenarios.

It’s not 100% clear to me how this relates to multi-select also, when the user can select many individual days from the picker, so it could be considered here as well.

[grid] Select multiple rows with ctrl/cmd-click or shift-click

It would be a nice feature to handle the ctrl/cmd+click on a row for the multiple selection, instead of using the checkbox.
The auto-select attribute can make this useless, but the best use case would be when the auto-select attribute is not present, to always select the row on click cell (one only selected), but allow the multiple selection with the ctrl/cmd+click cell and the checkbox selection.

[charts] Size doesn't update correctly when removing display: none from the parent

Vaadin Charts version: 3.1.0-rc1

Steps to reproduce

  1. npm install polymer-cli
  2. polymer init and select starter-kit.
  3. Wait for dependencies to install
  4. Add a vaadin-chart to my-view2.html
  5. Use polymer serve to start the application
  6. Browse to my-view2.html so that it is attached
  7. Go back to my-view1.html and resize the window
  8. After resizing, go back to my-view2.html
  9. The size of the chart should now be something else what you expected

charts_bug

[upload] Add more server error messages

Would be nice if we can give the more detailed reason of failure, not just “server unavailable”. Might be good to show the detailed information in a tooltip or on click.

Suggestion done during the UX testing

Redesign "Cancel All" feature

“Cancel All” button removes the complete files from the list, while the word “cancel” suggests that it would only affect the files that are in progress.

[date-picker] Support relative offset for initialPosition

Feature request from Ilya M.

vaadin-date-picker currently support setting initial position to some absolute date value. While in some use cases (travel date next week, birthday ~30 years ago, ...), the developer might want to change the initial position to some relative offset from today. A fixed date as initial position value for these cases would quickly become outdated.

Would be nice to have some means to set the initial position with some offset instead of absolute date value.

As a quick improvement for these cases we should probably provide an example in our documentation on how to set the initial position with some calculated date with offset from today.

[upload] Support optional `FileReader` transport instead of `XMLHttpRequest`

As a developer, I want the upload element to “upload” files with FileReader instead of XMLHttpRequest.

API idea:

  • transport property accepting string options:
    • "XMLHttpRequest" (default)
    • "FileReader"
  • with transport="FileReader", method property accepts string options:
    • "arrayBuffer" (default) → fileReader.readAsArrayBuffer() is used
    • "text"fileReader.readAsText() is used
<vaadin-upload transport="FileReader" method="text"></vaadin-upload>
<script>
  vaadinUpload.addEventListener('upload-success', function(e) {
    e.detail.xhr; /* `undefined` with FileReader transport */
    e.detail.fileReader; /* FileReader instance */
    e.detail.fileReader.result; /* text content of the “uploaded” file */
  });
</script>

[date-picker] Scroll the overlay to center the initial date and today vertically

Currently, when the overlay is scrolled to some date, for example, scrolling to today or the previously selected date on open, the month of that target date is positioned at the top of the overlay.

Instead, the target date should be scrolled to the center of the overlay.

Also, adjust the today button behavior so that it selects today instead of scrolling to it when today is inside the 50% height area in the center of the overlay. (done)

Today selectable range

[grid] Fire scroll events

We should fire scroll events when the grid is scrolled, which the developer can listen and react to.

var grid = document.querySelector("vaadin-grid");
grid.addEventListener("scroll", function(e) {
  ...
});

The event object ("e") should have both scrollTop and scrollLeft properties that present the grid’s state. If possible, it should also have the scrollHeight property that indicates the total of the grid body.

This will enable developers to do additional customizations based on the scroll position, to add some functionality which is not built-in, like a scrollbar indicator (like you see in Google Docs).

Provide both ligature and non-ligature fonts

The ligatures add roughly 15% more size to the font files (the svg font gets 100% more size, but we probably won’t ship that in the next version).

We should offer both options for the user to choose from.

The ligatures are nice for designers to use in design tools like Sketch, as they can just type the name of the icon instead of search for the correct unicode to copy-paste. Also, in browsers that support ligatures, it provides a nice fallback text for screen readers to announce, in cases where that is feasible.

On the other hand, the added size can be considered unnecessary for the users to download on their devices, if they are not used in the app (only single unicode characters used to set the icons).

[combo-box] Unify mouse and keyboard item focus/highlight

Currently the user can have two separate highlighted rows in the dropdown: one for the mouse cursor and one for the keyboard.

These two should be one and the same, and the mouse cursor should move the keyboard focus to the highlighted item.

When the mouse cursor leaves the dropdown, the keyboard focus should be cleared, unless there is a previous value/selection in the input. If there is a previous value/selection, the focus/highlight should return to that item.

[charts] support lazy loading chart dependencies

Currently, using any chart at all requires downloading javascript for all charts which is not very optimal.

I would like to see that the imports get split so that any given chart will only download the javascript it needs to run.

You may want to wrap individual scripts in HTML files and use HTML imports so that the de-duping mechanism ensures only one of each gets downloaded if you have several charts.

Allow any number of children

Instead of just two child elements and one splitter element, we could support any number of children with a splitter element between each child element.

See https://codepen.io/pen/ for a use case (the HTML, CSS and JS panels).

[grid] Built-in filter options

Hello Vaadin Team,

i'd like to know if your plans for the Grid 2.0 contain build-in filter options like KendoUI is featuring it in the following example: http://demos.telerik.com/kendo-ui/grid/filter-multi-checkboxes

In this example, when clicking on the arrows at the end of each column header, a overlay with filtering options depending on the column content is displayed. This is very easy and useful for setting multiple filter selectors (e.g. for selecting orders from customers from Germany and Finland at once). This might be possible with a text input too, but then the user has to know and to understand the Boolean logic of setting something like "Germany || Finland" as filter text.

So, just a show yes or no/not yet/not to soon would be enough for me so that I can decide if I've to worry about implementing this on my own or not :)

Thanks for all your work and have calm and relaxing Christmas days!
Michael

[text-field] Allow the developer to configure how validation result is emphasized

Current situation

The current default behavior defined in vaadin/vaadin-text-field#12 is that a failed validation is only indicated after the user blurs the field and that a previously failed validation is cleared immediately during typing.

This works nicely for some part of the use cases and avoids the following edge case:

  • Not giving the user a failed validation message prematurely before the user has had time to finish typing

But the following cases are not covered:

  • Giving the user immediate feedback about the invalid state, for example in a number field, if the user types in letters, or if the maximum allowed length is exceeded.
  • Giving the user (immediate or deferred) explicit feedback about a successful validation, for example marking an email address field with a “success icon” when the user has entered a valid email address

Change proposal

We should move back to updating the validation status immediately after the user types in the field. But instead of having a way to just indicate the invalid state, we should also offer a way to configure the input to show the following combinations of states:

  • Invalid state only – a common indication is red text and possibly an icon
  • Success state only – a common indication is green text and possibly an icon
  • Invalid and success states – either state is triggered after user input, depending on the validation status
  • No state indication – it should be possible to disable the styles completely. This could even be the default.

There’s a prototype in https://github.com/vaadin/vaadin-input/tree/proto/validation-feedback
(relevant API examples in https://github.com/vaadin/vaadin-text-field/blob/5690eced3c247b09de821c4017679fd42cd3f755/demo/validation-feedback.html)

[grid] Pagination

In some use cases, a paginated data grid is easier for the user than a purely scrolling one. Also, scrolling and paging can be nicely combined with "virtual paging", as you can see in this example.

This could be added as an example (not directly baked in as a feature), and we could provide the pagination element as an official add-on that can be added below the grid without any extra configuration. On top of that, the scrolling could be disabled with some extra property perhaps.

In the meantime, use this pagination example as a starting point: https://cdn.vaadin.com/vaadin-grid/2.0.0-beta1/demo/pagination.html

[grid] Freeze/fix columns to the right

Adding this feature to the wishlist.

Some use cases require columns to be fixed on the right edge of the grid.

Should work simultaneously with fixed columns on the left side.

[upload] Add disabled property

There should be a disabled property that we can bind to. For example, file uploads are disabled until a valid usename is chosen.

[date-picker] Reconsider UI for touch devices

Could you move sidebar with years to bottom? Many users don't know click on button with year on mobile. Could you add arrow icons to scrollbar with years?

selection_147

Here is MD dialogs specs
https://material.io/guidelines/components/dialogs.html#dialogs-specs

Touch target size in Material Design is 48px on touch screen and 40px on desktop. Please change size of days. Height 48px(40px) and width based on screen width with max-width 48px(40px).
https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-touch-target-size

image

[grid] Drag/lasso selection

This will be a very cool feature to select multiple line with a lasso type selection, as there is on google drive.
Holding mouse click down and drag over the line to selected.

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.