core-elements

core-list-dart template how to bind to the model itself

為{幸葍}努か 提交于 2020-01-05 03:51:19
问题 I'm using the <core-list-dart> element in my Polymer Dart application: <core-list-dart data="{{data}}"> <template> <span>{{name}}</span> </template> </core-list-dart> Data is an array of Foo where Foo is: class Foo { String name; ... } It is possible in the template refer to the Foo instance instead of his fields? Something like: <core-list-dart data="{{data}}"> <template> <foo-element foo="{{ITEM}}"></foo-element> </template> </core-list-dart> 回答1: From version 0.4.0 of core_elements the

Using core-dropdown to select multiple items

折月煮酒 提交于 2019-12-23 01:41:31
问题 When a user clicks in a report button, they should be able to select one or more types of issues. I'm trying something like this: <core-icon-button icon="report" on-tap="{{ openDropdown }}"> <core-dropdown> <core-selector valueattr="label" multi> <core-item label="Type 1"></core-item> <core-item label="Type 2"></core-item> <core-item label="Type 3"></core-item> </core-selector> <button on-tap="{{ reportIssue }}">Report</button> </core-dropdown> </core-icon-button> But when I select any item

Using core-dropdown to select multiple items

房东的猫 提交于 2019-12-23 01:41:14
问题 When a user clicks in a report button, they should be able to select one or more types of issues. I'm trying something like this: <core-icon-button icon="report" on-tap="{{ openDropdown }}"> <core-dropdown> <core-selector valueattr="label" multi> <core-item label="Type 1"></core-item> <core-item label="Type 2"></core-item> <core-item label="Type 3"></core-item> </core-selector> <button on-tap="{{ reportIssue }}">Report</button> </core-dropdown> </core-icon-button> But when I select any item

Google Dart Pages within Tabs

这一生的挚爱 提交于 2019-12-13 00:00:39
问题 I'm attempting to load "pages" within tabs in Dart and can not seem to set them up properly. My below example has pages that are supposed to show text inputs on each page but the pages are within tabs. I'm not sure how to properly set these pages up within tabs. So far I had been going by this example: Switching content when tab selected using polymer ui elements tabs Please let me know if you need more information. <paper-tabs id="Tabs" selected="0" style='width:800px; height:175px; color

Appropriate use of metadata in polymer application (i.e. core-meta element)

依然范特西╮ 提交于 2019-12-11 10:14:50
问题 I'm confused as to the proper use of core-meta in polymer. I tried looking at Topeka's metadata.html but it seems to cloud the issue for me further, with its extensive usage of x-meta tags seemingly related specifically to polymer designer tool etc. (I'm not using polymer designer) Basically, I'm simply looking to create a config-file of sorts for my polymer application. For instance, I'd like to set the application's API data source URL (or at least the base URL) in one place and have any of

core-list-dart: How access variable (@observable) outside data attribute

回眸只為那壹抹淺笑 提交于 2019-12-11 03:03:39
问题 I'm trying to apply a filter through a variable (asDateTime) for a given column to the core-list-dart. This variable is outside of the content data attribute (model). When I access this variable, an error is throws. See the code: * dominio.dart * class ContaPagar { ... List<ContaPagarParcela> contaPagarParcelas; } class ContaPagarParcela { ... DateTime dataVencimento; } * filter.dart * class StringToDateTime extends Transformer<String, DateTime> { String forward(DateTime dateTime) { String

polymer paper-menu-button change the default size of icon

眉间皱痕 提交于 2019-12-10 12:15:01
问题 Is there way to set the size of polymer paper-menu-button element. I think it is the icon size is set to 24px. I wish to have it as 20px but I cannot find a way to do it. Thanks Dennis 回答1: I tried it and it worked. Add this style to the Polymer element containing your <paper-menu-button> element. paper-menu-button /deep/ core-icon[role=img] { height: 20px; width: 20px; } I added [role=img] to increase the selectivity. 来源: https://stackoverflow.com/questions/25352296/polymer-paper-menu-button

Taking total control of PaperInput validation

谁说胖子不能爱 提交于 2019-11-27 07:07:43
问题 I'm using PaperInput and like the feel. But, is there a way to do the validation using my own logic? For instance, in some cases a pattern match is not enough to determine the error I'd like to display. An example would be I want the PaperInput to specify an item which can only be added once, so the validation would do a lookup in some model map and if input.inputValue is not present it is valid, otherwise invalid. <paper-input floatingLabel id="alias-input" validate="{{aliasIsValid}}" type=