{"version":3,"sources":["../../js/src/MultiSelect.js","../../js/src/Tools.js","../../js/src/Bs4StylingMethodCss.js","../../js/src/Bs4StylingMethodJs.js","../../js/src/Bs4Styling.js","../../js/src/Bs4SelectedItemContent.js","../../js/src/Bs4DropDownItemContent.js","../../js/src/BsMultiSelect.js","../../js/src/AddToJQueryPrototype.js","../../js/src/OptionsAdapters.js","../../js/src/LabelAdapter.js"],"names":["MultiSelect","optionsAdapter","styling","selectedItemContent","dropDownItemContent","labelAdapter","createStylingComposite","configuration","onDispose","window","Popper","TypeError","this","container","document","selectedPanel","filterInputItem","filterInput","dropDownMenu","popper","getDisabled","stylingComposite","selectedPanelClick","documentMouseup","containerMousedown","documentMouseup2","disabled","filterInputItemOffsetLeft","skipFocusout","hoveredMultiSelectData","hoveredMultiSelectDataIndex","MultiSelectDataList","MultiSelectDataSelectedTail","visibleMultiSelectDataList","visibleCount","getVisibleMultiSelectDataList","updateDropDownPosition","force","offsetLeft","update","hideDropDown","style","display","showDropDown","resetDropDownMenuHover","HoverOut","dropDownMenuItemElement","filterMultiSelectData","MultiSelectData","isFiltered","visible","filterDropDownMenu","text","value","trim","toLowerCase","i","length","multiSelectData","option","selected","searchText","indexOf","push","hoverInInternal","clearFilterInput","updatePosition","input","closeDropDown","removeSelectedFromList","selectedPrev","selectedNext","appendDropDownItem","_this","createElement","appendChild","isDisabled","disabledStyle","disable","toggle","selectedItemElement","remove","onSelected","focus","selectItem","doPublishEvents","adjustPair","isSelected","select","removeItem","parentNode","removeChild","triggerChange","bsSelectedItemContent","setTimeout","event","preventDefaultMultiSelectEvent","insertBefore","addEventListener","HoverIn","index","visibleIndex","keydownArrow","down","newIndex","forceUpdatePosition","width","Update","UpdateIsValid","getIsValid","getIsInvalid","UpdateSize","UpdateDisabled","Dispose","removeEventListener","createDropDownItems","dispose","destroy","itarate","_this2","Disable","Enable","init","_this3","s","flexWrap","listStyleType","defSelectedPanelStyleSys","setAttribute","border","padding","outline","backgroundColor","defFilterInputStyleSys","defDropDownMenuStyleSys","target","contains","Init","afterContainerFilled","placement","modifiers","preventOverflow","enabled","hide","flip","options","hidden","readyState","FocusIn","FocusOut","which","preventDefault","fullMatchMultiSelectData","ExtendIfUndefined","destination","source","property","undefined","bs4StylingMethodCssDefaults","selectedPanelFocusClass","selectedPanelDisabledClass","dropDownItemDisabledClass","defSelectedPanelStyle","margin-bottom","height","bs4StylingMethodJsDefaults","selectedPanelDefMinHeight","selectedPanelLgMinHeight","selectedPanelSmMinHeight","selectedPanelDisabledBackgroundColor","selectedPanelFocusBorderColor","selectedPanelFocusBoxShadow","selectedPanelFocusValidBoxShadow","selectedPanelFocusInvalidBoxShadow","filterInputColor","bs4StylingDefaults","containerClass","dropDownMenuClass","dropDownItemClass","dropDownItemHoverClass","selectedPanelClass","selectedItemClass","removeSelectedItemButtonClass","filterInputItemClass","filterInputClass","bs4StylingMethodCssdefaults","selectedItemContentDisabledClass","defSelectedItemStyle","padding-left","line-height","defRemoveSelectedItemButtonStyle","font-size","selectedItemContentDisabledOpacity","bs4SelectedItemContentDefaults","dropdDownLabelDisabledColor","$","bs4DropDownItemContentDefaults","pluginName","createPlugin","firstChar","charAt","firstCharLower","prototypableName","slice","noConflictPrototypable","fn","dataKey","prototypable","each","$e","instance","data","isMethodName","test","removeData","methodName","noConflict","AddToJQueryPrototype","element","settings","extend","preBuildConfiguration","$element","trigger","eventName","firstChild","OptionsAdapterJson","createInputId","id","label","$formGroup","closest","$label","find","get","getAttribute","selectElement","getElementsByTagName","nextSibling","classList","OptionsAdapterElement","name","backupedFor","newId","LabelAdapter","useCss","adapter","stylingMethod","composite","$container","addClass","$selectedPanel","$dropDownMenu","$filterInputItem","$filterInput","OnInit","isValid","isInvalid","dropDownItem","removeClass","Bs4Styling","Bs4StylingMethodCss","css","hasClass","Bs4StylingMethodJs","selectedItemContentStylingMethod","selectedItem","optionItem","removeSelectedItem","preventDefaultMultiSelect","$selectedItem","$content","appendTo","disableSelectedItemContent","$button","on","jqEvent","originalEvent","createSelectedItemContent","prop","Bs4SelectedItemContent","Bs4SelectedItemContentStylingMethodCss","Bs4SelectedItemContentStylingMethodJs","bs4DropDownItemContent","dropDownItemContentStylingMethod","$dropDownItem","$dropDownItemContent","$checkBox","$checkBoxLabel","isDisbaled","Bs4DropDownItemContent","Bs4DropDownItemContentStylingMethodCss","Bs4DropDownItemContentStylingMethodJs","multiSelect","postBuildConfiguration"],"mappings":";;;;;mVAMMA,aACF,SAAAA,EAAYC,EAAgBC,EACxBC,EAAqBC,EACrBC,EAAcC,EACdC,EAAeC,EAAWC,GAC1B,GAAsB,oBAAXC,EACP,MAAM,IAAIC,UAAU,yEAIxBC,KAAKX,eAAiBA,EACtBW,KAAKC,UAAYZ,EAAeY,UAChCD,KAAKV,QAAUA,EACfU,KAAKT,oBAAsBA,EAC3BS,KAAKR,oBAAsBA,EAC3BQ,KAAKP,aAAeA,EACpBO,KAAKN,uBAAyBA,EAC9BM,KAAKL,cAAgBA,EACrBK,KAAKJ,UAAYA,EACjBI,KAAKH,OAASA,EACdG,KAAKE,SAAWL,EAAOK,SAEvBF,KAAKG,cAAgB,KACrBH,KAAKI,gBAAkB,KACvBJ,KAAKK,YAAc,KACnBL,KAAKM,aAAe,KAEpBN,KAAKO,OAAS,KACdP,KAAKQ,YAAY,KACjBR,KAAKS,iBAAmB,KAGxBT,KAAKU,mBAAsB,KAC3BV,KAAKW,gBAAkB,KACvBX,KAAKY,mBAAqB,KAC1BZ,KAAKa,iBAAmB,KAGxBb,KAAKc,SAAW,KAChBd,KAAKe,0BAA4B,KACjCf,KAAKgB,cAAe,EACpBhB,KAAKiB,uBAAyB,KAC9BjB,KAAKkB,4BAA8B,KAGnClB,KAAKmB,oBAAsB,GAC3BnB,KAAKoB,4BAA8B,KAEnCpB,KAAKqB,2BAA6B,KAClCrB,KAAKsB,aAAa,8BAGtBC,8BAAA,WACI,OAAIvB,KAAKqB,2BACErB,KAAKqB,2BAELrB,KAAKmB,uBAGpBK,uBAAA,SAAuBC,GACnB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GAGlG,IAUIkG,EAAc,IAAIrS,EAClBC,EACAC,EACAC,EACAC,EACAC,EAfyB,SAASQ,EAAWE,EAAeC,EAAiBC,EAAaC,GAC1F,MAAO,CACHuO,WAAWtD,EAAEtL,GACb8O,eAAexD,EAAEpL,GACjB8O,iBAAiB1D,EAAEnL,GACnB8O,aAAa3D,EAAElL,GACf2O,cAAczD,EAAEjL,KAWpBX,EACAC,EACAC,GAMJ,OAJIF,EAAc+R,wBACd/R,EAAc+R,uBAAuB5E,EAAS2E,GAElDA,EAAY3K,OACL2K,GAlHVlG,EAqHHA","sourcesContent":["import Popper from 'popper.js'\r\n\r\nfunction defSelectedPanelStyleSys(s) {s.display='flex'; s.flexWrap='wrap'; s.listStyleType='none'}; // remove bullets since this is ul\r\nfunction defFilterInputStyleSys(s) {s.width='2ch'; s.border='0'; s.padding='0'; s.outline='none'; s.backgroundColor='transparent' };\r\nfunction defDropDownMenuStyleSys(s) {s.listStyleType='none'}; // remove bullets since this is ul\r\n\r\nclass MultiSelect {\r\n constructor(optionsAdapter, styling, \r\n selectedItemContent, dropDownItemContent, \r\n labelAdapter, createStylingComposite,\r\n configuration, onDispose, window) {\r\n if (typeof Popper === 'undefined') {\r\n throw new TypeError('DashboardCode BsMultiSelect require Popper.js (https://popper.js.org)')\r\n }\r\n\r\n // readonly\r\n this.optionsAdapter = optionsAdapter;\r\n this.container = optionsAdapter.container; // part of published api\r\n this.styling = styling;\r\n this.selectedItemContent = selectedItemContent;\r\n this.dropDownItemContent = dropDownItemContent;\r\n this.labelAdapter = labelAdapter;\r\n this.createStylingComposite = createStylingComposite;\r\n this.configuration = configuration;\r\n this.onDispose = onDispose;\r\n this.window = window;\r\n this.document = window.document;\r\n\r\n this.selectedPanel = null;\r\n this.filterInputItem = null;\r\n this.filterInput = null;\r\n this.dropDownMenu = null;\r\n \r\n this.popper = null;\r\n this.getDisabled=null;\r\n this.stylingComposite = null;\r\n\r\n // removable handlers\r\n this.selectedPanelClick = null;\r\n this.documentMouseup = null;\r\n this.containerMousedown = null;\r\n this.documentMouseup2 = null;\r\n \r\n // state\r\n this.disabled = null;\r\n this.filterInputItemOffsetLeft = null; // used to detect changes in input field position (by comparision with current value)\r\n this.skipFocusout = false;\r\n this.hoveredMultiSelectData = null;\r\n this.hoveredMultiSelectDataIndex = null;\r\n //this.hasDropDownVisible = false;\r\n\r\n this.MultiSelectDataList = [];\r\n this.MultiSelectDataSelectedTail = null;\r\n\r\n this.visibleMultiSelectDataList = null;\r\n this.visibleCount=10;\r\n }\r\n\r\n getVisibleMultiSelectDataList(){\r\n if (this.visibleMultiSelectDataList)\r\n return this.visibleMultiSelectDataList;\r\n else\r\n return this.MultiSelectDataList;\r\n }\r\n\r\n updateDropDownPosition(force) {\r\n let offsetLeft = this.filterInputItem.offsetLeft;\r\n if (force || this.filterInputItemOffsetLeft!=offsetLeft){\r\n this.popper.update();\r\n this.filterInputItemOffsetLeft=offsetLeft;\r\n }\r\n }\r\n\r\n hideDropDown() {\r\n this.dropDownMenu.style.display = 'none';\r\n }\r\n\r\n showDropDown() {\r\n this.dropDownMenu.style.display = 'block';\r\n }\r\n\r\n resetDropDownMenuHover() {\r\n if (this.hoveredMultiSelectData !== null) {\r\n this.styling.HoverOut(this.hoveredMultiSelectData.dropDownMenuItemElement);\r\n this.hoveredMultiSelectData = null;\r\n this.hoveredMultiSelectDataIndex = null;\r\n }\r\n }\r\n\r\n filterMultiSelectData(MultiSelectData, isFiltered){\r\n MultiSelectData.visible = isFiltered;\r\n MultiSelectData.dropDownMenuItemElement.style.display=isFiltered?'block':'none';\r\n } \r\n\r\n filterDropDownMenu() {\r\n let text = this.filterInput.value.trim().toLowerCase();\r\n if (text=='')\r\n {\r\n for(let i=0; i {\r\n MultiSelectData.toggle();\r\n this.filterInput.focus();\r\n });\r\n \r\n let selectItem = (doPublishEvents) => {\r\n //if (option.hidden)\r\n // return;\r\n var selectedItemElement = this.document.createElement('LI');\r\n MultiSelectData.selectedItemElement = selectedItemElement;\r\n \r\n if (this.MultiSelectDataSelectedTail){\r\n this.MultiSelectDataSelectedTail.selectedNext = MultiSelectData;\r\n MultiSelectData.selectedPrev=this.MultiSelectDataSelectedTail;\r\n }\r\n this.MultiSelectDataSelectedTail=MultiSelectData; \r\n \r\n let adjustPair =(isSelected, toggle, remove, disable) => {\r\n option.selected = isSelected;\r\n dropDownItemContent.select(isSelected);\r\n MultiSelectData.toggle=toggle;\r\n MultiSelectData.remove=remove;\r\n MultiSelectData.disable=disable;\r\n }\r\n\r\n let removeItem = () => {\r\n dropDownItemContent.disabledStyle(false);\r\n dropDownItemContent.disable(option.disabled);\r\n adjustPair(\r\n false, \r\n () => {\r\n if (option.disabled)\r\n return;\r\n selectItem(true);\r\n }, \r\n null,\r\n null\r\n );\r\n selectedItemElement.parentNode.removeChild(selectedItemElement);\r\n \r\n this.removeSelectedFromList(MultiSelectData);\r\n\r\n this.optionsAdapter.triggerChange();\r\n };\r\n \r\n // what is a problem with calling removeSelectedItem directly (not using setTimeout(removeSelectedItem, 0)):\r\n // consider situation \"MultiSelect\" on DROPDOWN (that should be closed on the click outside dropdown)\r\n // therefore we aslo have document's click's handler where we decide to close or leave the DROPDOWN open.\r\n // because of the event's bubling process removeSelectedItem runs first. \r\n // that means the event's target element on which we click (the x button) will be removed from the DOM together with badge \r\n // before we could analize is it belong to our dropdown or not.\r\n // important 1: we can't just the stop propogation using stopPropogate because click outside dropdown on the similar \r\n // component that use stopPropogation will not close dropdown (error, dropdown should be closed)\r\n // important 2: we can't change the dropdown's event handler to leave dropdown open if event's target is null because of\r\n // the situation described above: click outside dropdown on the same component.\r\n // Alternatively it could be possible to use stopPropogate but together create custom click event setting new target that belomgs to DOM (e.g. panel)\r\n\r\n let removeItemAndCloseDropDown = () => {\r\n removeItem();\r\n this.closeDropDown();\r\n };\r\n\r\n let onRemoveItemEvent = () => {\r\n setTimeout( ()=> { \r\n removeItem();\r\n this.closeDropDown();\r\n }, 0);\r\n };\r\n\r\n let preventDefaultMultiSelect = (event) => {\r\n this.preventDefaultMultiSelectEvent=event;\r\n }\r\n\r\n let bsSelectedItemContent = this.selectedItemContent(\r\n selectedItemElement,\r\n option,\r\n onRemoveItemEvent,\r\n preventDefaultMultiSelect\r\n );\r\n\r\n bsSelectedItemContent.disable(this.disabled);\r\n adjustPair(true, ()=>removeItem(), removeItemAndCloseDropDown, bsSelectedItemContent.disable);\r\n\r\n this.selectedPanel.insertBefore(selectedItemElement, this.filterInputItem);\r\n if (doPublishEvents){\r\n this.optionsAdapter.triggerChange();\r\n }\r\n }\r\n\r\n dropDownMenuItemElement.addEventListener('mouseover', () => \r\n this.styling.HoverIn(dropDownMenuItemElement));\r\n dropDownMenuItemElement.addEventListener('mouseout', () => \r\n this.styling.HoverOut(dropDownMenuItemElement));\r\n \r\n if (option.selected)\r\n selectItem(false);\r\n else\r\n MultiSelectData.toggle= () => { \r\n if (option.disabled)\r\n return;\r\n selectItem(true);\r\n }\r\n return MultiSelectData;\r\n }\r\n\r\n hoverInInternal(index){\r\n this.visibleIndex = 0;\r\n this.hoveredMultiSelectDataIndex = index;\r\n this.hoveredMultiSelectData = this.getVisibleMultiSelectDataList()[index];\r\n this.styling.HoverIn(this.hoveredMultiSelectData.dropDownMenuItemElement);\r\n }\r\n\r\n keydownArrow(down) {\r\n let visibleMultiSelectDataList = this.getVisibleMultiSelectDataList(); \r\n if (visibleMultiSelectDataList.length > 0) {\r\n if (visibleMultiSelectDataList.length > 0 ) {\r\n this.updateDropDownPosition(true);\r\n this.showDropDown();\r\n }\r\n let index;\r\n if (this.hoveredMultiSelectData === null) {\r\n index = down ? 0 : visibleMultiSelectDataList.length - 1;\r\n }\r\n else {\r\n this.styling.HoverOut(this.hoveredMultiSelectData.dropDownMenuItemElement);\r\n if (down) {\r\n let newIndex = this.hoveredMultiSelectDataIndex + 1;\r\n index = newIndex < visibleMultiSelectDataList.length ? newIndex : 0;\r\n } else {\r\n let newIndex = this.hoveredMultiSelectDataIndex - 1;\r\n index = newIndex >= 0 ? newIndex : visibleMultiSelectDataList.length - 1;\r\n }\r\n }\r\n this.hoverInInternal(index);\r\n }\r\n }\r\n input(forceUpdatePosition) {\r\n this.filterInput.style.width = this.filterInput.value.length*1.3 + 2 + \"ch\";\r\n this.filterDropDownMenu();\r\n\r\n if (this.getVisibleMultiSelectDataList().length > 0) {\r\n if (forceUpdatePosition) // ignore it if it is called from\r\n this.updateDropDownPosition(forceUpdatePosition); // we need it to support case when textbox changes its place because of line break (texbox grow with each key press)\r\n this.showDropDown();\r\n } else {\r\n this.hideDropDown();\r\n }\r\n }\r\n Update(){\r\n this.styling.UpdateIsValid(this.stylingComposite, this.optionsAdapter.getIsValid(), this.optionsAdapter.getIsInvalid());\r\n this.UpdateSize();\r\n this.UpdateDisabled();\r\n }\r\n Dispose(){\r\n if (this.onDispose)\r\n this.onDispose(); // primary used to remove from jQuery tables\r\n \r\n // removable handlers\r\n this.document.removeEventListener(\"mouseup\", this.documentMouseup);\r\n this.document.removeEventListener(\"mouseup\", this.documentMouseup2);\r\n this.document.removeEventListener(\"DOMContentLoaded\", this.createDropDownItems);\r\n this.container.removeEventListener(\"mousedown\", this.containerMousedown);\r\n \r\n this.labelAdapter.dispose();\r\n \r\n if (this.popper) {\r\n this.popper.destroy()\r\n }\r\n \r\n if (this.optionsAdapter.dispose) {\r\n this.optionsAdapter.dispose();\r\n }\r\n }\r\n UpdateSize(){\r\n if (this.styling.UpdateSize)\r\n this.styling.UpdateSize(this.stylingComposite);\r\n }\r\n\r\n UpdateDisabled(){\r\n let disabled = this.optionsAdapter.getDisabled();\r\n let itarate = (isDisabled)=>{\r\n let i = this.MultiSelectDataSelectedTail;\r\n while(i){\r\n i.disable(isDisabled); \r\n i = i.selectedPrev;\r\n }\r\n }\r\n if (this.disabled!==disabled){\r\n if (disabled) {\r\n this.filterInput.style.display = \"none\";\r\n this.styling.Disable(this.stylingComposite);\r\n itarate(true);\r\n \r\n this.container.removeEventListener(\"mousedown\", this.containerMousedown);\r\n this.document.removeEventListener(\"mouseup\", this.documentMouseup);\r\n \r\n this.selectedPanel.removeEventListener(\"click\", this.selectedPanelClick);\r\n this.document.removeEventListener(\"mouseup\", this.documentMouseup2);\r\n } else {\r\n this.filterInput.style.display = \"inline-block\";\r\n this.styling.Enable(this.stylingComposite);\r\n itarate(false);\r\n\r\n this.container.addEventListener(\"mousedown\", this.containerMousedown);\r\n this.document.addEventListener(\"mouseup\", this.documentMouseup);\r\n \r\n this.selectedPanel.addEventListener(\"click\", this.selectedPanelClick);\r\n this.document.addEventListener(\"mouseup\", this.documentMouseup2);\r\n }\r\n this.disabled=disabled;\r\n }\r\n }\r\n\r\n init() {\r\n let container = this.optionsAdapter.container;\r\n this.selectedPanel = this.document.createElement('UL');\r\n defSelectedPanelStyleSys(this.selectedPanel.style); \r\n container.appendChild(this.selectedPanel);\r\n \r\n this.filterInputItem = this.document.createElement('LI');\r\n this.selectedPanel.appendChild(this.filterInputItem);\r\n \r\n this.filterInput = document.createElement('INPUT'); \r\n this.filterInput.setAttribute(\"type\",\"search\");\r\n this.filterInput.setAttribute(\"autocomplete\",\"off\");\r\n \r\n defFilterInputStyleSys(this.filterInput.style);\r\n this.filterInputItem.appendChild(this.filterInput);\r\n\r\n this.dropDownMenu = document.createElement('UL');\r\n this.dropDownMenu.style.display=\"none\";\r\n container.appendChild(this.dropDownMenu);\r\n \r\n // prevent heavy understandable styling error\r\n defDropDownMenuStyleSys(this.dropDownMenu.style);\r\n \r\n this.documentMouseup = () => {\r\n this.skipFocusout = false;\r\n }\r\n\r\n this.containerMousedown = () => {\r\n this.skipFocusout = true;\r\n };\r\n\r\n this.documentMouseup2 = event => {\r\n if (!(container === event.target || container.contains(event.target))) {\r\n this.closeDropDown();\r\n }\r\n }\r\n\r\n this.selectedPanelClick = event => {\r\n if (event.target != this.filterInput)\r\n { \r\n this.filterInput.value='';\r\n this.filterInput.focus();\r\n }\r\n if (this.getVisibleMultiSelectDataList().length > 0 && \r\n ( this.preventDefaultMultiSelectEvent != event)){\r\n this.updateDropDownPosition(true);\r\n this.showDropDown();\r\n }\r\n this.preventDefaultMultiSelectEvent=null;\r\n };\r\n\r\n this.stylingComposite = this.createStylingComposite(container, this.selectedPanel,\r\n this.filterInputItem, this.filterInput, this.dropDownMenu);\r\n \r\n this.styling.Init(this.stylingComposite);\r\n \r\n this.labelAdapter.init(this.filterInput); \r\n\r\n if (this.optionsAdapter.afterContainerFilled)\r\n this.optionsAdapter.afterContainerFilled();\r\n this.popper = new Popper(this.filterInput, this.dropDownMenu, {\r\n placement: 'bottom-start',\r\n modifiers: {\r\n preventOverflow: {enabled:false},\r\n hide: {enabled:false},\r\n flip: {enabled:false}\r\n }\r\n });\r\n \r\n this.styling.UpdateIsValid(this.stylingComposite, this.optionsAdapter.getIsValid(), this.optionsAdapter.getIsInvalid());\r\n \r\n this.UpdateSize();\r\n this.UpdateDisabled();\r\n \r\n this.createDropDownItems = ()=>{\r\n let options = this.optionsAdapter.options;\r\n for(let i = 0; i 0;\r\n this.updateDropDownPosition(false);\r\n }\r\n\r\n // some browsers (IE11) can change select value (as part of \"autocomplete\") after page is loaded but before \"ready\" event\r\n if (this.document.readyState != 'loading'){\r\n this.createDropDownItems();\r\n } else {\r\n this.document.addEventListener('DOMContentLoaded', this.createDropDownItems); // IE9+\r\n }\r\n // there was unmotivated stopPropagation call. commented out.\r\n // $dropDownMenu.click( event => { \r\n // event.stopPropagation();\r\n // });\r\n this.dropDownMenu.addEventListener('mouseover', () => \r\n this.resetDropDownMenuHover());\r\n\r\n this.filterInput.addEventListener('focusin', () => \r\n this.styling.FocusIn(this.stylingComposite))\r\n \r\n this.filterInput.addEventListener('focusout', () => {\r\n if (!this.skipFocusout)\r\n this.styling.FocusOut(this.stylingComposite)\r\n });\r\n\r\n this.filterInput.addEventListener('keydown', (event) => {\r\n if ([38, 40, 13].indexOf(event.which)>=0 || (event.which == 9 && this.filterInput.value) ) {\r\n event.preventDefault();\r\n }\r\n\r\n if (event.which == 38) {\r\n this.keydownArrow(false);\r\n }\r\n else if (event.which == 40) {\r\n if (this.hoveredMultiSelectData === null && this.getVisibleMultiSelectDataList().length > 0) {\r\n this.showDropDown();\r\n }\r\n this.keydownArrow(true);\r\n }\r\n else if (event.which == 9) {\r\n if (!this.filterInput.value) {\r\n this.closeDropDown();\r\n }\r\n }\r\n else if (event.which == 8) {\r\n // NOTE: this will process backspace only if there are no text in the input field\r\n // If user will find this inconvinient, we will need to calculate something like this\r\n // this.isBackspaceAtStartPoint = (this.filterInput.selectionStart == 0 && this.filterInput.selectionEnd == 0);\r\n if (!this.filterInput.value)\r\n { \r\n if (this.MultiSelectDataSelectedTail){ \r\n this.MultiSelectDataSelectedTail.remove();\r\n }\r\n this.updateDropDownPosition(false);\r\n }\r\n }\r\n\r\n if ([38, 40, 13, 9].indexOf(event.which)==-1)\r\n this.resetDropDownMenuHover();\r\n });\r\n this.filterInput.addEventListener('keyup', (event) => {\r\n if (event.which == 13 || event.which == 9 ) {\r\n if (this.hoveredMultiSelectData) {\r\n this.hoveredMultiSelectData.toggle();\r\n this.closeDropDown();\r\n } \r\n }\r\n else if (event.which == 27) { // escape\r\n this.closeDropDown();\r\n }\r\n // TODO may be do it on \"space\" (when there is left only one)?\r\n else {\r\n let text = this.filterInput.value.trim().toLowerCase();\r\n let visibleMultiSelectDataList = this.getVisibleMultiSelectDataList();\r\n if (text && visibleMultiSelectDataList.length == 1)\r\n {\r\n let fullMatchMultiSelectData= visibleMultiSelectDataList[0];\r\n if (fullMatchMultiSelectData.searchText == text)\r\n {\r\n fullMatchMultiSelectData.toggle();\r\n this.clearFilterInput(true);\r\n }\r\n }\r\n }\r\n });\r\n this.filterInput.addEventListener('input', () => {\r\n this.input(true);\r\n });\r\n }\r\n}\r\n\r\nexport default MultiSelect;\r\n","export function ExtendIfUndefined(destination, source) {\r\n for (var property in source)\r\n if (destination[property] === undefined)\r\n destination[property] = source[property];\r\n}\r\n\r\nexport function ExtendIfUndefinedFluent(destination, source) {\r\n ExtendIfUndefined(destination, source);\r\n return destination;\r\n}","import { ExtendIfUndefined } from './Tools';\r\n\r\nconst bs4StylingMethodCssDefaults = {\r\n selectedPanelFocusClass : 'focus',\r\n selectedPanelDisabledClass: 'disabled',\r\n dropDownItemDisabledClass: 'disabled'\r\n};\r\n\r\nfunction Bs4StylingMethodCss(configuration){\r\n ExtendIfUndefined(configuration, bs4StylingMethodCssDefaults);\r\n\r\n return {\r\n Enable($selectedPanel){\r\n $selectedPanel.removeClass(configuration.selectedPanelDisabledClass)\r\n },\r\n \r\n Disable($selectedPanel){\r\n $selectedPanel.addClass(configuration.selectedPanelDisabledClass)\r\n },\r\n \r\n FocusIn($selectedPanel){\r\n $selectedPanel.addClass(configuration.selectedPanelFocusClass);\r\n },\r\n \r\n FocusOut($selectedPanel){\r\n $selectedPanel.removeClass(configuration.selectedPanelFocusClass);\r\n }\r\n }\r\n}\r\n\r\nexport default Bs4StylingMethodCss;","import { ExtendIfUndefined } from './Tools';\r\n\r\nconst defSelectedPanelStyle = {'margin-bottom': '0', 'height': 'auto'};\r\n\r\nconst bs4StylingMethodJsDefaults = {\r\n selectedPanelDefMinHeight: 'calc(2.25rem + 2px)',\r\n selectedPanelLgMinHeight: 'calc(2.875rem + 2px)',\r\n selectedPanelSmMinHeight: 'calc(1.8125rem + 2px)',\r\n selectedPanelDisabledBackgroundColor: '#e9ecef',\r\n selectedPanelFocusBorderColor: '#80bdff',\r\n selectedPanelFocusBoxShadow: '0 0 0 0.2rem rgba(0, 123, 255, 0.25)',\r\n selectedPanelFocusValidBoxShadow: '0 0 0 0.2rem rgba(40, 167, 69, 0.25)',\r\n selectedPanelFocusInvalidBoxShadow: '0 0 0 0.2rem rgba(220, 53, 69, 0.25)',\r\n filterInputColor: '#495057',\r\n //selectedItemContentDisabledOpacity: '.65'\r\n};\r\n\r\nfunction Bs4StylingMethodJs(configuration){\r\n ExtendIfUndefined(configuration, bs4StylingMethodJsDefaults);\r\n\r\n return {\r\n OnInit(composite){\r\n composite.$selectedPanel.css(defSelectedPanelStyle);\r\n composite.$filterInput.css(\"color\", configuration.filterInputColor);\r\n },\r\n \r\n UpdateSize($selectedPanel){\r\n if ($selectedPanel.hasClass(\"form-control-lg\")){\r\n $selectedPanel.css(\"min-height\", configuration.selectedPanelLgMinHeight);\r\n } else if ($selectedPanel.hasClass(\"form-control-sm\")){\r\n $selectedPanel.css(\"min-height\", configuration.selectedPanelSmMinHeight);\r\n } else {\r\n $selectedPanel.css(\"min-height\", configuration.selectedPanelDefMinHeight);\r\n }\r\n },\r\n \r\n Enable($selectedPanel){\r\n $selectedPanel.css(\"background-color\", \"\")\r\n },\r\n \r\n Disable($selectedPanel){\r\n $selectedPanel.css(\"background-color\", configuration.selectedPanelDisabledBackgroundColor)\r\n },\r\n \r\n FocusIn($selectedPanel){\r\n if ($selectedPanel.hasClass(\"is-valid\")){\r\n $selectedPanel.css(\"box-shadow\", configuration.selectedPanelFocusValidBoxShadow);\r\n } else if ($selectedPanel.hasClass(\"is-invalid\")){\r\n $selectedPanel.css(\"box-shadow\", configuration.selectedPanelFocusInvalidBoxShadow);\r\n } else {\r\n $selectedPanel\r\n .css(\"box-shadow\", configuration.selectedPanelFocusBoxShadow)\r\n .css(\"border-color\", configuration.selectedPanelFocusBorderColor);\r\n }\r\n },\r\n \r\n FocusOut($selectedPanel){\r\n $selectedPanel.css(\"box-shadow\", \"\" ).css(\"border-color\", \"\")\r\n },\r\n }\r\n}\r\n\r\nexport default Bs4StylingMethodJs;","import { ExtendIfUndefined } from './Tools';\r\n\r\n// Bs4Styling\r\nconst bs4StylingDefaults = {\r\n containerClass: 'dashboardcode-bsmultiselect',\r\n dropDownMenuClass: 'dropdown-menu',\r\n dropDownItemClass: 'px-2',\r\n dropDownItemHoverClass: 'text-primary bg-light',\r\n selectedPanelClass: 'form-control',\r\n selectedItemClass: 'badge',\r\n removeSelectedItemButtonClass: 'close',\r\n filterInputItemClass: '',\r\n filterInputClass: ''\r\n}\r\n\r\nfunction Bs4Styling(stylingMethod, configuration, $) {\r\n ExtendIfUndefined(configuration, bs4StylingDefaults);\r\n\r\n return {\r\n Init(composite){\r\n composite.$container.addClass(configuration.containerClass);\r\n composite.$selectedPanel.addClass(configuration.selectedPanelClass);\r\n composite.$dropDownMenu.addClass(configuration.dropDownMenuClass);\r\n composite.$filterInputItem.addClass(configuration.filterInputItemClass);\r\n composite.$filterInput.addClass(configuration.filterInputClass);\r\n if (stylingMethod.OnInit)\r\n stylingMethod.OnInit(composite)\r\n },\r\n\r\n UpdateIsValid(composite, isValid, isInvalid){\r\n if (isValid)\r\n composite.$selectedPanel.addClass('is-valid');\r\n\r\n if (isInvalid)\r\n composite.$selectedPanel.addClass('is-invalid');\r\n },\r\n\r\n UpdateSize(composite){\r\n if(stylingMethod.UpdateSize)\r\n stylingMethod.UpdateSize(composite.$selectedPanel)\r\n },\r\n\r\n Enable(composite){\r\n stylingMethod.Enable(composite.$selectedPanel)\r\n },\r\n\r\n Disable(composite){\r\n stylingMethod.Disable(composite.$selectedPanel)\r\n },\r\n\r\n FocusIn(composite){\r\n stylingMethod.FocusIn(composite.$selectedPanel)\r\n },\r\n\r\n FocusOut(composite){\r\n stylingMethod.FocusOut(composite.$selectedPanel)\r\n },\r\n\r\n HoverIn(dropDownItem){\r\n $(dropDownItem).addClass(configuration.dropDownItemHoverClass);\r\n },\r\n\r\n HoverOut(dropDownItem){\r\n $(dropDownItem).removeClass(configuration.dropDownItemHoverClass);\r\n }\r\n }\r\n \r\n}\r\n\r\nexport default Bs4Styling;","import { ExtendIfUndefined } from './Tools';\r\n\r\nconst bs4StylingMethodCssdefaults = {\r\n selectedItemContentDisabledClass: 'disabled'\r\n};\r\n\r\nfunction Bs4SelectedItemContentStylingMethodCss(configuration) {\r\n ExtendIfUndefined(configuration, bs4StylingMethodCssdefaults);\r\n\r\n return {\r\n disableSelectedItemContent($content){\r\n $content.addClass(configuration.selectedItemContentDisabledClass )\r\n }\r\n }\r\n}\r\n\r\nconst defSelectedItemStyle = {'padding-left': '0px', 'line-height': '1.5em'};\r\nconst defRemoveSelectedItemButtonStyle = {'font-size':'1.5em', 'line-height': '.9em'};\r\nconst bs4StylingMethodJsDefaults = {\r\n selectedItemContentDisabledOpacity: '.65'\r\n };\r\n\r\nfunction Bs4SelectedItemContentStylingMethodJs(configuration) {\r\n ExtendIfUndefined(configuration, bs4StylingMethodJsDefaults);\r\n return {\r\n disableSelectedItemContent($content){\r\n $content.css(\"opacity\", configuration.selectedItemContentDisabledOpacity )\r\n },\r\n \r\n createSelectedItemContent($selectedItem, $button){\r\n $selectedItem.css(defSelectedItemStyle);\r\n if ($button)\r\n $button.css(defRemoveSelectedItemButtonStyle);\r\n }\r\n }\r\n}\r\n\r\nconst bs4SelectedItemContentDefaults = {\r\n selectedItemClass: 'badge',\r\n removeSelectedItemButtonClass: 'close'\r\n};\r\nfunction Bs4SelectedItemContent(stylingMethod, configuration, $) {\r\n ExtendIfUndefined(configuration, bs4SelectedItemContentDefaults);\r\n \r\n return function (selectedItem, optionItem, removeSelectedItem, preventDefaultMultiSelect){\r\n let $selectedItem = $(selectedItem)\r\n $selectedItem.addClass(configuration.selectedItemClass);\r\n let $content = $(``).text(optionItem.text);\r\n $content.appendTo($selectedItem);\r\n if (optionItem.disabled)\r\n stylingMethod.disableSelectedItemContent($content);\r\n let $button = $('')\r\n // bs 'close' class that will be added to button set the float:right, therefore it impossible to configure no-warp policy \r\n // with .css(\"white-space\", \"nowrap\") or .css(\"display\", \"inline-block\"); TODO: migrate to flex? \r\n .css(\"float\", \"none\").appendTo($selectedItem)\r\n .addClass(configuration.removeSelectedItemButtonClass) // bs close class set the float:right\r\n .on(\"click\", (jqEvent) => \r\n { removeSelectedItem(); preventDefaultMultiSelect(jqEvent.originalEvent);});\r\n \r\n if (stylingMethod.createSelectedItemContent)\r\n stylingMethod.createSelectedItemContent($selectedItem, $button);\r\n return {\r\n disable(isDisabled){ $button.prop('disabled', isDisabled); }\r\n };\r\n }\r\n}\r\n\r\nexport { Bs4SelectedItemContent as Bs4SelectedItemContent, Bs4SelectedItemContentStylingMethodJs, Bs4SelectedItemContentStylingMethodCss};","import { ExtendIfUndefined} from './Tools';\r\n\r\nconst bs4StylingMethodCssDefaults = {\r\n selectedItemContentDisabledClass: 'disabled',\r\n};\r\n\r\nfunction Bs4DropDownItemContentStylingMethodCss(configuration) {\r\n ExtendIfUndefined(configuration, bs4StylingMethodCssDefaults);\r\n return {\r\n disabledStyle($checkBox, $checkBoxLabel, isDisbaled){\r\n if (isDisbaled) \r\n $checkBox.addClass(configuration.dropDownItemDisabledClass);\r\n else\r\n $checkBox.removeClass(configuration.dropDownItemDisabledClass);\r\n }\r\n }\r\n}\r\n\r\nconst bs4StylingMethodJsDefaults = {\r\n selectedItemContentDisabledOpacity: '.65',\r\n dropdDownLabelDisabledColor: '#6c757d'\r\n};\r\n\r\nfunction Bs4DropDownItemContentStylingMethodJs(configuration) {\r\n ExtendIfUndefined(configuration, bs4StylingMethodJsDefaults);\r\n return{\r\n disabledStyle($checkBox, $checkBoxLabel, isDisbaled){\r\n $checkBoxLabel.css('color', isDisbaled?configuration.dropdDownLabelDisabledColor:'')\r\n }\r\n }\r\n}\r\n\r\nconst bs4DropDownItemContentDefaults = {\r\n dropDownItemClass: 'px-2',\r\n}\r\n\r\nfunction Bs4DropDownItemContent(stylingMethod, configuration, $) {\r\n ExtendIfUndefined(configuration, bs4DropDownItemContentDefaults);\r\n return function(dropDownItem, option){\r\n let $dropDownItem = $(dropDownItem);\r\n $dropDownItem.addClass(configuration.dropDownItemClass);\r\n let $dropDownItemContent= $(`
\r\n \r\n \r\n
`);\r\n $dropDownItemContent.appendTo(dropDownItem);\r\n let $checkBox = $dropDownItemContent.find(`INPUT[type=\"checkbox\"]`);\r\n let $checkBoxLabel = $dropDownItemContent.find(`label`);\r\n $checkBoxLabel.text(option.text);\r\n\r\n return { \r\n select(isSelected){ $checkBox.prop('checked', isSelected); }, \r\n disable(isDisabled){ $checkBox.prop('disabled', isDisabled); },\r\n disabledStyle(isDisbaled){ stylingMethod.disabledStyle($checkBox, $checkBoxLabel, isDisbaled); },\r\n onSelected(toggle) {\r\n $checkBox.on(\"change\", toggle)\r\n $dropDownItem.on(\"click\", event => {\r\n if (dropDownItem === event.target || $.contains(dropDownItem, event.target)) {\r\n toggle();\r\n }\r\n })\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport { Bs4DropDownItemContent, Bs4DropDownItemContentStylingMethodJs, Bs4DropDownItemContentStylingMethodCss };","import $ from 'jquery'\r\n\r\nimport MultiSelect from './MultiSelect'\r\nimport LabelAdapter from './LabelAdapter';\r\nimport {OptionsAdapterJson,OptionsAdapterElement} from './OptionsAdapters';\r\n\r\nimport Bs4StylingMethodCss from './Bs4StylingMethodCss'\r\nimport Bs4StylingMethodJs from './Bs4StylingMethodJs'\r\nimport Bs4Styling from './Bs4Styling';\r\nimport AddToJQueryPrototype from './AddToJQueryPrototype'\r\n\r\nimport { Bs4SelectedItemContent, Bs4SelectedItemContentStylingMethodJs, Bs4SelectedItemContentStylingMethodCss} from './Bs4SelectedItemContent';\r\nimport { Bs4DropDownItemContent, Bs4DropDownItemContentStylingMethodJs, Bs4DropDownItemContentStylingMethodCss} from './Bs4DropDownItemContent';\r\n\r\n(\r\n (window, $) => {\r\n AddToJQueryPrototype('BsMultiSelect',\r\n (element, settings, onDispose) => {\r\n let configuration = $.extend({}, settings); // settings used per jQuery intialization, configuration per element\r\n if (configuration.preBuildConfiguration)\r\n configuration.preBuildConfiguration(element, configuration);\r\n \r\n var $element= $(element);\r\n let optionsAdapter = null;\r\n if (configuration.optionsAdapter)\r\n optionsAdapter = configuration.optionsAdapter;\r\n else\r\n {\r\n var trigger = function(eventName){\r\n $element.trigger(eventName);\r\n }\r\n if (configuration.options){\r\n optionsAdapter = OptionsAdapterJson(\r\n element,\r\n configuration.options,\r\n configuration.getDisabled,\r\n configuration.getIsValid,\r\n configuration.getIsInvalid,\r\n trigger );\r\n if (!configuration.createInputId)\r\n configuration.createInputId=()=>`${configuration.containerClass}-generated-filter-${element.id}`;\r\n \r\n }else {\r\n if (!configuration.label)\r\n {\r\n let $formGroup = $(element).closest('.form-group');\r\n if ($formGroup.length == 1) {\r\n let $label = $formGroup.find(`label[for=\"${element.id}\"]`);\r\n if ($label.length>0)\r\n { \r\n let label = $label.get(0);\r\n let forId = label.getAttribute('for');\r\n if (forId == element.id) {\r\n configuration.label = label;\r\n }\r\n } \r\n }\r\n }\r\n optionsAdapter = OptionsAdapterElement(element, trigger);\r\n if (!configuration.createInputId)\r\n configuration.createInputId=()=>`${configuration.containerClass}-generated-input-${((element.id)?element.id:element.name).toLowerCase()}-id`;\r\n }\r\n }\r\n\r\n let labelAdapter = LabelAdapter(configuration.label, configuration.createInputId);\r\n\r\n let useCss = configuration.useCss;\r\n let styling = configuration.styling;\r\n if (!configuration.adapter)\r\n {\r\n let stylingMethod = configuration.stylingMethod;\r\n if (!stylingMethod)\r\n {\r\n if (useCss)\r\n stylingMethod = Bs4StylingMethodCss(configuration);\r\n else\r\n stylingMethod = Bs4StylingMethodJs(configuration);\r\n }\r\n styling = Bs4Styling(stylingMethod, configuration, $);\r\n }\r\n\r\n let selectedItemContent = configuration.selectedItemContent;\r\n if (!selectedItemContent){\r\n let selectedItemContentStylingMethod = configuration.selectedItemContentStylingMethod;\r\n if (!selectedItemContentStylingMethod)\r\n {\r\n if (useCss)\r\n selectedItemContentStylingMethod=Bs4SelectedItemContentStylingMethodCss(configuration, $);\r\n else\r\n selectedItemContentStylingMethod=Bs4SelectedItemContentStylingMethodJs(configuration, $);\r\n }\r\n selectedItemContent = Bs4SelectedItemContent(selectedItemContentStylingMethod, configuration, $);\r\n }\r\n\r\n let dropDownItemContent = configuration.bs4DropDownItemContent;\r\n if (!dropDownItemContent){\r\n let dropDownItemContentStylingMethod = configuration.dropDownItemContentStylingMethod;\r\n if (useCss)\r\n dropDownItemContentStylingMethod=Bs4DropDownItemContentStylingMethodCss(configuration, $);\r\n else\r\n dropDownItemContentStylingMethod=Bs4DropDownItemContentStylingMethodJs(configuration, $);\r\n dropDownItemContent = Bs4DropDownItemContent(dropDownItemContentStylingMethod, configuration, $)\r\n }\r\n\r\n let createStylingComposite = function(container, selectedPanel, filterInputItem, filterInput, dropDownMenu){\r\n return {\r\n $container:$(container),\r\n $selectedPanel:$(selectedPanel),\r\n $filterInputItem:$(filterInputItem),\r\n $filterInput:$(filterInput),\r\n $dropDownMenu:$(dropDownMenu)\r\n };\r\n }\r\n\r\n let multiSelect = new MultiSelect(\r\n optionsAdapter,\r\n styling,\r\n selectedItemContent,\r\n dropDownItemContent,\r\n labelAdapter,\r\n createStylingComposite,\r\n configuration,\r\n onDispose,\r\n window);\r\n\r\n if (configuration.postBuildConfiguration)\r\n configuration.postBuildConfiguration(element, multiSelect);\r\n \r\n multiSelect.init();\r\n return multiSelect;\r\n }, $);\r\n }\r\n)(window, $)\r\n","function AddToJQueryPrototype(pluginName, createPlugin, $){\r\n const firstChar = pluginName.charAt(0);\r\n const firstCharLower = firstChar.toLowerCase();\r\n if (firstCharLower == firstChar) {\r\n throw new TypeError(`Plugin name '${pluginName}' should be started from upper case char`)\r\n }\r\n const prototypableName = firstCharLower + pluginName.slice(1)\r\n const noConflictPrototypable = $.fn[prototypableName];\r\n const dataKey = `DashboardCode.${pluginName}`;\r\n\r\n function prototypable(options) {\r\n return this.each( function () {\r\n let $e = $(this);\r\n let instance = $e.data(dataKey)\r\n let isMethodName = typeof options === 'string';\r\n if (!instance) {\r\n if (isMethodName && /Dispose/.test(options)) {\r\n return;\r\n }\r\n const optionsObject = (typeof options === 'object')?options:null;\r\n\r\n instance = createPlugin(this, optionsObject,\r\n () => {\r\n $e.removeData(dataKey)\r\n });\r\n $e.data(dataKey, instance);\r\n }\r\n\r\n if (isMethodName) {\r\n let methodName = options;\r\n if (typeof instance[methodName] === 'undefined') {\r\n throw new TypeError(`No method named '${methodName}'`)\r\n }\r\n instance[methodName]()\r\n }\r\n })\r\n }\r\n\r\n $.fn[prototypableName] = prototypable;\r\n\r\n // pluginName with first capitalized letter - return plugin instance for 1st $selected item\r\n $.fn[pluginName] = function () {\r\n return $(this).data(dataKey);\r\n };\r\n\r\n $.fn[prototypableName].noConflict = function () {\r\n $.fn[prototypableName] = noConflictPrototypable\r\n return prototypable;\r\n }\r\n}\r\n\r\nexport default AddToJQueryPrototype;","function OptionsAdapterJson(container, options, getDisabled, getIsValid, getIsInvalid, trigger) {\r\n return {\r\n container,\r\n options,\r\n dispose(){\r\n while (container.firstChild) container.removeChild(container.firstChild);\r\n },\r\n triggerChange(){\r\n trigger('multiselect:change');\r\n },\r\n getDisabled(){\r\n return getDisabled?getDisabled():false;\r\n },\r\n getIsValid(){\r\n return getIsValid?getIsValid():false;\r\n },\r\n getIsInvalid(){\r\n return getIsInvalid?getIsInvalid():false;\r\n }\r\n }\r\n}\r\n\r\nfunction OptionsAdapterElement(selectElement, trigger) {\r\n selectElement.style.display='none';\r\n var container = document.createElement('div');\r\n var options = selectElement.getElementsByTagName('OPTION');\r\n return {\r\n container,\r\n options,\r\n dispose(){\r\n container.parentNode.removeChild(container);\r\n },\r\n afterContainerFilled(){\r\n selectElement.parentNode.insertBefore(container, selectElement.nextSibling);\r\n },\r\n triggerChange(){\r\n trigger('change');\r\n trigger('multiselect:change');\r\n },\r\n getDisabled(){\r\n return selectElement.disabled;\r\n },\r\n getIsValid(){\r\n return selectElement.classList.contains('is-valid');\r\n },\r\n getIsInvalid(){\r\n return selectElement.classList.contains('is-invalid');\r\n }\r\n }\r\n}\r\n\r\nexport {OptionsAdapterJson, OptionsAdapterElement};\r\n","function LabelAdapter(label, createInputId){\r\n var backupedFor = null; // state saved between init and dispose\r\n return {\r\n init(filterInput) {\r\n if (label) {\r\n backupedFor = label.getAttribute('for');\r\n var newId = createInputId();\r\n filterInput.setAttribute('id', newId);\r\n label.setAttribute('for',newId);\r\n }\r\n },\r\n dispose(){\r\n if(backupedFor)\r\n label.setAttribute('for',backupedFor);\r\n }\r\n }\r\n}\r\n\r\nexport default LabelAdapter;"]}