This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.application.views; | |
| // See: https://github.com/vaadin/flow-components/issues/3470 | |
| import java.util.stream.Collectors; | |
| import java.util.stream.IntStream; | |
| import org.vaadin.addons.componentfactory.ComboBoxLight; | |
| import com.vaadin.flow.component.Html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.tatu.components; | |
| import com.vaadin.flow.component.Component; | |
| import com.vaadin.flow.component.Html; | |
| import com.vaadin.flow.dom.Element; | |
| import com.vaadin.flow.dom.ShadowRoot; | |
| // Example of slotting of child component: | |
| // component.getElement().setAttribute("slot", "content"); | |
| // String html = "<div><slot name='content'></slot></div>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.application.views; | |
| import java.util.concurrent.CopyOnWriteArrayList; | |
| import com.vaadin.flow.component.combobox.ComboBox; | |
| import com.vaadin.flow.component.html.Span; | |
| import com.vaadin.flow.component.notification.Notification; | |
| import com.vaadin.flow.component.notification.Notification.Position; | |
| import com.vaadin.flow.component.orderedlayout.VerticalLayout; | |
| import com.vaadin.flow.data.binder.Binder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| TextField, | |
| TextFieldProps, | |
| } from "@hilla/react-components/TextField.js"; | |
| import { TextField as TextFieldWebComponent } from "@vaadin/text-field/vaadin-text-field.js"; | |
| import { forwardRef, useEffect, useImperativeHandle, useRef } from "react"; | |
| // Cleave.js is a library for formatting input text content when you are typing. | |
| // It is used to format the input value as a currency in this component. | |
| // Cleave.js is not included in the Hilla components, so it needs to be installed separately. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This is an example of LazyComponent for Vaadin 14/23/24. If the content creation | |
| * of the component takes long. For example data needs to be fetched from the back | |
| * end and computed, or it is an image whose loading takes time, one may need to | |
| * produce the component in background process. This example component wraps the | |
| * process in the Future which creates the component and upon completion adds to | |
| * view. @Push annotation needs to be present in AppShellConfigurator. | |
| */ | |
| package com.example.application.views; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.application.views; | |
| import java.io.Serializable; | |
| import java.util.concurrent.CompletableFuture; | |
| import java.util.concurrent.ExecutorService; | |
| import java.util.concurrent.Executors; | |
| import java.util.concurrent.atomic.AtomicInteger; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.context.ApplicationEvent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.example.application.views; | |
| import com.vaadin.flow.component.html.Div; | |
| import com.vaadin.flow.component.login.LoginForm; | |
| import com.vaadin.flow.router.Route; | |
| @Route(value = "password", layout = MainLayout.class) | |
| public class PasswordView extends Div { | |
| String javaScript = """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TooltipUtils { | |
| public static void setTooltipClassName(Component comp, String className) { | |
| comp.getElement().executeJs( | |
| """ | |
| if ($0.getElementsByTagName('vaadin-tooltip').length == 1) { | |
| $0.getElementsByTagName('vaadin-tooltip')[0]._overlayElement.setAttribute('class',$1); | |
| } else { | |
| const tooltips = document.getElementsByTagName('vaadin-tooltip'); | |
| for (let i=0; i<tooltips.length; i++ ) { |