{"version":3,"sources":["../../src/BsMultiSelect.es8.js"],"names":["window","$","Popper","JQUERY_NO_CONFLICT","pluginName","dataKey","defaults","Plugin","jQueryInterface","fn","items","selectedPanelMinHeight","selectedPanelReadonlyBackgroundColor","selectedPanelValidBoxShadow","selectedPanelInvalidBoxShadow","filterInputColor","containerClass","dropDownMenuClass","dropDownItemClass","selectedPanelClass","selectedPanelStyle","min-height","selectedPanelStyleSys","cursor","display","flex-wrap","align-items","margin-bottom","selectedPanelReadonlyStyle","background-color","selectedItemClass","selectedItemStyle","padding-left","selectedItemStyleSys","removeSelectedItemButtonClass","removeSelectedItemButtonStyle","font-size","filterInputItemClass","filterInputItemStyle","filterInputItemStyleSys","filterInputClass","filterInputStyle","color","filterInputStyleSys","width","border","padding","outline","element","options","_classCallCheck","this","TypeError","extend","input","container","dropDownMenu","selectedPanel","filterInput","filterInputItem","popper","skipFocusout","backspaceAtStartPoint","selectedDropDownItem","selectedDropDownIndex","hasItems","init","key","value","update","removeClass","addClass","optionId","isChecked","i","length","selected","val","clearFilterInput","hideDropDown","updateDropDownPosition","filterDropDownMenu","text","trim","visible","find","each","$item","show","itemText","prop","toLowerCase","includes","hide","resetSelectDropDownMenu","event","preventDefault","stopPropagation","menuItem","currentTarget","closest","$menuItem","data","$checkBox","$selectedItem","concat","removeSelectedItem","createAndAppendSelectedItem","focus","itemValue","checkBoxId","name","checked","appendTo","_this","css","insertBefore","$buttom","setCheck","click","style","item","_toConsumableArray","querySelectorAll","textContent","undefined","classList","remove","down","showDropDown","newIndex","add","_this2","$input","disabled","$container","insertAfter","get","$selectedPanel","hasClass","$filterInputItem","$filterInput","$dropDownMenu","placement","modifiers","flip","behavior","forEach","appendDropDownItem","selectOptions","index","option","inputId","id","formGroup","label","querySelector","attr","setAttribute","clickDropDownItem","on","target","nodeName","parentElement","which","keyCode","keydownArrow","selectionStart","selectionEnd","analyzeInputText","startPosition","array","itemToDelete","dataset","closeDropDown","adoptFilterInputLength","focusin","focusout","mousedown","document","mouseup","contains","test","optionsObject","_typeof","methodName","charAt","toUpperCase","slice","Constructor","noConflict"],"mappings":";;;;;06BAQA,IAAwBA,EAAQC,EAAGC,EACzBC,EACAC,EACAC,EACAC,EAqCAC,EA2eFC,mGAphBgBR,EA2jBrBA,OA3jBgCE,EA2jBrBA,EA1jBJC,GADsBF,EA2jBrBA,GA1jBsBQ,GAAGL,GAE1BC,EAAU,WADVD,EAAa,8BAEbE,EAAW,CACbI,MAAO,GACPJ,SAAU,GAEVK,uBAAwB,sBACxBC,qCAAsC,UACtCC,4BAA6B,wCAC7BC,8BAA+B,uCAC/BC,iBAAkB,UAGlBC,eAAgB,8BAChBC,kBAAmB,gBACnBC,kBAAmB,OAEnBC,mBAAoB,0BACpBC,mBAAoB,CAAEC,aAAc,uBACpCC,sBAAuB,CAAEC,OAAU,OAAQC,QAAW,OAAQC,YAAa,OAAQC,cAAe,SAAUC,gBAAiB,OAE7HC,2BAA4B,CAAEC,mBAAmB,WAEjDC,kBAAmB,QACnBC,kBAAmB,CAAEC,eAAgB,OACrCC,qBAAsB,CAAET,QAAW,OAAQE,cAAe,UAE1DQ,8BAA+B,QAC/BC,8BAA+B,CAAEC,YAAa,QAE9CC,qBAAsB,GACtBC,qBAAsB,GACtBC,wBAAyB,CAACf,QAAW,SAErCgB,iBAAkB,GAClBC,iBAAkB,CAAEC,MAAS,WAC7BC,oBAAqB,CAAEC,MAAS,MAAOC,OAAU,IAAKC,QAAW,IAAKC,QAAW,SAG/ExC,EAzCoC,WA0CtC,SAAAA,EAAYyC,EAASC,GACjB,+FAD0BC,CAAAC,KAAA5C,GACJ,oBAAXL,EACP,MAAM,IAAIkD,UAAU,yEAIxBD,KAAKH,QAAUA,EACfG,KAAKF,QAAUhD,EAAEoD,OAAO,GAAI/C,EAAU2C,GACtCE,KAAKG,MAAQN,EACbG,KAAKI,UAAY,KACjBJ,KAAKK,aAAe,KACpBL,KAAKM,cAAgB,KACrBN,KAAKO,YAAc,KACnBP,KAAKQ,gBAAkB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,EAAA,GAohBtCC,EAAkB,SAAUyC,GAC5B,OAAOE,KAAKmC,KAAK,WACb,IAAIgB,EAAOrG,EAAEkD,MAAMmD,KAAKjG,GAExB,IAAKiG,EAAM,CACP,GAAI,eAAegF,KAAKrI,GACpB,OAGA,IAAMsI,EAAoC,WAAnBC,EAAOvI,GAAuBA,EAAQ,KAC7DqD,EAAO,IAAI/F,EAAO4C,KAAMoI,GACxBtL,EAAEkD,MAAMmD,KAAKjG,EAASiG,GAI9B,GAAuB,iBAAZrD,EAAsB,CAC7B,IAAIwI,EAAaxI,EACjB,GAAgC,oBAArBqD,EAAKmF,GACZ,MAAM,IAAIrI,UAAJ,oBAAAqD,OAAkCgF,EAAlC,MAEVnF,EAAKmF,SAKjBxL,EAAEQ,GAAGL,GAAcI,EAGnBP,EAAEQ,GAAGL,EAAWsL,OAAO,GAAGC,cAAgBvL,EAAWwL,MAAM,IAAM,SAAU3I,GACvE,OAAOhD,EAAEkD,MAAMmD,KAAK,UAAYlG,IAGpCH,EAAEQ,GAAGL,GAAYyL,YAActL,EAE/BN,EAAEQ,GAAGL,GAAY0L,WAAa,WAE1B,OADA7L,EAAEQ,GAAGL,GAAcD,EACZK,GAEJD","sourcesContent":["import $ from 'jquery'\r\nimport Popper from 'popper.js'\r\n\r\n// TODO: \r\n// 2) require polyfill Element.closest polyfill IE 11\r\n// 3) require multiple classList.add polyfill IE 11\r\n\r\n// IIFE to declare private members\r\nconst BsMultiSelect = ((window, $, Popper) => {\r\n const JQUERY_NO_CONFLICT = $.fn[pluginName];\r\n const pluginName = \"dashboardCodeBsMultiSelect\";\r\n const dataKey = \"plugin_\" + pluginName;\r\n const defaults = {\r\n items: [],\r\n defaults: [],\r\n //usePopper: true,\r\n selectedPanelMinHeight: \"calc(2.25rem + 2px)\",\r\n selectedPanelReadonlyBackgroundColor: \"#e9ecef\",\r\n selectedPanelValidBoxShadow: \" 0 0 0 0.2rem rgba(40, 167, 69, 0.25)\",\r\n selectedPanelInvalidBoxShadow: \"0 0 0 0.2rem rgba(220, 53, 69, 0.25)\",\r\n filterInputColor: \"#495057\",\r\n\r\n\r\n containerClass: \"dashboardcode-bsmultiselect\",\r\n dropDownMenuClass: \"dropdown-menu\",\r\n dropDownItemClass: \"px-2\",\r\n\r\n selectedPanelClass: \"form-control btn border\",\r\n selectedPanelStyle: { \"min-height\": \"calc(2.25rem + 2px)\" },\r\n selectedPanelStyleSys: { \"cursor\": \"text\", \"display\": \"flex\", \"flex-wrap\": \"wrap\", \"align-items\": \"center\", \"margin-bottom\": \"0px\" }, \r\n \r\n selectedPanelReadonlyStyle: { \"background-color\":\"#e9ecef\"},\r\n \r\n selectedItemClass: \"badge\", \r\n selectedItemStyle: { \"padding-left\": \"0px\"},\r\n selectedItemStyleSys: { \"display\": \"flex\", \"align-items\": \"center\" },\r\n \r\n removeSelectedItemButtonClass: \"close\",\r\n removeSelectedItemButtonStyle: { \"font-size\": \"100%\" }, \r\n \r\n filterInputItemClass: \"\", \r\n filterInputItemStyle: {},\r\n filterInputItemStyleSys: {\"display\": \"block\"},\r\n \r\n filterInputClass: \"\",\r\n filterInputStyle: { \"color\": \"#495057\" },\r\n filterInputStyleSys: { \"width\": \"2ch\", \"border\": \"0\", \"padding\": \"0\", \"outline\": \"none\", }\r\n };\r\n\r\n class Plugin {\r\n constructor(element, options) {\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.element = element;\r\n this.options = $.extend({}, defaults, options);\r\n this.input = element;\r\n this.container = null;\r\n this.dropDownMenu = null;\r\n this.selectedPanel = null;\r\n this.filterInput = null;\r\n this.filterInputItem = null;\r\n this.popper = null;\r\n\r\n // state\r\n this.skipFocusout = false;\r\n this.backspaceAtStartPoint = null;\r\n this.selectedDropDownItem = null;\r\n this.selectedDropDownIndex = null;\r\n this.hasItems = false;\r\n\r\n this.init();\r\n }\r\n\r\n updateDropDownPosition() {\r\n //console.log(\"updateDropDownPosition\");\r\n //if (this.options.usePopper) {\r\n this.popper.update();\r\n // } else {\r\n // $(this.dropDownMenu).dropdown('update');\r\n // }\r\n }\r\n\r\n hideDropDown() {\r\n //if (this.options.usePopper) {\r\n //console.log(\"popper remove show\");\r\n $(this.dropDownMenu).removeClass('show')\r\n // } else {\r\n // if ($(this.dropDownMenu).hasClass('show'))\r\n // $(this.dropDownMenu).dropdown('toggle');\r\n // }\r\n }\r\n\r\n showDropDown() {\r\n if (this.hasItems) {\r\n //if (this.options.usePopper) {\r\n //console.log(\"popper add show\");\r\n $(this.dropDownMenu).addClass('show')\r\n // } else {\r\n // if (!$(this.dropDownMenu).hasClass('show'))\r\n // $(this.dropDownMenu).dropdown('toggle');\r\n // }\r\n }\r\n }\r\n\r\n setCheck(optionId, isChecked) {\r\n for (var i = 0; i < this.input.options.length; i += 1) {\r\n var option = this.input.options[i];\r\n if (option.value == optionId) {\r\n this.input.options[i].selected = isChecked;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Public methods\r\n getInputValue() {\r\n return $(this.input).val();\r\n }\r\n\r\n closeDropDown() {\r\n this.clearFilterInput();\r\n this.hideDropDown();\r\n this.updateDropDownPosition();\r\n }\r\n\r\n\r\n clearFilterInput() {\r\n if (this.filterInput.value != '') {\r\n this.filterInput.value = '';\r\n this.filterDropDownMenu();\r\n if (this.hasItems) {\r\n this.updateDropDownPosition(); \r\n } \r\n }\r\n }\r\n\r\n filterDropDownMenu() {\r\n var text = this.filterInput.value.trim();\r\n var visible = 0;\r\n $(this.dropDownMenu).find('li').each(function () {\r\n var $item = $(this);\r\n if (text == \"\") {\r\n $item.show();\r\n visible++;\r\n }\r\n else {\r\n var itemText = $item.text();\r\n var $checkbox = $item.find('input[type=\"checkbox\"]');\r\n \r\n if (!$checkbox.prop('checked') && itemText.toLowerCase().includes(text.toLowerCase())) {\r\n $item.show();\r\n visible++;\r\n } else {\r\n $item.hide();\r\n }\r\n }\r\n });\r\n this.hasItems = (visible > 0);\r\n this.resetSelectDropDownMenu();\r\n }\r\n\r\n clickDropDownItem(event) {\r\n //console.log(\"filter & stopPropagation\");\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n var menuItem = event.currentTarget.closest(\"LI\");\r\n var $menuItem = $(menuItem);\r\n var optionId = $menuItem.data(\"option-id\");\r\n var $checkBox = $menuItem.find('input[type=\"checkbox\"]');\r\n if ($checkBox.prop('checked')) {\r\n var $selectedItem = $(this.selectedPanel).find(`li[data-option-id=\"${optionId}\"]`);\r\n this.removeSelectedItem($selectedItem, optionId, $checkBox);\r\n } else {\r\n var itemText = $menuItem.find('label').text();\r\n this.createAndAppendSelectedItem($checkBox, optionId, itemText);\r\n $checkBox.prop('checked', true);\r\n }\r\n this.clearFilterInput();\r\n $(this.filterInput).focus();\r\n }\r\n\r\n \r\n appendDropDownItem(itemValue, itemText, isChecked) {\r\n var optionId = itemValue;\r\n var checkBoxId = `dashboardcode-bsmultiselect-${this.input.name.toLowerCase()}-generated-id-${optionId.toLowerCase()}`;\r\n var checked = isChecked ? \"checked\" : \"\";\r\n var $dropDownItem = $(\r\n `
  • \r\n
    \r\n \r\n \r\n
    \r\n
  • `).addClass(this.options.dropDownItemClass).appendTo($(this.dropDownMenu));\r\n\r\n var $checkBox = $dropDownItem.find(`input[type=\"checkbox\"]`);\r\n if (isChecked) {\r\n this.createAndAppendSelectedItem($checkBox, optionId, itemText);\r\n }\r\n }\r\n \r\n createAndAppendSelectedItem($checkBox, optionId, itemText) {\r\n var $selectedItem = $(`
  • ${itemText}
  • `)\r\n .css(this.options.selectedItemStyleSys)\r\n .css(this.options.selectedItemStyle)\r\n .addClass(this.options.selectedItemClass) \r\n .insertBefore($(this.filterInputItem));\r\n var $buttom = $(\"\")\r\n .css(this.options.removeSelectedItemButtonStyle)\r\n .addClass(this.options.removeSelectedItemButtonClass)\r\n .appendTo($selectedItem); \r\n this.setCheck(optionId, true);\r\n\r\n $buttom.click((event) => {\r\n this.removeSelectedItem($selectedItem, optionId, $checkBox)\r\n this.updateDropDownPosition();\r\n $(this.filterInput).focus();\r\n });\r\n }\r\n\r\n adoptFilterInputLength() {\r\n this.filterInput.style.width = this.filterInput.value.length*1.3 + 2 + \"ch\";\r\n }\r\n\r\n analyzeInputText() {\r\n var text = this.filterInput.value.trim().toLowerCase();\r\n var item = [...this.dropDownMenu.querySelectorAll(\"LI\")]\r\n .find(i => i.textContent.trim().toLowerCase() == text);\r\n if (item != undefined) {\r\n var $item = $(item);\r\n var $checkBox = $item.find('input[type=\"checkbox\"]');\r\n if (!$checkBox.prop('checked')) {\r\n var optionId = $item.data('option-id');\r\n var itemText = $item.find('label').text();\r\n this.createAndAppendSelectedItem($checkBox, optionId, itemText);\r\n $checkBox.prop('checked', true);\r\n\r\n }\r\n this.clearFilterInput();\r\n }\r\n }\r\n\r\n resetSelectDropDownMenu() {\r\n if (this.selectedDropDownItem != null) {\r\n // IE11 doesn't support remove('text-primary', bg-light' )\r\n this.selectedDropDownItem.classList.remove('bg-light');\r\n this.selectedDropDownItem.classList.remove('text-primary');\r\n this.selectedDropDownItem = null;\r\n }\r\n this.selectedDropDownIndex = null;\r\n }\r\n \r\n keydownArrow(down) {\r\n var items = [...this.dropDownMenu.querySelectorAll('LI:not([style*=\"display: none\"]')];\r\n if (items.length > 0) {\r\n this.showDropDown();\r\n if (this.selectedDropDownItem == null) {\r\n \r\n this.selectedDropDownIndex = (down) ? 0 : items.length - 1;\r\n }\r\n else {\r\n // IE11 doesn't support remove('text-primary', bg-light' )\r\n this.selectedDropDownItem.classList.remove('bg-light');\r\n this.selectedDropDownItem.classList.remove('text-primary');\r\n if (down) {\r\n var newIndex = this.selectedDropDownIndex + 1;\r\n this.selectedDropDownIndex = (newIndex < items.length) ? newIndex : 0;\r\n } else {\r\n var newIndex = this.selectedDropDownIndex - 1;\r\n this.selectedDropDownIndex = (newIndex >= 0) ? newIndex : items.length - 1;\r\n }\r\n }\r\n this.selectedDropDownItem = items[this.selectedDropDownIndex];\r\n // IE11 doesn't support add('text-primary', bg-light' )\r\n this.selectedDropDownItem.classList.add('text-primary');\r\n this.selectedDropDownItem.classList.add('bg-light' );\r\n \r\n }\r\n }\r\n\r\n removeSelectedItem($selectedItem, optionId, $checkBox) {\r\n $selectedItem.remove();\r\n this.setCheck(optionId, false);\r\n $checkBox.prop('checked', false);\r\n }\r\n\r\n init() {\r\n var $input = $(this.input);\r\n $input.hide();\r\n var disabled = this.input.disabled;\r\n\r\n var $container = $(\"
    \")\r\n .addClass(this.options.containerClass)\r\n .insertAfter($input);\r\n \r\n this.container = $container.get(0);\r\n\r\n var $selectedPanel = $(\"