{"version":3,"sources":["https://lively-kernel.org/lively4/lively4-jens/src/components/widgets/combo-box.js"],"names":["Morph","ComboBox","initialize","updateView","value","getAttribute","s","setAttribute","get","setOptions","list","optionsElement","innerHTML","ea","appendChild","livelyExample"],"mappings":";;;;;;;;;;;;AAAOA,W;;;;;;;;;;;AAAAA,gD;;;;;;;AAEQ,YAAMC,QAAN,SAAuBD,KAAvB,CAA6B;AAC1C,cAAME,UAAN,GAAmB;AACjB,eAAKC,UAAL;AACD;;AAED,YAAIC,KAAJ,GAAY;AACV,iBAAO,KAAKC,YAAL,CAAkB,OAAlB,CAAP;AACD;;AAED,YAAID,KAAJ,CAAUE,CAAV,EAAa;AACX,eAAKC,YAAL,CAAkB,OAAlB,EAA2BD,CAA3B;AACA,eAAKH,UAAL;AACD;;AAEDA,qBAAa;AACX,eAAKK,GAAL,CAAS,QAAT,EAAmBJ,KAAnB,GAA2B,KAAKC,YAAL,CAAkB,OAAlB,CAA3B;AACD;;AAEDI,mBAAWC,IAAX,EAAiB;AACf,cAAIC,iBAAiB,KAAKH,GAAL,CAAS,UAAT,CAArB;AACAG,yBAAeC,SAAf,GAA2B,EAA3B;AACA,eAAI,IAAIC,EAAR,IAAcH,IAAd,EAAoB;AAClBC,2BAAeG,WAAf,8DAAoCD,EAApC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACD;AACF;;AAGD,cAAME,aAAN,GAAsB;AACpB,eAAKN,UAAL,CAAgB,CAAC,OAAD,EAAU,SAAV,EAAqB,SAArB,CAAhB;AAGD;;AA/ByC;;yBAAvBR,Q;;;;;;;;6BAAAA,yC","file":"combo-box.js","sourcesContent":["import Morph from 'src/components/widgets/lively-morph.js';\n\nexport default class ComboBox extends Morph {\n  async initialize() {\n    this.updateView()\n  }\n\n  get value() {\n    return this.getAttribute(\"value\")\n  }\n  \n  set value(s) {\n    this.setAttribute(\"value\", s)\n    this.updateView()\n  }\n  \n  updateView() {\n    this.get(\"#input\").value = this.getAttribute(\"value\")  \n  }\n  \n  setOptions(list) {\n    var optionsElement = this.get(\"#options\")\n    optionsElement.innerHTML = \"\"\n    for(var ea of list) {\n      optionsElement.appendChild(<option>{ea}</option>)\n    }\n  }\n  \n  \n  async livelyExample() {\n    this.setOptions([\"Apple\", \"Babanna\", \"Oranges\"])\n    \n    \n  }\n  \n  \n}"]}