~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/yuilib/3.13.0/datatable-base/datatable-base-coverage.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
YUI 3.13.0 (build 508226d)
 
3
Copyright 2013 Yahoo! Inc. All rights reserved.
 
4
Licensed under the BSD License.
 
5
http://yuilibrary.com/license/
 
6
*/
 
7
 
 
8
if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
 
9
if (!__coverage__['build/datatable-base/datatable-base.js']) {
 
10
   __coverage__['build/datatable-base/datatable-base.js'] = {"path":"build/datatable-base/datatable-base.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,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0},"b":{"1":[0,0],"2":[0,0,0],"3":[0,0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0,0]},"f":{"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},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":236,"loc":{"start":{"line":236,"column":14},"end":{"line":236,"column":26}}},"3":{"name":"(anonymous_3)","line":249,"loc":{"start":{"line":249,"column":16},"end":{"line":249,"column":28}}},"4":{"name":"(anonymous_4)","line":284,"loc":{"start":{"line":284,"column":13},"end":{"line":284,"column":42}}},"5":{"name":"(anonymous_5)","line":302,"loc":{"start":{"line":302,"column":12},"end":{"line":302,"column":32}}},"6":{"name":"(anonymous_6)","line":317,"loc":{"start":{"line":317,"column":32},"end":{"line":317,"column":45}}},"7":{"name":"(anonymous_7)","line":328,"loc":{"start":{"line":328,"column":12},"end":{"line":328,"column":24}}},"8":{"name":"(anonymous_8)","line":346,"loc":{"start":{"line":346,"column":22},"end":{"line":346,"column":35}}},"9":{"name":"(anonymous_9)","line":360,"loc":{"start":{"line":360,"column":28},"end":{"line":360,"column":47}}},"10":{"name":"process","line":363,"loc":{"start":{"line":363,"column":8},"end":{"line":363,"column":31}}},"11":{"name":"(anonymous_11)","line":398,"loc":{"start":{"line":398,"column":17},"end":{"line":398,"column":29}}},"12":{"name":"(anonymous_12)","line":421,"loc":{"start":{"line":421,"column":26},"end":{"line":421,"column":39}}},"13":{"name":"(anonymous_13)","line":435,"loc":{"start":{"line":435,"column":14},"end":{"line":435,"column":26}}},"14":{"name":"(anonymous_14)","line":455,"loc":{"start":{"line":455,"column":34},"end":{"line":455,"column":47}}},"15":{"name":"(anonymous_15)","line":463,"loc":{"start":{"line":463,"column":34},"end":{"line":463,"column":47}}},"16":{"name":"(anonymous_16)","line":468,"loc":{"start":{"line":468,"column":32},"end":{"line":468,"column":45}}},"17":{"name":"(anonymous_17)","line":475,"loc":{"start":{"line":475,"column":33},"end":{"line":475,"column":45}}},"18":{"name":"(anonymous_18)","line":520,"loc":{"start":{"line":520,"column":12},"end":{"line":520,"column":24}}},"19":{"name":"(anonymous_19)","line":534,"loc":{"start":{"line":534,"column":19},"end":{"line":534,"column":34}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":694,"column":3}},"2":{"start":{"line":219,"column":0},"end":{"line":676,"column":3}},"3":{"start":{"line":237,"column":8},"end":{"line":237,"column":48}},"4":{"start":{"line":239,"column":8},"end":{"line":239,"column":64}},"5":{"start":{"line":250,"column":8},"end":{"line":252,"column":9}},"6":{"start":{"line":251,"column":12},"end":{"line":251,"column":32}},"7":{"start":{"line":285,"column":8},"end":{"line":286,"column":58}},"8":{"start":{"line":303,"column":8},"end":{"line":304,"column":57}},"9":{"start":{"line":318,"column":8},"end":{"line":318,"column":52}},"10":{"start":{"line":329,"column":8},"end":{"line":335,"column":50}},"11":{"start":{"line":347,"column":8},"end":{"line":347,"column":24}},"12":{"start":{"line":361,"column":8},"end":{"line":361,"column":32}},"13":{"start":{"line":363,"column":8},"end":{"line":375,"column":9}},"14":{"start":{"line":364,"column":12},"end":{"line":364,"column":28}},"15":{"start":{"line":366,"column":12},"end":{"line":374,"column":13}},"16":{"start":{"line":367,"column":16},"end":{"line":367,"column":30}},"17":{"start":{"line":369,"column":16},"end":{"line":373,"column":17}},"18":{"start":{"line":370,"column":20},"end":{"line":370,"column":42}},"19":{"start":{"line":372,"column":20},"end":{"line":372,"column":45}},"20":{"start":{"line":377,"column":8},"end":{"line":377,"column":25}},"21":{"start":{"line":387,"column":8},"end":{"line":387,"column":46}},"22":{"start":{"line":399,"column":8},"end":{"line":401,"column":11}},"23":{"start":{"line":405,"column":8},"end":{"line":405,"column":63}},"24":{"start":{"line":410,"column":8},"end":{"line":410,"column":80}},"25":{"start":{"line":422,"column":8},"end":{"line":422,"column":70}},"26":{"start":{"line":424,"column":8},"end":{"line":424,"column":38}},"27":{"start":{"line":436,"column":8},"end":{"line":437,"column":36}},"28":{"start":{"line":439,"column":8},"end":{"line":511,"column":9}},"29":{"start":{"line":440,"column":12},"end":{"line":448,"column":45}},"30":{"start":{"line":453,"column":12},"end":{"line":505,"column":13}},"31":{"start":{"line":454,"column":16},"end":{"line":504,"column":19}},"32":{"start":{"line":456,"column":24},"end":{"line":456,"column":43}},"33":{"start":{"line":457,"column":24},"end":{"line":457,"column":59}},"34":{"start":{"line":461,"column":24},"end":{"line":461,"column":66}},"35":{"start":{"line":464,"column":24},"end":{"line":464,"column":43}},"36":{"start":{"line":465,"column":24},"end":{"line":465,"column":59}},"37":{"start":{"line":466,"column":24},"end":{"line":466,"column":66}},"38":{"start":{"line":469,"column":24},"end":{"line":469,"column":43}},"39":{"start":{"line":470,"column":24},"end":{"line":470,"column":59}},"40":{"start":{"line":471,"column":24},"end":{"line":471,"column":66}},"41":{"start":{"line":476,"column":24},"end":{"line":476,"column":63}},"42":{"start":{"line":478,"column":24},"end":{"line":480,"column":54}},"43":{"start":{"line":486,"column":24},"end":{"line":487,"column":54}},"44":{"start":{"line":489,"column":24},"end":{"line":492,"column":25}},"45":{"start":{"line":490,"column":28},"end":{"line":491,"column":80}},"46":{"start":{"line":494,"column":24},"end":{"line":497,"column":25}},"47":{"start":{"line":495,"column":28},"end":{"line":496,"column":77}},"48":{"start":{"line":499,"column":24},"end":{"line":502,"column":25}},"49":{"start":{"line":500,"column":28},"end":{"line":501,"column":79}},"50":{"start":{"line":510,"column":12},"end":{"line":510,"column":38}},"51":{"start":{"line":521,"column":8},"end":{"line":523,"column":9}},"52":{"start":{"line":522,"column":12},"end":{"line":522,"column":57}},"53":{"start":{"line":536,"column":8},"end":{"line":536,"column":80}},"54":{"start":{"line":679,"column":0},"end":{"line":681,"column":17}}},"branchMap":{"1":{"line":250,"type":"if","locations":[{"start":{"line":250,"column":8},"end":{"line":250,"column":8}},{"start":{"line":250,"column":8},"end":{"line":250,"column":8}}]},"2":{"line":285,"type":"binary-expr","locations":[{"start":{"line":285,"column":15},"end":{"line":285,"column":24}},{"start":{"line":285,"column":28},"end":{"line":285,"column":45}},{"start":{"line":286,"column":12},"end":{"line":286,"column":57}}]},"3":{"line":303,"type":"binary-expr","locations":[{"start":{"line":303,"column":15},"end":{"line":303,"column":24}},{"start":{"line":303,"column":28},"end":{"line":303,"column":44}},{"start":{"line":304,"column":12},"end":{"line":304,"column":56}}]},"4":{"line":318,"type":"binary-expr","locations":[{"start":{"line":318,"column":36},"end":{"line":318,"column":44}},{"start":{"line":318,"column":48},"end":{"line":318,"column":50}}]},"5":{"line":369,"type":"if","locations":[{"start":{"line":369,"column":16},"end":{"line":369,"column":16}},{"start":{"line":369,"column":16},"end":{"line":369,"column":16}}]},"6":{"line":405,"type":"binary-expr","locations":[{"start":{"line":405,"column":36},"end":{"line":405,"column":55}},{"start":{"line":405,"column":59},"end":{"line":405,"column":61}}]},"7":{"line":422,"type":"cond-expr","locations":[{"start":{"line":422,"column":45},"end":{"line":422,"column":56}},{"start":{"line":422,"column":59},"end":{"line":422,"column":69}}]},"8":{"line":439,"type":"if","locations":[{"start":{"line":439,"column":8},"end":{"line":439,"column":8}},{"start":{"line":439,"column":8},"end":{"line":439,"column":8}}]},"9":{"line":453,"type":"if","locations":[{"start":{"line":453,"column":12},"end":{"line":453,"column":12}},{"start":{"line":453,"column":12},"end":{"line":453,"column":12}}]},"10":{"line":478,"type":"binary-expr","locations":[{"start":{"line":478,"column":42},"end":{"line":478,"column":56}},{"start":{"line":479,"column":28},"end":{"line":480,"column":53}}]},"11":{"line":486,"type":"binary-expr","locations":[{"start":{"line":486,"column":44},"end":{"line":486,"column":60}},{"start":{"line":487,"column":28},"end":{"line":487,"column":53}}]},"12":{"line":489,"type":"if","locations":[{"start":{"line":489,"column":24},"end":{"line":489,"column":24}},{"start":{"line":489,"column":24},"end":{"line":489,"column":24}}]},"13":{"line":494,"type":"if","locations":[{"start":{"line":494,"column":24},"end":{"line":494,"column":24}},{"start":{"line":494,"column":24},"end":{"line":494,"column":24}}]},"14":{"line":499,"type":"if","locations":[{"start":{"line":499,"column":24},"end":{"line":499,"column":24}},{"start":{"line":499,"column":24},"end":{"line":499,"column":24}}]},"15":{"line":521,"type":"if","locations":[{"start":{"line":521,"column":8},"end":{"line":521,"column":8}},{"start":{"line":521,"column":8},"end":{"line":521,"column":8}}]},"16":{"line":536,"type":"binary-expr","locations":[{"start":{"line":536,"column":15},"end":{"line":536,"column":27}},{"start":{"line":536,"column":32},"end":{"line":536,"column":54}},{"start":{"line":536,"column":58},"end":{"line":536,"column":78}}]}},"code":["(function () { YUI.add('datatable-base', function (Y, NAME) {","","/**","A Widget for displaying tabular data.  The base implementation of DataTable","provides the ability to dynamically generate an HTML table from a set of column","configurations and row data.","","Two classes are included in the `datatable-base` module: `Y.DataTable` and","`Y.DataTable.Base`.","","@module datatable","@submodule datatable-base","@main datatable","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","A Widget for displaying tabular data.  Before feature modules are `use()`d,","this class is functionally equivalent to DataTable.Base.  However, feature","modules can modify this class in non-destructive ways, expanding the API and","functionality.","","This is the primary DataTable class.  Out of the box, it provides the ability","to dynamically generate an HTML table from a set of column configurations and","row data.  But feature module inclusion can add table sorting, pagintaion,","highlighting, selection, and more.","","<pre><code>","// The functionality of this table would require additional modules be use()d,","// but the feature APIs are aggregated onto Y.DataTable.","// (Snippet is for illustration. Not all features are available today.)","var table = new Y.DataTable({","    columns: [","        { type: 'checkbox', defaultChecked: true },","        { key: 'firstName', sortable: true, resizable: true },","        { key: 'lastName', sortable: true },","        { key: 'role', formatter: toRoleName }","    ],","    data: {","        source: 'http://myserver.com/service/json',","        type: 'json',","        schema: {","            resultListLocator: 'results.users',","            fields: [","                'username',","                'firstName',","                'lastName',","                { key: 'role', type: 'number' }","            ]","        }","    },","    recordType: UserModel,","    pagedData: {","        location: 'footer',","        pageSizes: [20, 50, 'all'],","        rowsPerPage: 20,","        pageLinks: 5","    },","    editable: true","});","</code></pre>","","### Column Configuration","","The column configurations are set in the form of an array of objects, where","each object corresponds to a column.  For columns populated directly from the","row data, a 'key' property is required to bind the column to that property or","attribute in the row data.","","Not all columns need to relate to row data, nor do all properties or attributes","of the row data need to have a corresponding column.  However, only those","columns included in the `columns` configuration attribute will be rendered.","","Other column configuration properties are supported by the configured","`view`, class as well as any features added by plugins or class extensions.","See the description of DataTable.TableView and its subviews","DataTable.HeaderView, DataTable.BodyView, and DataTable.FooterView (and other","DataTable feature classes) to see what column properties they support.","","Some examples of column configurations would be:","","<pre><code>","// Basic","var columns = [{ key: 'firstName' }, { key: 'lastName' }, { key: 'age' }];","","// For columns without any additional configuration, strings can be used","var columns = ['firstName', 'lastName', 'age'];","","// Multi-row column headers (see DataTable.HeaderView for details)","var columns = [","    {","        label: 'Name',","        children: [","            { key: 'firstName' },","            { key: 'lastName' }","        ]","    },","    'age' // mixing and matching objects and strings is ok","];","","// Including columns that are not related 1:1 to row data fields/attributes","// (See DataTable.BodyView for details)","var columns = [","    {","        label: 'Name', // Needed for the column header","        formatter: function (o) {","            // Fill the column cells with data from firstName and lastName","            if (o.data.age > 55) {","                o.className += ' senior';","            }","            return o.data.lastName + ', ' + o.data.firstName;","        }","    },","    'age'","];","","// Columns that include feature configurations (for illustration; not all","// features are available today).","var columns = [","    { type: 'checkbox', defaultChecked: true },","    { key: 'firstName', sortable: true, resizable: true, min-width: '300px' },","    { key: 'lastName', sortable: true, resizable: true, min-width: '300px' },","    { key: 'age', emptyCellValue: '<em>unknown</em>' }","];","</code></pre>","","### Row Data Configuration","","The `data` configuration attribute is responsible for housing the data objects","that will be rendered as rows.  You can provide this information in two ways by default:","","1. An array of simple objects with key:value pairs","2. A ModelList of Base-based class instances (presumably Model subclass","   instances)","","If an array of objects is passed, it will be translated into a ModelList filled","with instances of the class provided to the `recordType` attribute.  This","attribute can also create a custom Model subclass from an array of field names","or an object of attribute configurations.  If no `recordType` is provided, one","will be created for you from available information (see `_initRecordType`).","Providing either your own ModelList instance for `data`, or at least Model","class for `recordType`, is the best way to control client-server","synchronization when modifying data on the client side.","","The ModelList instance that manages the table's data is available in the `data`","property on the DataTable instance.","","","### Rendering","","Table rendering is a collaborative process between the DataTable and its","configured `view`. The DataTable creates an instance of the configured `view`","(DataTable.TableView by default), and calls its `render()` method.","DataTable.TableView, for instance, then creates the `<table>` and `<caption>`,","then delegates the rendering of the specific sections of the table to subviews,","which can be configured as `headerView`, `bodyView`, and `footerView`.","DataTable.TableView defaults the `headerView` to DataTable.HeaderView and the","`bodyView` to DataTable.BodyView, but leaves the `footerView` unassigned.","Setting any subview to `null` will result in that table section not being","rendered.","","@class DataTable","@extends DataTable.Base","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","The baseline implementation of a DataTable.  This class should be used","primarily as a superclass for a custom DataTable with a specific set of","features.  Because features can be composed onto `Y.DataTable`, custom","subclasses of DataTable.Base will remain unmodified when new feature modules","are loaded.","","Example usage might look like this:","","<pre><code>","// Custom subclass with only sorting and mutability added.  If other datatable","// feature modules are loaded, this class will not be affected.","var MyTableClass = Y.Base.create('table', Y.DataTable.Base,","                       [ Y.DataTable.Sortable, Y.DataTable.Mutable ]);","","var table = new MyTableClass({","    columns: ['firstName', 'lastName', 'age'],","    data: [","        { firstName: 'Frank', lastName: 'Zappa', age: 71 },","        { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },","        { firstName: 'Albert', lastName: 'Einstein', age: 132 },","        ...","    ]","});","","table.render('#over-there');","","// DataTable.Base can be instantiated if a featureless table is needed.","var table = new Y.DataTable.Base({","    columns: ['firstName', 'lastName', 'age'],","    data: [","        { firstName: 'Frank', lastName: 'Zappa', age: 71 },","        { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },","        { firstName: 'Albert', lastName: 'Einstein', age: 132 },","        ...","    ]","});","","table.render('#in-here');","</code></pre>","","DataTable.Base is built from DataTable.Core, and sets the default `view`","to `Y.DataTable.TableView`.","","@class Base","@extends Widget","@uses DataTable.Core","@namespace DataTable","@since 3.5.0","**/","Y.DataTable.Base = Y.Base.create('datatable', Y.Widget, [Y.DataTable.Core], {","","    /**","    Pass through to `delegate()` called from the `contentBox`.","","    @method delegate","    @param type {String} the event type to delegate","    @param fn {Function} the callback function to execute.  This function","                 will be provided the event object for the delegated event.","    @param spec {String|Function} a selector that must match the target of the","                 event or a function to test target and its parents for a match","    @param context {Object} optional argument that specifies what 'this' refers to","    @param args* {any} 0..n additional arguments to pass on to the callback","                 function.  These arguments will be added after the event object.","    @return {EventHandle} the detach handle","    @since 3.5.0","    **/","    delegate: function () {","        var contentBox = this.get('contentBox');","","        return contentBox.delegate.apply(contentBox, arguments);","    },","","    /**","    Destroys the table `View` if it's been created.","","    @method destructor","    @protected","    @since 3.6.0","    **/","    destructor: function () {","        if (this.view) {","            this.view.destroy();","        }","    },","","    /**","    Returns the `<td>` Node from the given row and column index.  Alternately,","    the `seed` can be a Node.  If so, the nearest ancestor cell is returned.","    If the `seed` is a cell, it is returned.  If there is no cell at the given","    coordinates, `null` is returned.","","    Optionally, include an offset array or string to return a cell near the","    cell identified by the `seed`.  The offset can be an array containing the","    number of rows to shift followed by the number of columns to shift, or one","    of \"above\", \"below\", \"next\", or \"previous\".","","    <pre><code>// Previous cell in the previous row","    var cell = table.getCell(e.target, [-1, -1]);","","    // Next cell","    var cell = table.getCell(e.target, 'next');","    var cell = table.getCell(e.taregt, [0, 1];</pre></code>","","    This is actually just a pass through to the `view` instance's method","    by the same name.","","    @method getCell","    @param {Number[]|Node} seed Array of row and column indexes, or a Node that","        is either the cell itself or a descendant of one.","    @param {Number[]|String} [shift] Offset by which to identify the returned","        cell Node","    @return {Node}","    @since 3.5.0","    **/","    getCell: function (/* seed, shift */) {","        return this.view && this.view.getCell &&","            this.view.getCell.apply(this.view, arguments);","    },","","    /**","    Returns the `<tr>` Node from the given row index, Model, or Model's","    `clientId`.  If the rows haven't been rendered yet, or if the row can't be","    found by the input, `null` is returned.","","    This is actually just a pass through to the `view` instance's method","    by the same name.","","    @method getRow","    @param {Number|String|Model} id Row index, Model instance, or clientId","    @return {Node}","    @since 3.5.0","    **/","    getRow: function (/* id */) {","        return this.view && this.view.getRow &&","            this.view.getRow.apply(this.view, arguments);","    },","","    /**","    Updates the `_displayColumns` property.","","    @method _afterDisplayColumnsChange","    @param {EventFacade} e The `columnsChange` event","    @protected","    @since 3.6.0","    **/","    // FIXME: This is a kludge for back compat with features that reference","    // _displayColumns.  They should be updated to TableView plugins.","    _afterDisplayColumnsChange: function (e) {","        this._extractDisplayColumns(e.newVal || []);","    },","","    /**","    Attaches subscriptions to relay core change events to the view.","","    @method bindUI","    @protected","    @since 3.6.0","    **/","    bindUI: function () {","        this._eventHandles.relayCoreChanges = this.after(","            ['columnsChange',","             'dataChange',","             'summaryChange',","             'captionChange',","             'widthChange'],","            Y.bind('_relayCoreAttrChange', this));","    },","","    /**","    The default behavior of the `renderView` event.  Calls `render()` on the","    `View` instance on the event.","","    @method _defRenderViewFn","    @param {EventFacade} e The `renderView` event","    @protected","    **/","    _defRenderViewFn: function (e) {","        e.view.render();","    },","","    /**","    Processes the full column array, distilling the columns down to those that","    correspond to cell data columns.","","    @method _extractDisplayColumns","    @param {Object[]} columns The full set of table columns","    @protected","    **/","    // FIXME: this is a kludge for back compat, duplicating logic in the","    // tableView","    _extractDisplayColumns: function (columns) {","        var displayColumns = [];","","        function process(cols) {","            var i, len, col;","","            for (i = 0, len = cols.length; i < len; ++i) {","                col = cols[i];","","                if (Y.Lang.isArray(col.children)) {","                    process(col.children);","                } else {","                    displayColumns.push(col);","                }","            }","        }","","        process(columns);","","        /**","        Array of the columns that correspond to those with value cells in the","        data rows. Excludes colspan header columns (configured with `children`).","","        @property _displayColumns","        @type {Object[]}","        @since 3.5.0","        **/","        this._displayColumns = displayColumns;","    },","","    /**","    Sets up the instance's events.","","    @method initializer","    @param {Object} [config] Configuration object passed at construction","    @protected","    @since 3.6.0","    **/","    initializer: function () {","        this.publish('renderView', {","            defaultFn: Y.bind('_defRenderViewFn', this)","        });","","        // Have to use get('columns'), not config.columns because the setter","        // needs to transform string columns to objects.","        this._extractDisplayColumns(this.get('columns') || []);","","        // FIXME: kludge for back compat of features that reference","        // _displayColumns on the instance.  They need to be updated to","        // TableView plugins, most likely.","        this.after('columnsChange', Y.bind('_afterDisplayColumnsChange', this));","    },","","    /**","    Relays attribute changes to the instance's `view`.","","    @method _relayCoreAttrChange","    @param {EventFacade} e The change event","    @protected","    @since 3.6.0","    **/","    _relayCoreAttrChange: function (e) {","        var attr = (e.attrName === 'data') ? 'modelList' : e.attrName;","","        this.view.set(attr, e.newVal);","    },","","    /**","    Instantiates the configured `view` class that will be responsible for","    setting up the View class.","","    @method @renderUI","    @protected","    @since 3.6.0","    **/","    renderUI: function () {","        var self = this,","            View = this.get('view');","","        if (View) {","            this.view = new View(","                Y.merge(","                    this.getAttrs(),","                    {","                        host     : this,","                        container: this.get('contentBox'),","                        modelList: this.data","                    },","                    this.get('viewConfig')));","","            // For back compat, share the view instances and primary nodes","            // on this instance.","            // TODO: Remove this?","            if (!this._eventHandles.legacyFeatureProps) {","                this._eventHandles.legacyFeatureProps = this.view.after({","                    renderHeader: function (e) {","                        self.head = e.view;","                        self._theadNode = e.view.theadNode;","                        // TODO: clean up the repetition.","                        // This is here so that subscribers to renderHeader etc","                        // have access to this._tableNode from the DT instance","                        self._tableNode = e.view.get('container');","                    },","                    renderFooter: function (e) {","                        self.foot = e.view;","                        self._tfootNode = e.view.tfootNode;","                        self._tableNode = e.view.get('container');","                    },","                    renderBody: function (e) {","                        self.body = e.view;","                        self._tbodyNode = e.view.tbodyNode;","                        self._tableNode = e.view.get('container');","                    },","                    // FIXME: guarantee that the properties are available, even","                    // if the configured (or omitted) views don't create them","                    renderTable: function () {","                        var contentBox = this.get('container');","","                        self._tableNode = this.tableNode ||","                            contentBox.one('.' + this.getClassName('table') +","                                           ', table');","","                        // FIXME: _captionNode isn't available until after","                        // renderTable unless in the renderX subs I look for","                        // it under the container's parentNode (to account for","                        // scroll breaking out the caption table).","                        self._captionNode = this.captionNode ||","                            contentBox.one('caption');","","                        if (!self._theadNode) {","                            self._theadNode = contentBox.one(","                                '.' + this.getClassName('columns') + ', thead');","                        }","","                        if (!self._tbodyNode) {","                            self._tbodyNode = contentBox.one(","                                '.' + this.getClassName('data') + ', tbody');","                        }","","                        if (!self._tfootNode) {","                            self._tfootNode = contentBox.one(","                                '.' + this.getClassName('footer') + ', tfoot');","                        }","                    }","                });","            }","","            // To *somewhat* preserve table.on('renderHeader', fn) in the","            // form of table.on('table:renderHeader', fn), because I couldn't","            // figure out another option.","            this.view.addTarget(this);","        }","    },","","    /**","    Fires the `renderView` event, delegating UI updates to the configured View.","","    @method syncUI","    @since 3.5.0","    **/","    syncUI: function () {","        if (this.view) {","            this.fire('renderView', { view: this.view });","        }","    },","","    /**","    Verifies the input value is a function with a `render` method on its","    prototype.  `null` is also accepted to remove the default View.","","    @method _validateView","    @protected","    @since 3.5.0","    **/","    _validateView: function (val) {","        // TODO support View instances?","        return val === null || (Y.Lang.isFunction(val) && val.prototype.render);","    }","}, {","    ATTRS: {","        /**","        The View class used to render the `<table>` into the Widget's","        `contentBox`.  This View can handle the entire table rendering itself","        or delegate to other Views.","","        It is not strictly necessary that the class function assigned here be","        a View subclass.  It must however have a `render()` method.","","        When the DataTable is rendered, an instance of this View will be","        created and its `render()` method called.  The View instance will be","        assigned to the DataTable instance's `view` property.","","        @attribute view","        @type {Function}","        @default Y.DataTable.TableView","        @since 3.6.0","        **/","        view: {","            value: Y.DataTable.TableView,","            validator: '_validateView'","        },","","        /**","        Configuration object passed to the class constructor in `view`","        during render.","","        @attribute viewConfig","        @type {Object}","        @default undefined (initially unset)","        @protected","        @since 3.6.0","        **/","        viewConfig: {}","","        /**","        If the View class assigned to the DataTable's `view` attribute supports","        it, this class will be used for rendering the contents of the","        `<thead>`&mdash;the column headers for the table.","","        Similar to `view`, the instance of this View will be assigned to the","        DataTable instance's `head` property.","","        It is not strictly necessary that the class function assigned here be","        a View subclass.  It must however have a `render()` method.","","        @attribute headerView","        @type {Function|Object}","        @default Y.DataTable.HeaderView","        @since 3.5.0","        **/","        /*","        headerView: {","            value: Y.DataTable.HeaderView,","            validator: '_validateView'","        },","        */","","        /**","        Configuration object passed to the class constructor in `headerView`","        during render.","","        @attribute headerConfig","        @type {Object}","        @default undefined (initially unset)","        @protected","        @since 3.6.0","        **/","        //headConfig: {},","","        /**","        If the View class assigned to the DataTable's `view` attribute supports","        it, this class will be used for rendering the contents of the `<tfoot>`.","","        Similar to `view`, the instance of this View will be assigned to the","        DataTable instance's `foot` property.","","        It is not strictly necessary that the class function assigned here be","        a View subclass.  It must however have a `render()` method.","","        @attribute footerView","        @type {Function|Object}","        @since 3.5.0","        **/","        /*","        footerView: {","            validator: '_validateView'","        },","        */","","        /**","        Configuration object passed to the class constructor in `footerView`","        during render.","","        @attribute footerConfig","        @type {Object}","        @default undefined (initially unset)","        @protected","        @since 3.6.0","        **/","        //footerConfig: {},","","        /**","        If the View class assigned to the DataTable's `view` attribute supports","        it, this class will be used for rendering the contents of the `<tbody>`","        including all data rows.","","        Similar to `view`, the instance of this View will be assigned to the","        DataTable instance's `body` property.","","        It is not strictly necessary that the class function assigned here be","        a View subclass.  It must however have a `render()` method.","","        @attribute bodyView","        @type {Function}","        @default Y.DataTable.BodyView","        @since 3.5.0","        **/","        /*","        bodyView: {","            value: Y.DataTable.BodyView,","            validator: '_validateView'","        },","        */","","        /**","        Configuration object passed to the class constructor in `bodyView`","        during render.","","        @attribute bodyConfig","        @type {Object}","        @default undefined (initially unset)","        @protected","        @since 3.6.0","        **/","        //bodyConfig: {}","    }","});","","// The DataTable API docs are above DataTable.Base docs.","Y.DataTable = Y.mix(","    Y.Base.create('datatable', Y.DataTable.Base, []), // Create the class","    Y.DataTable); // Migrate static and namespaced classes","","","}, '3.13.0', {","    \"requires\": [","        \"datatable-core\",","        \"datatable-table\",","        \"datatable-head\",","        \"datatable-body\",","        \"base-build\",","        \"widget\"","    ],","    \"skinnable\": true","});","","}());"]};
 
11
}
 
12
var __cov_rX2UuRixIqrM1QstWIi4lQ = __coverage__['build/datatable-base/datatable-base.js'];
 
13
__cov_rX2UuRixIqrM1QstWIi4lQ.s['1']++;YUI.add('datatable-base',function(Y,NAME){__cov_rX2UuRixIqrM1QstWIi4lQ.f['1']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['2']++;Y.DataTable.Base=Y.Base.create('datatable',Y.Widget,[Y.DataTable.Core],{delegate:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['2']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['3']++;var contentBox=this.get('contentBox');__cov_rX2UuRixIqrM1QstWIi4lQ.s['4']++;return contentBox.delegate.apply(contentBox,arguments);},destructor:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['3']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['5']++;if(this.view){__cov_rX2UuRixIqrM1QstWIi4lQ.b['1'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['6']++;this.view.destroy();}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['1'][1]++;}},getCell:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['4']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['7']++;return(__cov_rX2UuRixIqrM1QstWIi4lQ.b['2'][0]++,this.view)&&(__cov_rX2UuRixIqrM1QstWIi4lQ.b['2'][1]++,this.view.getCell)&&(__cov_rX2UuRixIqrM1QstWIi4lQ.b['2'][2]++,this.view.getCell.apply(this.view,arguments));},getRow:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['5']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['8']++;return(__cov_rX2UuRixIqrM1QstWIi4lQ.b['3'][0]++,this.view)&&(__cov_rX2UuRixIqrM1QstWIi4lQ.b['3'][1]++,this.view.getRow)&&(__cov_rX2UuRixIqrM1QstWIi4lQ.b['3'][2]++,this.view.getRow.apply(this.view,arguments));},_afterDisplayColumnsChange:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['6']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['9']++;this._extractDisplayColumns((__cov_rX2UuRixIqrM1QstWIi4lQ.b['4'][0]++,e.newVal)||(__cov_rX2UuRixIqrM1QstWIi4lQ.b['4'][1]++,[]));},bindUI:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['7']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['10']++;this._eventHandles.relayCoreChanges=this.after(['columnsChange','dataChange','summaryChange','captionChange','widthChange'],Y.bind('_relayCoreAttrChange',this));},_defRenderViewFn:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['8']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['11']++;e.view.render();},_extractDisplayColumns:function(columns){__cov_rX2UuRixIqrM1QstWIi4lQ.f['9']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['12']++;var displayColumns=[];__cov_rX2UuRixIqrM1QstWIi4lQ.s['13']++;function process(cols){__cov_rX2UuRixIqrM1QstWIi4lQ.f['10']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['14']++;var i,len,col;__cov_rX2UuRixIqrM1QstWIi4lQ.s['15']++;for(i=0,len=cols.length;i<len;++i){__cov_rX2UuRixIqrM1QstWIi4lQ.s['16']++;col=cols[i];__cov_rX2UuRixIqrM1QstWIi4lQ.s['17']++;if(Y.Lang.isArray(col.children)){__cov_rX2UuRixIqrM1QstWIi4lQ.b['5'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['18']++;process(col.children);}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['5'][1]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['19']++;displayColumns.push(col);}}}__cov_rX2UuRixIqrM1QstWIi4lQ.s['20']++;process(columns);__cov_rX2UuRixIqrM1QstWIi4lQ.s['21']++;this._displayColumns=displayColumns;},initializer:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['11']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['22']++;this.publish('renderView',{defaultFn:Y.bind('_defRenderViewFn',this)});__cov_rX2UuRixIqrM1QstWIi4lQ.s['23']++;this._extractDisplayColumns((__cov_rX2UuRixIqrM1QstWIi4lQ.b['6'][0]++,this.get('columns'))||(__cov_rX2UuRixIqrM1QstWIi4lQ.b['6'][1]++,[]));__cov_rX2UuRixIqrM1QstWIi4lQ.s['24']++;this.after('columnsChange',Y.bind('_afterDisplayColumnsChange',this));},_relayCoreAttrChange:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['12']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['25']++;var attr=e.attrName==='data'?(__cov_rX2UuRixIqrM1QstWIi4lQ.b['7'][0]++,'modelList'):(__cov_rX2UuRixIqrM1QstWIi4lQ.b['7'][1]++,e.attrName);__cov_rX2UuRixIqrM1QstWIi4lQ.s['26']++;this.view.set(attr,e.newVal);},renderUI:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['13']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['27']++;var self=this,View=this.get('view');__cov_rX2UuRixIqrM1QstWIi4lQ.s['28']++;if(View){__cov_rX2UuRixIqrM1QstWIi4lQ.b['8'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['29']++;this.view=new View(Y.merge(this.getAttrs(),{host:this,container:this.get('contentBox'),modelList:this.data},this.get('viewConfig')));__cov_rX2UuRixIqrM1QstWIi4lQ.s['30']++;if(!this._eventHandles.legacyFeatureProps){__cov_rX2UuRixIqrM1QstWIi4lQ.b['9'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['31']++;this._eventHandles.legacyFeatureProps=this.view.after({renderHeader:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['14']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['32']++;self.head=e.view;__cov_rX2UuRixIqrM1QstWIi4lQ.s['33']++;self._theadNode=e.view.theadNode;__cov_rX2UuRixIqrM1QstWIi4lQ.s['34']++;self._tableNode=e.view.get('container');},renderFooter:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['15']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['35']++;self.foot=e.view;__cov_rX2UuRixIqrM1QstWIi4lQ.s['36']++;self._tfootNode=e.view.tfootNode;__cov_rX2UuRixIqrM1QstWIi4lQ.s['37']++;self._tableNode=e.view.get('container');},renderBody:function(e){__cov_rX2UuRixIqrM1QstWIi4lQ.f['16']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['38']++;self.body=e.view;__cov_rX2UuRixIqrM1QstWIi4lQ.s['39']++;self._tbodyNode=e.view.tbodyNode;__cov_rX2UuRixIqrM1QstWIi4lQ.s['40']++;self._tableNode=e.view.get('container');},renderTable:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['17']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['41']++;var contentBox=this.get('container');__cov_rX2UuRixIqrM1QstWIi4lQ.s['42']++;self._tableNode=(__cov_rX2UuRixIqrM1QstWIi4lQ.b['10'][0]++,this.tableNode)||(__cov_rX2UuRixIqrM1QstWIi4lQ.b['10'][1]++,contentBox.one('.'+this.getClassName('table')+', table'));__cov_rX2UuRixIqrM1QstWIi4lQ.s['43']++;self._captionNode=(__cov_rX2UuRixIqrM1QstWIi4lQ.b['11'][0]++,this.captionNode)||(__cov_rX2UuRixIqrM1QstWIi4lQ.b['11'][1]++,contentBox.one('caption'));__cov_rX2UuRixIqrM1QstWIi4lQ.s['44']++;if(!self._theadNode){__cov_rX2UuRixIqrM1QstWIi4lQ.b['12'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['45']++;self._theadNode=contentBox.one('.'+this.getClassName('columns')+', thead');}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['12'][1]++;}__cov_rX2UuRixIqrM1QstWIi4lQ.s['46']++;if(!self._tbodyNode){__cov_rX2UuRixIqrM1QstWIi4lQ.b['13'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['47']++;self._tbodyNode=contentBox.one('.'+this.getClassName('data')+', tbody');}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['13'][1]++;}__cov_rX2UuRixIqrM1QstWIi4lQ.s['48']++;if(!self._tfootNode){__cov_rX2UuRixIqrM1QstWIi4lQ.b['14'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['49']++;self._tfootNode=contentBox.one('.'+this.getClassName('footer')+', tfoot');}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['14'][1]++;}}});}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['9'][1]++;}__cov_rX2UuRixIqrM1QstWIi4lQ.s['50']++;this.view.addTarget(this);}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['8'][1]++;}},syncUI:function(){__cov_rX2UuRixIqrM1QstWIi4lQ.f['18']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['51']++;if(this.view){__cov_rX2UuRixIqrM1QstWIi4lQ.b['15'][0]++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['52']++;this.fire('renderView',{view:this.view});}else{__cov_rX2UuRixIqrM1QstWIi4lQ.b['15'][1]++;}},_validateView:function(val){__cov_rX2UuRixIqrM1QstWIi4lQ.f['19']++;__cov_rX2UuRixIqrM1QstWIi4lQ.s['53']++;return(__cov_rX2UuRixIqrM1QstWIi4lQ.b['16'][0]++,val===null)||(__cov_rX2UuRixIqrM1QstWIi4lQ.b['16'][1]++,Y.Lang.isFunction(val))&&(__cov_rX2UuRixIqrM1QstWIi4lQ.b['16'][2]++,val.prototype.render);}},{ATTRS:{view:{value:Y.DataTable.TableView,validator:'_validateView'},viewConfig:{}}});__cov_rX2UuRixIqrM1QstWIi4lQ.s['54']++;Y.DataTable=Y.mix(Y.Base.create('datatable',Y.DataTable.Base,[]),Y.DataTable);},'3.13.0',{'requires':['datatable-core','datatable-table','datatable-head','datatable-body','base-build','widget'],'skinnable':true});