/* YUI 3.14.1 (build 63049cb) Copyright 2013 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ if (typeof __coverage__ === 'undefined') { __coverage__ = {}; } if (!__coverage__['build/datatable-mutable/datatable-mutable.js']) { __coverage__['build/datatable-mutable/datatable-mutable.js'] = {"path":"build/datatable-mutable/datatable-mutable.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,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,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],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0,0],"23":[0,0],"24":[0,0],"25":[0,0],"26":[0,0],"27":[0,0],"28":[0,0],"29":[0,0],"30":[0,0],"31":[0,0],"32":[0,0,0],"33":[0,0],"34":[0,0],"35":[0,0],"36":[0,0],"37":[0,0],"38":[0,0],"39":[0,0],"40":[0,0],"41":[0,0],"42":[0,0],"43":[0,0],"44":[0,0],"45":[0,0],"46":[0,0],"47":[0,0],"48":[0,0],"49":[0,0],"50":[0,0],"51":[0,0],"52":[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},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":48}}},"2":{"name":"(anonymous_2)","line":39,"loc":{"start":{"line":39,"column":45},"end":{"line":39,"column":57}}},"3":{"name":"(anonymous_3)","line":98,"loc":{"start":{"line":98,"column":15},"end":{"line":98,"column":40}}},"4":{"name":"(anonymous_4)","line":140,"loc":{"start":{"line":140,"column":18},"end":{"line":140,"column":42}}},"5":{"name":"(anonymous_5)","line":169,"loc":{"start":{"line":169,"column":16},"end":{"line":169,"column":39}}},"6":{"name":"(anonymous_6)","line":190,"loc":{"start":{"line":190,"column":18},"end":{"line":190,"column":34}}},"7":{"name":"(anonymous_7)","line":230,"loc":{"start":{"line":230,"column":12},"end":{"line":230,"column":36}}},"8":{"name":"(anonymous_8)","line":289,"loc":{"start":{"line":289,"column":15},"end":{"line":289,"column":37}}},"9":{"name":"(anonymous_9)","line":363,"loc":{"start":{"line":363,"column":15},"end":{"line":363,"column":43}}},"10":{"name":"(anonymous_10)","line":408,"loc":{"start":{"line":408,"column":21},"end":{"line":408,"column":34}}},"11":{"name":"(anonymous_11)","line":437,"loc":{"start":{"line":437,"column":24},"end":{"line":437,"column":37}}},"12":{"name":"(anonymous_12)","line":461,"loc":{"start":{"line":461,"column":22},"end":{"line":461,"column":35}}},"13":{"name":"(anonymous_13)","line":510,"loc":{"start":{"line":510,"column":24},"end":{"line":510,"column":37}}},"14":{"name":"(anonymous_14)","line":539,"loc":{"start":{"line":539,"column":17},"end":{"line":539,"column":29}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":630,"column":47}},"2":{"start":{"line":10,"column":0},"end":{"line":17,"column":12}},"3":{"start":{"line":39,"column":0},"end":{"line":39,"column":60}},"4":{"start":{"line":41,"column":0},"end":{"line":59,"column":2}},"5":{"start":{"line":61,"column":0},"end":{"line":547,"column":3}},"6":{"start":{"line":99,"column":8},"end":{"line":101,"column":9}},"7":{"start":{"line":100,"column":12},"end":{"line":100,"column":37}},"8":{"start":{"line":103,"column":8},"end":{"line":112,"column":9}},"9":{"start":{"line":104,"column":12},"end":{"line":106,"column":13}},"10":{"start":{"line":105,"column":16},"end":{"line":105,"column":51}},"11":{"start":{"line":108,"column":12},"end":{"line":111,"column":15}},"12":{"start":{"line":113,"column":8},"end":{"line":113,"column":20}},"13":{"start":{"line":141,"column":8},"end":{"line":143,"column":9}},"14":{"start":{"line":142,"column":12},"end":{"line":142,"column":37}},"15":{"start":{"line":145,"column":8},"end":{"line":150,"column":9}},"16":{"start":{"line":146,"column":12},"end":{"line":149,"column":15}},"17":{"start":{"line":152,"column":8},"end":{"line":152,"column":20}},"18":{"start":{"line":170,"column":8},"end":{"line":175,"column":9}},"19":{"start":{"line":171,"column":12},"end":{"line":174,"column":15}},"20":{"start":{"line":177,"column":8},"end":{"line":177,"column":20}},"21":{"start":{"line":191,"column":8},"end":{"line":195,"column":9}},"22":{"start":{"line":192,"column":12},"end":{"line":194,"column":15}},"23":{"start":{"line":197,"column":8},"end":{"line":197,"column":20}},"24":{"start":{"line":232,"column":8},"end":{"line":235,"column":40}},"25":{"start":{"line":237,"column":8},"end":{"line":252,"column":9}},"26":{"start":{"line":238,"column":12},"end":{"line":238,"column":63}},"27":{"start":{"line":240,"column":12},"end":{"line":251,"column":13}},"28":{"start":{"line":241,"column":16},"end":{"line":241,"column":41}},"29":{"start":{"line":242,"column":16},"end":{"line":242,"column":53}},"30":{"start":{"line":244,"column":16},"end":{"line":250,"column":17}},"31":{"start":{"line":245,"column":20},"end":{"line":245,"column":38}},"32":{"start":{"line":247,"column":20},"end":{"line":249,"column":21}},"33":{"start":{"line":248,"column":24},"end":{"line":248,"column":62}},"34":{"start":{"line":254,"column":8},"end":{"line":254,"column":20}},"35":{"start":{"line":290,"column":8},"end":{"line":295,"column":40}},"36":{"start":{"line":298,"column":8},"end":{"line":304,"column":9}},"37":{"start":{"line":299,"column":12},"end":{"line":299,"column":23}},"38":{"start":{"line":300,"column":15},"end":{"line":304,"column":9}},"39":{"start":{"line":301,"column":12},"end":{"line":303,"column":39}},"40":{"start":{"line":306,"column":8},"end":{"line":326,"column":9}},"41":{"start":{"line":307,"column":12},"end":{"line":307,"column":47}},"42":{"start":{"line":309,"column":12},"end":{"line":310,"column":38}},"43":{"start":{"line":312,"column":12},"end":{"line":325,"column":13}},"44":{"start":{"line":313,"column":16},"end":{"line":315,"column":17}},"45":{"start":{"line":314,"column":20},"end":{"line":314,"column":37}},"46":{"start":{"line":317,"column":16},"end":{"line":317,"column":41}},"47":{"start":{"line":319,"column":16},"end":{"line":319,"column":41}},"48":{"start":{"line":321,"column":16},"end":{"line":324,"column":17}},"49":{"start":{"line":322,"column":20},"end":{"line":322,"column":38}},"50":{"start":{"line":323,"column":20},"end":{"line":323,"column":53}},"51":{"start":{"line":328,"column":8},"end":{"line":328,"column":20}},"52":{"start":{"line":364,"column":8},"end":{"line":369,"column":24}},"53":{"start":{"line":371,"column":8},"end":{"line":377,"column":9}},"54":{"start":{"line":372,"column":12},"end":{"line":372,"column":23}},"55":{"start":{"line":373,"column":15},"end":{"line":377,"column":9}},"56":{"start":{"line":374,"column":12},"end":{"line":376,"column":39}},"57":{"start":{"line":379,"column":8},"end":{"line":387,"column":9}},"58":{"start":{"line":380,"column":12},"end":{"line":380,"column":47}},"59":{"start":{"line":382,"column":12},"end":{"line":382,"column":46}},"60":{"start":{"line":384,"column":12},"end":{"line":386,"column":13}},"61":{"start":{"line":385,"column":16},"end":{"line":385,"column":46}},"62":{"start":{"line":389,"column":8},"end":{"line":389,"column":20}},"63":{"start":{"line":409,"column":8},"end":{"line":412,"column":19}},"64":{"start":{"line":414,"column":8},"end":{"line":416,"column":9}},"65":{"start":{"line":415,"column":12},"end":{"line":415,"column":61}},"66":{"start":{"line":418,"column":8},"end":{"line":422,"column":9}},"67":{"start":{"line":419,"column":12},"end":{"line":419,"column":47}},"68":{"start":{"line":421,"column":12},"end":{"line":421,"column":61}},"69":{"start":{"line":438,"column":8},"end":{"line":439,"column":47}},"70":{"start":{"line":441,"column":8},"end":{"line":445,"column":9}},"71":{"start":{"line":442,"column":12},"end":{"line":442,"column":48}},"72":{"start":{"line":444,"column":12},"end":{"line":444,"column":61}},"73":{"start":{"line":462,"column":8},"end":{"line":465,"column":48}},"74":{"start":{"line":467,"column":8},"end":{"line":496,"column":9}},"75":{"start":{"line":468,"column":12},"end":{"line":468,"column":75}},"76":{"start":{"line":469,"column":12},"end":{"line":469,"column":53}},"77":{"start":{"line":471,"column":12},"end":{"line":495,"column":13}},"78":{"start":{"line":472,"column":16},"end":{"line":472,"column":33}},"79":{"start":{"line":474,"column":16},"end":{"line":476,"column":17}},"80":{"start":{"line":475,"column":20},"end":{"line":475,"column":79}},"81":{"start":{"line":478,"column":16},"end":{"line":494,"column":17}},"82":{"start":{"line":479,"column":20},"end":{"line":479,"column":40}},"83":{"start":{"line":480,"column":20},"end":{"line":480,"column":50}},"84":{"start":{"line":481,"column":20},"end":{"line":481,"column":41}},"85":{"start":{"line":483,"column":20},"end":{"line":489,"column":21}},"86":{"start":{"line":486,"column":24},"end":{"line":488,"column":25}},"87":{"start":{"line":487,"column":28},"end":{"line":487,"column":38}},"88":{"start":{"line":491,"column":20},"end":{"line":491,"column":54}},"89":{"start":{"line":493,"column":20},"end":{"line":493,"column":69}},"90":{"start":{"line":511,"column":8},"end":{"line":513,"column":24}},"91":{"start":{"line":515,"column":8},"end":{"line":524,"column":9}},"92":{"start":{"line":516,"column":12},"end":{"line":516,"column":70}},"93":{"start":{"line":517,"column":12},"end":{"line":517,"column":50}},"94":{"start":{"line":519,"column":12},"end":{"line":523,"column":13}},"95":{"start":{"line":520,"column":16},"end":{"line":520,"column":38}},"96":{"start":{"line":522,"column":16},"end":{"line":522,"column":65}},"97":{"start":{"line":540,"column":8},"end":{"line":545,"column":11}},"98":{"start":{"line":582,"column":0},"end":{"line":582,"column":53}},"99":{"start":{"line":585,"column":0},"end":{"line":587,"column":1}},"100":{"start":{"line":586,"column":4},"end":{"line":586,"column":39}}},"branchMap":{"1":{"line":99,"type":"if","locations":[{"start":{"line":99,"column":8},"end":{"line":99,"column":8}},{"start":{"line":99,"column":8},"end":{"line":99,"column":8}}]},"2":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":8},"end":{"line":103,"column":8}},{"start":{"line":103,"column":8},"end":{"line":103,"column":8}}]},"3":{"line":104,"type":"if","locations":[{"start":{"line":104,"column":12},"end":{"line":104,"column":12}},{"start":{"line":104,"column":12},"end":{"line":104,"column":12}}]},"4":{"line":104,"type":"binary-expr","locations":[{"start":{"line":104,"column":16},"end":{"line":104,"column":36}},{"start":{"line":104,"column":41},"end":{"line":104,"column":57}},{"start":{"line":104,"column":61},"end":{"line":104,"column":76}}]},"5":{"line":141,"type":"if","locations":[{"start":{"line":141,"column":8},"end":{"line":141,"column":8}},{"start":{"line":141,"column":8},"end":{"line":141,"column":8}}]},"6":{"line":145,"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":145,"column":8}},{"start":{"line":145,"column":8},"end":{"line":145,"column":8}}]},"7":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":8},"end":{"line":170,"column":8}},{"start":{"line":170,"column":8},"end":{"line":170,"column":8}}]},"8":{"line":170,"type":"binary-expr","locations":[{"start":{"line":170,"column":12},"end":{"line":170,"column":30}},{"start":{"line":170,"column":35},"end":{"line":170,"column":50}},{"start":{"line":170,"column":54},"end":{"line":170,"column":68}}]},"9":{"line":191,"type":"if","locations":[{"start":{"line":191,"column":8},"end":{"line":191,"column":8}},{"start":{"line":191,"column":8},"end":{"line":191,"column":8}}]},"10":{"line":232,"type":"cond-expr","locations":[{"start":{"line":233,"column":16},"end":{"line":233,"column":27}},{"start":{"line":234,"column":16},"end":{"line":234,"column":36}}]},"11":{"line":232,"type":"binary-expr","locations":[{"start":{"line":232,"column":20},"end":{"line":232,"column":26}},{"start":{"line":232,"column":31},"end":{"line":232,"column":47}}]},"12":{"line":237,"type":"if","locations":[{"start":{"line":237,"column":8},"end":{"line":237,"column":8}},{"start":{"line":237,"column":8},"end":{"line":237,"column":8}}]},"13":{"line":237,"type":"binary-expr","locations":[{"start":{"line":237,"column":12},"end":{"line":237,"column":16}},{"start":{"line":237,"column":20},"end":{"line":237,"column":29}}]},"14":{"line":240,"type":"if","locations":[{"start":{"line":240,"column":12},"end":{"line":240,"column":12}},{"start":{"line":240,"column":12},"end":{"line":240,"column":12}}]},"15":{"line":247,"type":"if","locations":[{"start":{"line":247,"column":20},"end":{"line":247,"column":20}},{"start":{"line":247,"column":20},"end":{"line":247,"column":20}}]},"16":{"line":292,"type":"cond-expr","locations":[{"start":{"line":293,"column":28},"end":{"line":293,"column":39}},{"start":{"line":294,"column":28},"end":{"line":294,"column":48}}]},"17":{"line":292,"type":"binary-expr","locations":[{"start":{"line":292,"column":25},"end":{"line":292,"column":31}},{"start":{"line":292,"column":36},"end":{"line":292,"column":52}}]},"18":{"line":298,"type":"if","locations":[{"start":{"line":298,"column":8},"end":{"line":298,"column":8}},{"start":{"line":298,"column":8},"end":{"line":298,"column":8}}]},"19":{"line":298,"type":"binary-expr","locations":[{"start":{"line":298,"column":12},"end":{"line":298,"column":24}},{"start":{"line":298,"column":28},"end":{"line":298,"column":64}}]},"20":{"line":300,"type":"if","locations":[{"start":{"line":300,"column":15},"end":{"line":300,"column":15}},{"start":{"line":300,"column":15},"end":{"line":300,"column":15}}]},"21":{"line":300,"type":"binary-expr","locations":[{"start":{"line":300,"column":19},"end":{"line":300,"column":28}},{"start":{"line":300,"column":32},"end":{"line":300,"column":48}}]},"22":{"line":301,"type":"binary-expr","locations":[{"start":{"line":301,"column":20},"end":{"line":301,"column":41}},{"start":{"line":302,"column":20},"end":{"line":302,"column":47}},{"start":{"line":303,"column":20},"end":{"line":303,"column":38}}]},"23":{"line":306,"type":"if","locations":[{"start":{"line":306,"column":8},"end":{"line":306,"column":8}},{"start":{"line":306,"column":8},"end":{"line":306,"column":8}}]},"24":{"line":312,"type":"if","locations":[{"start":{"line":312,"column":12},"end":{"line":312,"column":12}},{"start":{"line":312,"column":12},"end":{"line":312,"column":12}}]},"25":{"line":313,"type":"if","locations":[{"start":{"line":313,"column":16},"end":{"line":313,"column":16}},{"start":{"line":313,"column":16},"end":{"line":313,"column":16}}]},"26":{"line":366,"type":"cond-expr","locations":[{"start":{"line":367,"column":28},"end":{"line":367,"column":39}},{"start":{"line":368,"column":28},"end":{"line":368,"column":48}}]},"27":{"line":366,"type":"binary-expr","locations":[{"start":{"line":366,"column":25},"end":{"line":366,"column":31}},{"start":{"line":366,"column":36},"end":{"line":366,"column":52}}]},"28":{"line":371,"type":"if","locations":[{"start":{"line":371,"column":8},"end":{"line":371,"column":8}},{"start":{"line":371,"column":8},"end":{"line":371,"column":8}}]},"29":{"line":371,"type":"binary-expr","locations":[{"start":{"line":371,"column":12},"end":{"line":371,"column":24}},{"start":{"line":371,"column":28},"end":{"line":371,"column":64}}]},"30":{"line":373,"type":"if","locations":[{"start":{"line":373,"column":15},"end":{"line":373,"column":15}},{"start":{"line":373,"column":15},"end":{"line":373,"column":15}}]},"31":{"line":373,"type":"binary-expr","locations":[{"start":{"line":373,"column":19},"end":{"line":373,"column":28}},{"start":{"line":373,"column":32},"end":{"line":373,"column":48}}]},"32":{"line":374,"type":"binary-expr","locations":[{"start":{"line":374,"column":20},"end":{"line":374,"column":41}},{"start":{"line":375,"column":20},"end":{"line":375,"column":47}},{"start":{"line":376,"column":20},"end":{"line":376,"column":38}}]},"33":{"line":379,"type":"if","locations":[{"start":{"line":379,"column":8},"end":{"line":379,"column":8}},{"start":{"line":379,"column":8},"end":{"line":379,"column":8}}]},"34":{"line":379,"type":"binary-expr","locations":[{"start":{"line":379,"column":12},"end":{"line":379,"column":17}},{"start":{"line":379,"column":21},"end":{"line":379,"column":35}}]},"35":{"line":384,"type":"if","locations":[{"start":{"line":384,"column":12},"end":{"line":384,"column":12}},{"start":{"line":384,"column":12},"end":{"line":384,"column":12}}]},"36":{"line":384,"type":"binary-expr","locations":[{"start":{"line":384,"column":16},"end":{"line":384,"column":20}},{"start":{"line":384,"column":24},"end":{"line":384,"column":38}}]},"37":{"line":414,"type":"binary-expr","locations":[{"start":{"line":414,"column":44},"end":{"line":414,"column":48}},{"start":{"line":414,"column":52},"end":{"line":414,"column":59}}]},"38":{"line":415,"type":"binary-expr","locations":[{"start":{"line":415,"column":19},"end":{"line":415,"column":33}},{"start":{"line":415,"column":37},"end":{"line":415,"column":60}}]},"39":{"line":418,"type":"if","locations":[{"start":{"line":418,"column":8},"end":{"line":418,"column":8}},{"start":{"line":418,"column":8},"end":{"line":418,"column":8}}]},"40":{"line":441,"type":"if","locations":[{"start":{"line":441,"column":8},"end":{"line":441,"column":8}},{"start":{"line":441,"column":8},"end":{"line":441,"column":8}}]},"41":{"line":467,"type":"if","locations":[{"start":{"line":467,"column":8},"end":{"line":467,"column":8}},{"start":{"line":467,"column":8},"end":{"line":467,"column":8}}]},"42":{"line":468,"type":"cond-expr","locations":[{"start":{"line":468,"column":41},"end":{"line":468,"column":64}},{"start":{"line":468,"column":67},"end":{"line":468,"column":74}}]},"43":{"line":471,"type":"if","locations":[{"start":{"line":471,"column":12},"end":{"line":471,"column":12}},{"start":{"line":471,"column":12},"end":{"line":471,"column":12}}]},"44":{"line":474,"type":"binary-expr","locations":[{"start":{"line":474,"column":54},"end":{"line":474,"column":60}},{"start":{"line":474,"column":64},"end":{"line":474,"column":71}}]},"45":{"line":475,"type":"binary-expr","locations":[{"start":{"line":475,"column":29},"end":{"line":475,"column":47}},{"start":{"line":475,"column":51},"end":{"line":475,"column":78}}]},"46":{"line":478,"type":"if","locations":[{"start":{"line":478,"column":16},"end":{"line":478,"column":16}},{"start":{"line":478,"column":16},"end":{"line":478,"column":16}}]},"47":{"line":483,"type":"if","locations":[{"start":{"line":483,"column":20},"end":{"line":483,"column":20}},{"start":{"line":483,"column":20},"end":{"line":483,"column":20}}]},"48":{"line":486,"type":"if","locations":[{"start":{"line":486,"column":24},"end":{"line":486,"column":24}},{"start":{"line":486,"column":24},"end":{"line":486,"column":24}}]},"49":{"line":515,"type":"if","locations":[{"start":{"line":515,"column":8},"end":{"line":515,"column":8}},{"start":{"line":515,"column":8},"end":{"line":515,"column":8}}]},"50":{"line":516,"type":"cond-expr","locations":[{"start":{"line":516,"column":36},"end":{"line":516,"column":59}},{"start":{"line":516,"column":62},"end":{"line":516,"column":69}}]},"51":{"line":519,"type":"if","locations":[{"start":{"line":519,"column":12},"end":{"line":519,"column":12}},{"start":{"line":519,"column":12},"end":{"line":519,"column":12}}]},"52":{"line":585,"type":"if","locations":[{"start":{"line":585,"column":0},"end":{"line":585,"column":0}},{"start":{"line":585,"column":0},"end":{"line":585,"column":0}}]}},"code":["(function () { YUI.add('datatable-mutable', function (Y, NAME) {","","/**","Adds mutation convenience methods such as `table.addRow(data)` to `Y.DataTable`. (or other built class).","","@module datatable","@submodule datatable-mutable","@since 3.5.0","**/","var toArray = Y.Array,"," YLang = Y.Lang,"," isString = YLang.isString,"," isArray = YLang.isArray,"," isObject = YLang.isObject,"," isNumber = YLang.isNumber,"," arrayIndex = Y.Array.indexOf,"," Mutable;","","/**","_API docs for this extension are included in the DataTable class._","","Class extension to add mutation convenience methods to `Y.DataTable` (or other","built class).","","Column mutation methods are paired with new custom events:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn","","Row mutation events are bubbled from the DataTable's `data` ModelList through","the DataTable instance.","","@class DataTable.Mutable","@for DataTable","@since 3.5.0","**/","Y.namespace('DataTable').Mutable = Mutable = function () {};","","Mutable.ATTRS = {"," /**"," Controls whether `addRow`, `removeRow`, and `modifyRow` should trigger the"," underlying Model's sync layer by default.",""," When `true`, it is unnecessary to pass the \"sync\" configuration property to"," those methods to trigger per-operation sync.","",""," @attribute autoSync"," @type {Boolean}"," @default `false`"," @since 3.5.0"," **/"," autoSync: {"," value: false,"," validator: YLang.isBoolean"," }","};","","Y.mix(Mutable.prototype, {"," /**"," Adds the column configuration to the DataTable's `columns` configuration."," If the `index` parameter is supplied, it is injected at that index. If the"," table has nested headers, inject a subcolumn by passing an array of indexes"," to identify the new column's final location.",""," The `index` parameter is required if adding a nested column.",""," This method is a convienience method for fetching the DataTable's `columns`"," attribute, updating it, and calling"," `table.set('columns', _updatedColumnsDefs_)`",""," For example:","","
// Becomes last column"," table.addColumn('name');",""," // Inserted after the current second column, moving the current third column"," // to index 4"," table.addColumn({ key: 'price', formatter: currencyFormatter }, 2 );",""," // Insert a new column in a set of headers three rows deep. The index array"," // translates to"," // [ 2, -- in the third column's children"," // 1, -- in the second child's children"," // 3 ] -- as the fourth child column"," table.addColumn({ key: 'age', sortable: true }, [ 2, 1, 3 ]);","
",""," @method addColumn"," @param {Object|String} config The new column configuration object"," @param {Number|Number[]} [index] the insertion index"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addColumn: function (config, index) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (config) {"," if (arguments.length < 2 || (!isNumber(index) && !isArray(index))) {"," index = this.get('columns').length;"," }",""," this.fire('addColumn', {"," column: config,"," index: index"," });"," }"," return this;"," },",""," /**"," Updates an existing column definition. Fires the `modifyColumn` event.",""," For example:",""," // Add a formatter to the existing 'price' column definition"," table.modifyColumn('price', { formatter: currencyFormatter });",""," // Change the label on a header cell in a set of nested headers three rows"," // deep. The index array translates to"," // [ 2, -- in the third column's children"," // 1, -- the second child"," // 3 ] -- the fourth child column"," table.modifyColumn([2, 1, 3], { label: 'Experience' });","
",""," @method modifyColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Object} config The new column configuration properties"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyColumn: function (name, config) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (isObject(config)) {"," this.fire('modifyColumn', {"," column: name,"," newColumnDef: config"," });"," }",""," return this;"," },",""," /**"," Moves an existing column to a new location. Fires the `moveColumn` event.",""," The destination index can be a number or array of numbers to place a column"," header in a nested header row.",""," @method moveColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Number|Number[]} index The destination index of the column"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," moveColumn: function (name, index) {"," if (name !== undefined && (isNumber(index) || isArray(index))) {"," this.fire('moveColumn', {"," column: name,"," index: index"," });"," }",""," return this;"," },",""," /**"," Removes an existing column. Fires the `removeColumn` event.",""," @method removeColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeColumn: function (name) {"," if (name !== undefined) {"," this.fire('removeColumn', {"," column: name"," });"," }",""," return this;"," },",""," /**"," Adds a new record to the DataTable's `data` ModelList. Record data can be"," an object of field values or an instance of the DataTable's configured"," `recordType` class.",""," This relays all parameters to the `data` ModelList's `add` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method addRow"," @param {Object} data The data or Model instance for the new record"," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addRow: function (data, config) {"," // Allow autoSync: true + addRow({ data }, { sync: false })"," var sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," if (data && this.data) {"," models = this.data.add.apply(this.data, arguments);",""," if (sync) {"," models = toArray(models);"," args = toArray(arguments, 1, true);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];",""," if (model.isNew()) {"," models[i].save.apply(models[i], args);"," }"," }"," }"," }",""," return this;"," },",""," /**"," Removes a record from the DataTable's `data` ModelList. The record can be"," provided explicitly or targeted by it's `id` (see ModelList's `getById`"," method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the Model and all other passed"," arguments to the `data` ModelList's `remove` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be destroyed, passing"," `{ delete: true }` to trigger calling the Model's sync layer.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `destroy()` method.",""," @method removeRow"," @param {Object|String|Number} id The Model instance or identifier"," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeRow: function (id, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," // TODO: support removing via DOM element. This should be relayed to View"," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model) {"," args = toArray(arguments, 1, true);",""," models = modelList.remove.apply(modelList,"," [model].concat(args));",""," if (sync) {"," if (!isObject(args[0])) {"," args.unshift({});"," }",""," args[0]['delete'] = true;",""," models = toArray(models);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];"," model.destroy.apply(model, args);"," }"," }"," }",""," return this;"," },",""," /**"," Updates an existing record in the DataTable's `data` ModelList. The record"," can be provided explicitly or targeted by it's `id` (see ModelList's"," `getById` method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the all other passed"," arguments to the Model's `setAttrs` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method modifyRow"," @param {Object|String|Number} id The Model instance or identifier"," @param {Object} data New data values for the Model"," @param {Object} [config] Configuration to pass along to `setAttrs()`"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyRow: function (id, data, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," model, args;",""," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model && isObject(data)) {"," args = toArray(arguments, 1, true);",""," model.setAttrs.apply(model, args);",""," if (sync && !model.isNew()) {"," model.save.apply(model, args);"," }"," }",""," return this;"," },",""," // --------------------------------------------------------------------------"," // Protected properties and methods"," // --------------------------------------------------------------------------",""," /**"," Default function for the `addColumn` event.",""," Inserts the specified column at the provided index.",""," @method _defAddColumnFn"," @param {EventFacade} e The `addColumn` event"," @param {Object} e.column The new column definition object"," @param {Number|Number[]} e.index The array index to insert the new column"," @protected"," @since 3.5.0"," **/"," _defAddColumnFn: function (e) {"," var index = toArray(e.index),"," columns = this.get('columns'),"," cols = columns,"," i, len;",""," for (i = 0, len = index.length - 1; cols && i < len; ++i) {"," cols = cols[index[i]] && cols[index[i]].children;"," }",""," if (cols) {"," cols.splice(index[i], 0, e.column);",""," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `modifyColumn` event.",""," Mixes the new column properties into the specified column definition.",""," @method _defModifyColumnFn"," @param {EventFacade} e The `modifyColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.newColumnDef The properties to assign to the column"," @protected"," @since 3.5.0"," **/"," _defModifyColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column);",""," if (column) {"," Y.mix(column, e.newColumnDef, true);",""," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `moveColumn` event.",""," Removes the specified column from its current location and inserts it at the"," specified array index (may be an array of indexes for nested headers).",""," @method _defMoveColumnFn"," @param {EventFacade} e The `moveColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.index The destination index to move to"," @protected"," @since 3.5.0"," **/"," _defMoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," toIndex = toArray(e.index),"," fromCols, fromIndex, toCols, i, len;",""," if (column) {"," fromCols = column._parent ? column._parent.children : columns;"," fromIndex = arrayIndex(fromCols, column);",""," if (fromIndex > -1) {"," toCols = columns;",""," for (i = 0, len = toIndex.length - 1; toCols && i < len; ++i) {"," toCols = toCols[toIndex[i]] && toCols[toIndex[i]].children;"," }",""," if (toCols) {"," len = toCols.length;"," fromCols.splice(fromIndex, 1);"," toIndex = toIndex[i];",""," if (len > toCols.lenth) {"," // spliced off the same array, so adjust destination"," // index if necessary"," if (fromIndex < toIndex) {"," toIndex--;"," }"," }",""," toCols.splice(toIndex, 0, column);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," }"," },",""," /**"," Default function for the `removeColumn` event.",""," Splices the specified column from its containing columns array.",""," @method _defRemoveColumnFn"," @param {EventFacade} e The `removeColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @protected"," @since 3.5.0"," **/"," _defRemoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," cols, index;",""," if (column) {"," cols = column._parent ? column._parent.children : columns;"," index = Y.Array.indexOf(cols, column);",""," if (index > -1) {"," cols.splice(index, 1);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," },",""," /**"," Publishes the events used by the mutation methods:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this.publish({"," addColumn: { defaultFn: Y.bind('_defAddColumnFn', this) },"," removeColumn: { defaultFn: Y.bind('_defRemoveColumnFn', this) },"," moveColumn: { defaultFn: Y.bind('_defMoveColumnFn', this) },"," modifyColumn: { defaultFn: Y.bind('_defModifyColumnFn', this) }"," });"," }","});","","/**","Adds an array of new records to the DataTable's `data` ModelList. Record data","can be an array of objects containing field values or an array of instance of","the DataTable's configured `recordType` class.","","This relays all parameters to the `data` ModelList's `add` method.","","Technically, this is an alias to `addRow`, but please use the appropriately","named method for readability.","","If a configuration object is passed as a second argument, and that object","has `sync: true` set, the underlying Models will be `save()`d.","","If the DataTable's `autoSync` attribute is set to `true`, the additional","argument is not needed.","","If syncing and the last argument is a function, that function will be used","as a callback to each Model's `save()` method.","","@method addRows","@param {Object[]} data The data or Model instances to add","@param {Object} [config] Configuration to pass along","@param {Function} [callback] Callback function for each Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash.","@return {DataTable}","@chainable","@since 3.5.0","**/","Mutable.prototype.addRows = Mutable.prototype.addRow;","","// Add feature APIs to public Y.DataTable class","if (YLang.isFunction(Y.DataTable)) {"," Y.Base.mix(Y.DataTable, [Mutable]);","}","","/**","Fired by the `addColumn` method.","","@event addColumn","@preventable _defAddColumnFn","@param {Object} column The new column definition object","@param {Number|Number[]} index The array index to insert the new column","@since 3.5.0","**/","","/**","Fired by the `removeColumn` method.","","@event removeColumn","@preventable _defRemoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@since 3.5.0","**/","","/**","Fired by the `modifyColumn` method.","","@event modifyColumn","@preventable _defModifyColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} newColumnDef The properties to assign to the column","@since 3.5.0","**/","","/**","Fired by the `moveColumn` method.","","@event moveColumn","@preventable _defMoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} index The destination index to move to","@since 3.5.0","**/","","","","}, '3.14.1', {\"requires\": [\"datatable-base\"]});","","}());"]};
}
var __cov_Wb3b1Y0eg_av5kKZFb1jHA = __coverage__['build/datatable-mutable/datatable-mutable.js'];
__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['1']++;YUI.add('datatable-mutable',function(Y,NAME){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['1']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['2']++;var toArray=Y.Array,YLang=Y.Lang,isString=YLang.isString,isArray=YLang.isArray,isObject=YLang.isObject,isNumber=YLang.isNumber,arrayIndex=Y.Array.indexOf,Mutable;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['3']++;Y.namespace('DataTable').Mutable=Mutable=function(){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['2']++;};__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['4']++;Mutable.ATTRS={autoSync:{value:false,validator:YLang.isBoolean}};__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['5']++;Y.mix(Mutable.prototype,{addColumn:function(config,index){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['3']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['6']++;if(isString(config)){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['1'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['7']++;config={key:config};}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['1'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['8']++;if(config){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['2'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['9']++;if((__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['4'][0]++,arguments.length<2)||(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['4'][1]++,!isNumber(index))&&(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['4'][2]++,!isArray(index))){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['3'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['10']++;index=this.get('columns').length;}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['3'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['11']++;this.fire('addColumn',{column:config,index:index});}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['2'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['12']++;return this;},modifyColumn:function(name,config){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['4']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['13']++;if(isString(config)){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['5'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['14']++;config={key:config};}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['5'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['15']++;if(isObject(config)){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['6'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['16']++;this.fire('modifyColumn',{column:name,newColumnDef:config});}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['6'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['17']++;return this;},moveColumn:function(name,index){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['5']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['18']++;if((__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['8'][0]++,name!==undefined)&&((__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['8'][1]++,isNumber(index))||(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['8'][2]++,isArray(index)))){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['7'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['19']++;this.fire('moveColumn',{column:name,index:index});}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['7'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['20']++;return this;},removeColumn:function(name){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['6']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['21']++;if(name!==undefined){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['9'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['22']++;this.fire('removeColumn',{column:name});}else{__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['9'][1]++;}__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['23']++;return this;},addRow:function(data,config){__cov_Wb3b1Y0eg_av5kKZFb1jHA.f['7']++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['24']++;var sync=(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['11'][0]++,config)&&(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['11'][1]++,'sync'in config)?(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['10'][0]++,config.sync):(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['10'][1]++,this.get('autoSync')),models,model,i,len,args;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['25']++;if((__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['13'][0]++,data)&&(__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['13'][1]++,this.data)){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['12'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['26']++;models=this.data.add.apply(this.data,arguments);__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['27']++;if(sync){__cov_Wb3b1Y0eg_av5kKZFb1jHA.b['14'][0]++;__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['28']++;models=toArray(models);__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['29']++;args=toArray(arguments,1,true);__cov_Wb3b1Y0eg_av5kKZFb1jHA.s['30']++;for(i=0,len=models.length;i