polymer

Where should I place my Vaadin 10+ static files?

旧城冷巷雨未停 提交于 2020-01-11 19:55:14
问题 In Vaadin 10-14, where should I place my static files, such as CSS, JavaScript, and Polymer templates? How about static files such as images? Also, how do I import these files in Vaadin? Is there a difference between Vaadin 14 with npm and Vaadin 10-13 with bower? 回答1: All paths are relative to the project root, e.g. where the pom.xml file is located in a Maven project. JavaScript imported using @JsModule uses strict mode. Among other things, this means that global variables must be defined

How to style inner elements of custom Polymer element using external styles?

雨燕双飞 提交于 2020-01-11 09:32:31
问题 Unable to style an element using Shadow DOM with Polymer 1.x or 2.x. Consider the following custom element in Polymer 2.0: <link rel="import" href="../polymer/polymer.html"> <!-- `semantic-ui-button` @demo demo/index.html --> <dom-module id="polymer-button"> <template> <div class$="button {{size}}">{{label}}</div> </template> <script> class MyElement extends Polymer.Element { static get is() { return 'polymer-button'; } static get properties() { return { label: { type: String, value: 'polymer

How to style inner elements of custom Polymer element using external styles?

我们两清 提交于 2020-01-11 09:32:09
问题 Unable to style an element using Shadow DOM with Polymer 1.x or 2.x. Consider the following custom element in Polymer 2.0: <link rel="import" href="../polymer/polymer.html"> <!-- `semantic-ui-button` @demo demo/index.html --> <dom-module id="polymer-button"> <template> <div class$="button {{size}}">{{label}}</div> </template> <script> class MyElement extends Polymer.Element { static get is() { return 'polymer-button'; } static get properties() { return { label: { type: String, value: 'polymer

Use a class as attribute for a dart polymer element

僤鯓⒐⒋嵵緔 提交于 2020-01-11 07:25:28
问题 I have a polymer element, which needs to load some data from a web service. <gallery-pol loader=""></gallery-pol> @CustomTag('gallery-pol') class PolymerGallery extends PolymerElement { @published GalleryDataLoader loader; ... } I don't want to have implementation of the data loading in my polymer element as it shouldn't be fixed to a specific web service. What is the best way to pass an object which implements the actual data loading to my polymer element? Should i just select my element in

Use a class as attribute for a dart polymer element

大憨熊 提交于 2020-01-11 07:25:05
问题 I have a polymer element, which needs to load some data from a web service. <gallery-pol loader=""></gallery-pol> @CustomTag('gallery-pol') class PolymerGallery extends PolymerElement { @published GalleryDataLoader loader; ... } I don't want to have implementation of the data loading in my polymer element as it shouldn't be fixed to a specific web service. What is the best way to pass an object which implements the actual data loading to my polymer element? Should i just select my element in

Twitter Bootstrap styles in Dart polymer template

a 夏天 提交于 2020-01-10 20:10:54
问题 Using polymer.dart, how can I ensure that styles referenced in the consuming page are still available in the template? I have a consuming, or main, page, thus: <html> <head> <link rel="stylesheet" href="aplaceontheinterweb" /> <link rel="import" href="ponies.html" /> </head> <body> <div class="defined_in_the_included_file"> ... </div> <div is="a-pony"></div> <script src="packages/polymer/boot.js"></script> </body> </html> and a template, thus: <polymer-element name="a-pony" extends="div">

Get multiple values of selected paper-radio-button

前提是你 提交于 2020-01-07 06:57:08
问题 I have a dom-repeat element that creates a paper-radio-group with a couple of paper-radio-buttons. These radio-buttons each contains two pieces of unique information loaded from an array. Model name and price. I need to be able to load the model name and price of the selected radio-button. I'm able to load the name of the selected model but I can't figure out how to do it with the price at the same time. Here is the code I currently have that displays the name: <paper-radio-group class=

Polymer 1.x: How to use dataSource function to filter iron-data-table?

强颜欢笑 提交于 2020-01-07 05:43:09
问题 Here is the Plunk. I want to implement the dataSource filtering function for <iron-data-table as described in the accepted answer to this SO question. My problem is the docs here do not give an example of how to accomplish this. Eventually, I will want to have a complex set of filters (think: control panel ) on a large data set of items. I have tried copying the approach employed by dom-repeat described in the docs here but without success. http://plnkr.co/edit/cGykY65HWnK4pIQ0qx8O?p=preview

Polymer 1.x: How to reverse order of records returned by <firebase-collection>

天涯浪子 提交于 2020-01-07 05:05:11
问题 How do I reverse the order of records returned by <firebase-collection> as follows: <firebase-collection id="foo" order-by-child="bar"> ? Can I do it declaratively? Or do I need to call an imperative method like maybe... this.$.foo = this.$.foo.reverse(); https://elements.polymer-project.org/elements/firebase-element?active=firebase-collection Note: I'm using <iron-list> and not <template is="dom-repeat"> . 回答1: Simplest is just to use a <dom-repeat> with an inverse sort I believe. sort.

Content within div won't fill available space without specifying height

非 Y 不嫁゛ 提交于 2020-01-07 04:35:11
问题 I have a page that is separated vertically into two panes. The left side layout is fine but I am having trouble getting content to fill available space on the right. Below is a diagram illustrating this. The header and footer (polymer elements) are a fixed height and the content area in between is swapped out between page views. In order to get the content to fill the space I have to specify the main container div height in vh units. This does work to a certain extent but I would like to use