diff --git a/bower.json b/bower.json index 3b428c9..ac4dbd5 100644 --- a/bower.json +++ b/bower.json @@ -3,7 +3,6 @@ "private": true, "dependencies": { "platform": "Polymer/platform#master", - "core-action-icons": "Polymer/core-action-icons#master", - "polymer-ui-action-icons": "Polymer/polymer-ui-action-icons#master" + "core-action-icons": "Polymer/core-action-icons#master" } } \ No newline at end of file diff --git a/core-component-page.html b/core-component-page.html index 627e6ce..6904d07 100644 --- a/core-component-page.html +++ b/core-component-page.html @@ -1,3712 +1,1423 @@ - - - + }); + - - - - - - - - - + - var utils = { - /** - * Invokes a function asynchronously. The context of the callback - * function is bound to 'this' automatically. - * @method async - * @param {Function|String} method - * @param {any|Array} args - * @param {number} timeout - */ - async: function(method, args, timeout) { - // when polyfilling Object.observe, ensure changes - // propagate before executing the async method - Platform.flush(); - // second argument to `apply` must be an array - args = (args && args.length) ? args : [args]; - // function to invoke - var fn = function() { - (this[method] || method).apply(this, args); - }.bind(this); - // execute `fn` sooner or later - var handle = timeout ? setTimeout(fn, timeout) : - requestAnimationFrame(fn); - // NOTE: switch on inverting handle to determine which time is used. - return timeout ? handle : ~handle; - }, - cancelAsync: function(handle) { - if (handle < 0) { - cancelAnimationFrame(~handle); - } else { - clearTimeout(handle); - } - }, - /** - * Fire an event. - * @method fire - * @returns {Object} event - * @param {string} type An event name. - * @param {any} detail - * @param {Node} onNode Target node. - */ - fire: function(type, detail, onNode, bubbles, cancelable) { - var node = onNode || this; - var detail = detail || {}; - var event = new CustomEvent(type, { - bubbles: (bubbles !== undefined ? bubbles : true), - cancelable: (cancelable !== undefined ? cancelable : true), - detail: detail - }); - node.dispatchEvent(event); - return event; - }, - /** - * Fire an event asynchronously. - * @method asyncFire - * @param {string} type An event name. - * @param detail - * @param {Node} toNode Target node. - */ - asyncFire: function(/*inType, inDetail*/) { - this.async("fire", arguments); - }, - /** - * Remove class from old, add class to anew, if they exist - * @param classFollows - * @param anew A node. - * @param old A node - * @param className - */ - classFollows: function(anew, old, className) { - if (old) { - old.classList.remove(className); - } - if (anew) { - anew.classList.add(className); - } - } - }; + + - // no-operation function for handy stubs - var nop = function() {}; + - scope.api.instance.utils = utils; - scope.nop = nop; - scope.nob = nob; -})(Polymer); - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + Polymer('core-selector', { + publish: { + /** + * Gets or sets the selected element. Default to use the index + * of the item element. + * + * If you want a specific attribute value of the element to be + * used instead of index, set "valueattr" to that attribute name. + * + * Example: + * + * + *
+ *
+ *
+ *
+ * + * In multi-selection this should be an array of values. + * + * Example: + * + * + *
+ *
+ *
+ *
+ * + * this.$.selector.selected = ['foo', 'zot']; + * + * @attribute selected + * @type Object + * @default null + */ + selected: -1, + /** + * If true, multiple selections are allowed. + * + * @attribute multi + * @type boolean + * @default false + */ + multi: false, + + /** + * Specifies the attribute to be used for "selected" attribute. + * + * @attribute valueattr + * @type string + * @default 'name' + */ + valueattr: 'name', + + /** + * Specifies the CSS class to be used to add to the selected element. + * + * @attribute selectedClass + * @type string + * @default 'core-selected' + */ + selectedClass: 'core-selected', + + /** + * Specifies the property to be used to set on the selected element + * to indicate its active state. + * + * @attribute selectedProperty + * @type string + * @default '' + */ + selectedProperty: '', + + /** + * Specifies the property to be used to set on the selected element + * to indicate its active state. + * + * @attribute selectedProperty + * @type string + * @default 'active' + */ + selectedAttribute: 'active', + + /** + * Returns the currently selected element. In multi-selection this returns + * an array of selected elements. + * + * @attribute selectedItem + * @type Object + * @default null + */ + selectedItem: null, + + /** + * In single selection, this returns the model associated with the + * selected element. + * + * @attribute selectedModel + * @type Object + * @default null + */ + selectedModel: null, + + /** + * In single selection, this returns the selected index. + * + * @attribute selectedIndex + * @type number + * @default -1 + */ + selectedIndex: -1, + + /** + * The target element that contains items. If this is not set + * core-selector is the container. + * + * @attribute target + * @type Object + * @default null + */ + target: null, + + /** + * This can be used to query nodes from the target node to be used for + * selection items. Note this only works if the 'target' property is set. + * + * Example: + * + * + *
+ *
+ *
+ *
+ *

color = {{color}}

+ *
+ * + * @attribute itemSelector + * @type string + * @default '' + */ + itemsSelector: '', + + /** + * The event that would be fired from the item element to indicate + * it is being selected. + * + * @attribute activateEvent + * @type string + * @default 'tap' + */ + activateEvent: 'tap', + + /** + * Set this to true to disallow changing the selection via the + * `activateEvent`. + * + * @attribute notap + * @type boolean + * @default false + */ + notap: false, + }, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + - - + + }; - + Polymer('core-theme-aware', Platform.mixin({ - - - + attached: function() { + this.validateTheme(); + } + + }, Polymer.ThemeAware)); + + + + + + +