|
|
10 |
__coverage__['build/button-group/button-group.js'] = {"path":"build/button-group/button-group.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":43}}},"2":{"name":"ButtonGroup","line":22,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":23}}},"3":{"name":"(anonymous_3)","line":34,"loc":{"start":{"line":34,"column":14},"end":{"line":34,"column":25}}},"4":{"name":"(anonymous_4)","line":43,"loc":{"start":{"line":43,"column":12},"end":{"line":43,"column":23}}},"5":{"name":"(anonymous_5)","line":55,"loc":{"start":{"line":55,"column":16},"end":{"line":55,"column":27}}},"6":{"name":"(anonymous_6)","line":66,"loc":{"start":{"line":66,"column":24},"end":{"line":66,"column":35}}},"7":{"name":"(anonymous_7)","line":72,"loc":{"start":{"line":72,"column":21},"end":{"line":72,"column":35}}},"8":{"name":"(anonymous_8)","line":86,"loc":{"start":{"line":86,"column":23},"end":{"line":86,"column":34}}},"9":{"name":"(anonymous_9)","line":91,"loc":{"start":{"line":91,"column":31},"end":{"line":91,"column":45}}},"10":{"name":"(anonymous_10)","line":105,"loc":{"start":{"line":105,"column":18},"end":{"line":105,"column":29}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":186,"column":69}},"2":{"start":{"line":10,"column":0},"end":{"line":12,"column":43}},"3":{"start":{"line":22,"column":0},"end":{"line":24,"column":1}},"4":{"start":{"line":23,"column":4},"end":{"line":23,"column":62}},"5":{"start":{"line":27,"column":0},"end":{"line":183,"column":3}},"6":{"start":{"line":35,"column":8},"end":{"line":35,"column":48}},"7":{"start":{"line":44,"column":8},"end":{"line":45,"column":40}},"8":{"start":{"line":47,"column":8},"end":{"line":47,"column":91}},"9":{"start":{"line":56,"column":8},"end":{"line":56,"column":39}},"10":{"start":{"line":58,"column":8},"end":{"line":58,"column":53}},"11":{"start":{"line":67,"column":8},"end":{"line":70,"column":61}},"12":{"start":{"line":72,"column":8},"end":{"line":76,"column":11}},"13":{"start":{"line":73,"column":12},"end":{"line":75,"column":13}},"14":{"start":{"line":74,"column":16},"end":{"line":74,"column":36}},"15":{"start":{"line":78,"column":8},"end":{"line":78,"column":24}},"16":{"start":{"line":87,"column":8},"end":{"line":89,"column":18}},"17":{"start":{"line":91,"column":8},"end":{"line":94,"column":11}},"18":{"start":{"line":92,"column":12},"end":{"line":92,"column":38}},"19":{"start":{"line":93,"column":12},"end":{"line":93,"column":31}},"20":{"start":{"line":96,"column":8},"end":{"line":96,"column":22}},"21":{"start":{"line":106,"column":8},"end":{"line":111,"column":20}},"22":{"start":{"line":114,"column":8},"end":{"line":129,"column":9}},"23":{"start":{"line":115,"column":12},"end":{"line":115,"column":64}},"24":{"start":{"line":122,"column":12},"end":{"line":122,"column":60}},"25":{"start":{"line":124,"column":13},"end":{"line":129,"column":9}},"26":{"start":{"line":125,"column":12},"end":{"line":125,"column":41}},"27":{"start":{"line":126,"column":12},"end":{"line":126,"column":47}},"28":{"start":{"line":127,"column":12},"end":{"line":127,"column":48}},"29":{"start":{"line":128,"column":12},"end":{"line":128,"column":60}}},"branchMap":{"1":{"line":73,"type":"if","locations":[{"start":{"line":73,"column":12},"end":{"line":73,"column":12}},{"start":{"line":73,"column":12},"end":{"line":73,"column":12}}]},"2":{"line":114,"type":"if","locations":[{"start":{"line":114,"column":8},"end":{"line":114,"column":8}},{"start":{"line":114,"column":8},"end":{"line":114,"column":8}}]},"3":{"line":124,"type":"if","locations":[{"start":{"line":124,"column":13},"end":{"line":124,"column":13}},{"start":{"line":124,"column":13},"end":{"line":124,"column":13}}]},"4":{"line":124,"type":"binary-expr","locations":[{"start":{"line":124,"column":17},"end":{"line":124,"column":33}},{"start":{"line":124,"column":37},"end":{"line":124,"column":48}}]}},"code":["(function () { YUI.add('button-group', function (Y, NAME) {","","/**"," * A Widget to create groups of buttons"," *"," * @module button-group"," * @since 3.5.0"," */","","var CONTENT_BOX = \"contentBox\","," CLICK_EVENT = \"click\","," CLASS_NAMES = Y.ButtonCore.CLASS_NAMES;","","/**"," * Creates a ButtonGroup"," *"," * @class ButtonGroup"," * @extends Widget"," * @param config {Object} Configuration object"," * @constructor"," */","function ButtonGroup() {"," ButtonGroup.superclass.constructor.apply(this, arguments);","}","","/* ButtonGroup extends Widget */","Y.ButtonGroup = Y.extend(ButtonGroup, Y.Widget, {",""," /**"," * @method renderUI"," * @description Creates a visual representation of the widget based on existing parameters."," * @public"," */"," renderUI: function() {"," this.getButtons().plug(Y.Plugin.Button);"," },",""," /**"," * @method bindUI"," * @description Hooks up events for the widget"," * @public"," */"," bindUI: function() {"," var group = this,"," cb = group.get(CONTENT_BOX);",""," cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group);"," },",""," /**"," * @method getButtons"," * @description Returns all buttons inside this this button group"," * @public"," */"," getButtons: function() {"," var cb = this.get(CONTENT_BOX);",""," return cb.all(Y.ButtonGroup.BUTTON_SELECTOR);"," },",""," /**"," * @method getSelectedButtons"," * @description Returns all Y.Buttons instances that are selected"," * @public"," */"," getSelectedButtons: function() {"," var group = this,"," selected = [],"," buttons = group.getButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," buttons.each(function(node){"," if (node.hasClass(selectedClass)){"," selected.push(node);"," }"," });",""," return selected;"," },",""," /**"," * @method getSelectedValues"," * @description Returns the values of all Y.Button instances that are selected"," * @public"," */"," getSelectedValues: function() {"," var selected = this.getSelectedButtons(),"," values = [],"," value;",""," Y.Array.each(selected, function(node){"," value = node.getContent();"," values.push(value);"," });",""," return values;"," },",""," /**"," * @method _handleClick"," * @description A delegated click handler for when any button is clicked in the content box"," * @param e {Object} An event object"," * @private"," */"," _handleClick: function(e){"," var group = this,"," clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true),"," type = group.get('type'),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,"," isSelected = clickedNode.hasClass(selectedClass),"," buttons;",""," // TODO: Anything for 'push' groups?"," if (type === 'checkbox') {"," clickedNode.toggleClass(selectedClass, !isSelected);"," /**"," * @event selectionChange"," * @description fires when any button in the group changes its checked status"," * @param {Event} the event object. It contains an \"originEvent\" property"," * linking to the original DOM event that triggered the selection change"," */"," group.fire('selectionChange', {originEvent: e});"," }"," else if (type === 'radio' && !isSelected) {"," buttons = group.getButtons(); // Todo: getSelectedButtons()? Need it to return an arraylist then."," buttons.removeClass(selectedClass);"," clickedNode.addClass(selectedClass);"," group.fire('selectionChange', {originEvent: e});"," }"," }","","}, {"," // Y.ButtonGroup static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'buttongroup',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * @attribute type"," * @type String"," */"," type: {"," writeOnce: 'initOnly',"," value: 'radio'"," }"," },",""," /**"," * List of class names to use for ButtonGroups"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,"," "," /**"," * Selector used to find buttons inside a ButtonGroup"," * @property BUTTON_SELECTOR"," * @type {String}"," */"," BUTTON_SELECTOR: \"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]\"","});","","","}, '3.10.3', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget\"]});","","}());"]}; |