UNPKG

1.72 kBSource Map (JSON)View Raw
1{"version":3,"sources":["buttons/pl-button-onoff.js"],"names":["window","Ractive","controller","component","data","el","config","done","label","ButtonOnoff","plName","$","extend","on","toggleOn","this","set","toggleOff","toggle","get","isOn","event"],"mappings":"CAAA,WACE,YAEAA,QAAOC,QAAQC,WAAW,kBAAmB,SAASC,EAAWC,EAAMC,EAAIC,EAAQC,GAEjFH,EAAKI,MAAqC,mBAAtBJ,GAAK,cAA+B,SAAWA,EAAK,aAExE,IAAIK,GAAcN,GAChBO,OAAQ,kBACRN,KAAMO,EAAEC,QAAO,GACbC,IAAI,GACHT,GAEHU,SAAU,WACRC,KAAKC,IAAI,MAAM,IAEjBC,UAAW,WACTF,KAAKC,IAAI,MAAM,IAEjBE,OAAQ,WACNH,KAAKC,IAAI,MAAOD,KAAKI,IAAI,QAE3BC,KAAM,WACJ,MAAOL,MAAKI,IAAI,QAIpBV,GAAYI,GAAG,SAAU,WACvBJ,EAAYS,WAGVd,EAAKc,QACPT,EAAYI,GAAG,SAAU,SAASQ,GAChCjB,EAAKc,OAAOG,EAAOZ,EAAYW,UAInCb","file":"buttons/pl-button-onoff.min.js","sourcesContent":["(function() {\n 'use strict';\n\n window.Ractive.controller('pl-button-onoff', function(component, data, el, config, done) {\n\n data.label = typeof data['text-label'] == 'undefined' ? 'on/off' : data['text-label'];\n\n var ButtonOnoff = component({\n plName: 'pl-button-onoff',\n data: $.extend(true, {\n on: false\n }, data),\n\n toggleOn: function() {\n this.set('on', true);\n },\n toggleOff: function() {\n this.set('on', false);\n },\n toggle: function() {\n this.set('on', !this.get('on'));\n },\n isOn: function() {\n return this.get('on');\n }\n });\n\n ButtonOnoff.on('toggle', function() {\n ButtonOnoff.toggle();\n });\n\n if (data.toggle) {\n ButtonOnoff.on('toggle', function(event) {\n data.toggle(event, ButtonOnoff.isOn());\n });\n }\n\n done();\n });\n\n})();\n"],"sourceRoot":"/source/"}
\No newline at end of file