{"version":3,"file":"BsMultiSelect.js","sources":["../../js/src/AddToJQueryPrototype.js","../../js/src/ToolsJs.js","../../js/src/ToolsDom.js","../../js/src/PluginManager.js","../../js/src/ToolsStyling.js","../../js/src/PickDomFactory.js","../../js/src/ChoiceDomFactory.js","../../js/src/StaticDomFactory.js","../../js/src/PicksDom.js","../../js/src/FilterDom.js","../../js/src/ChoicesDomFactory.js","../../js/src/ChoicesVisibilityAspect.js","../../js/src/SpecialPicksEventsAspect.js","../../js/src/ComponentPropertiesAspect.js","../../js/src/OptionsAspect.js","../../js/src/ChoicesEnumerableAspect.js","../../js/src/FilterManagerAspect.js","../../js/src/BuildChoiceAspect.js","../../js/src/OptionsLoopAspect.js","../../js/src/UpdateDataAspect.js","../../js/src/CreateWrapAspect.js","../../js/src/NavigateAspect.js","../../js/src/Wraps.js","../../js/src/PickButtonAspect.js","../../js/src/BuildPickAspect.js","../../js/src/InputAspect.js","../../js/src/ResetFilterListAspect.js","../../js/src/MultiSelectInlineLayout.js","../../js/src/AppearanceAspect.js","../../js/src/LoadAspect.js","../../js/src/CountableChoicesListInsertAspect.js","../../js/src/BsMultiSelect.js","../../js/src/BsMultiSelectDepricatedParameters.js","../../js/src/MultiSelectBuilder.js","../../js/src/CreateForJQuery.js","../../js/src/plugins/LabelPlugin.js","../../js/src/plugins/RtlPlugin.js","../../js/src/plugins/FormResetPlugin.js","../../js/src/ValidityApi.js","../../js/src/plugins/ValidationApiPlugin.js","../../js/src/plugins/BsAppearancePlugin.js","../../js/src/plugins/HiddenOptionPlugin.js","../../js/src/plugins/CssPatchPlugin.js","../../js/src/plugins/PlaceholderPlugin.js","../../js/src/plugins/JQueryMethodsPlugin.js","../../js/src/plugins/OptionsApiPlugin.js","../../js/src/plugins/FormRestoreOnBackwardPlugin.js","../../js/src/plugins/SelectElementPlugin.js","../../js/src/plugins/SelectedOptionPlugin.js","../../js/src/plugins/DisabledOptionPlugin.js","../../js/src/plugins/PicksApiPlugin.js","../../js/src/plugins/PicksPlugin.js","../../js/src/plugins/CreatePopperPlugin.js","../../js/src/plugins/FloatingLabelPlugin.js","../../js/src/plugins/ChoicesDynamicStylingPlugin.js","../../js/src/plugins/WarningPlugin.js","../../js/src/plugins/HighlightPlugin.js","../../js/src/plugins/CustomChoiceStylingsPlugin.js","../../js/src/plugins/CustomPickStylingsPlugin.js","../../js/src/PluginSet.js","../../js/src/plugins/Bs5Plugin.js","../../js/src/ToolSet.js","../../js/src/BsMultiSelect.jquery.js"],"sourcesContent":["export 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 Error(`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 noConflictPrototypableForInstance = $.fn[pluginName];\r\n const dataKey = `DashboardCode.${pluginName}`;\r\n\r\n function createInstance(options, e, $e){\r\n const optionsRef = (typeof options === 'object') || options instanceof Function ? options:null;\r\n let instance = createPlugin(e, optionsRef,\r\n () => {\r\n $e.removeData(dataKey)\r\n });\r\n $e.data(dataKey, instance);\r\n return instance;\r\n }\r\n\r\n function prototypable(options){\r\n let output=[];\r\n this.each( function (i, e) {\r\n let $e = $(e);\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 instance = createInstance(options, e, $e);\r\n }\r\n if (isMethodName) {\r\n let methodName = options;\r\n if (typeof instance[methodName] === 'undefined') {\r\n let lMethodName = methodName.charAt(0).toLowerCase() + methodName.slice(1)\r\n if ( typeof instance[lMethodName] === 'undefined') {\r\n throw new Error(`No method named '${methodName}'`)\r\n } else {\r\n methodName = lMethodName;\r\n }\r\n }\r\n let result = instance[methodName]();\r\n if (result !== undefined){\r\n output.push(result);\r\n }\r\n }\r\n })\r\n if (output.length==0)\r\n return this;\r\n else if (output.length==1)\r\n return output[0];\r\n else\r\n return output;\r\n }\r\n\r\n function prototypableForInstance(options){\r\n let instance = this.data(dataKey);\r\n if (instance)\r\n return instance;\r\n else if (this.length === 1){\r\n return createInstance(options, this.get(0), this);\r\n } else if (this.length > 1){\r\n let output=[];\r\n this.each(function(i, e){\r\n output.push(createInstance(options, e, $(e)));\r\n })\r\n return output;\r\n }\r\n }\r\n \r\n $.fn[prototypableName] = prototypable;\r\n $.fn[prototypableName].noConflict = function () {\r\n $.fn[prototypableName] = noConflictPrototypable\r\n return prototypable;\r\n }\r\n\r\n $.fn[pluginName] = prototypableForInstance;\r\n $.fn[pluginName].noConflict = function () {\r\n $.fn[pluginName] = noConflictPrototypableForInstance\r\n return prototypableForInstance;\r\n }\r\n\r\n return prototypable;\r\n}","export function isBoolean(value){\r\n return value === true || value === false;\r\n}\r\n\r\nexport function isString(value){\r\n return value instanceof String || typeof(value) === 'string';\r\n}\r\n\r\nexport function extendIfUndefined(destination, source) {\r\n for (let property in source)\r\n if (destination[property] === undefined)\r\n destination[property] = source[property];\r\n}\r\n\r\nexport function shallowClearClone(source, ...sources) { // override previous, no null and undefined\r\n var destination = {};\r\n for (let property in source){ // TODO: Object.assign (need polyfill for IE11)\r\n let v = source[property];\r\n if (!(v === null || v===undefined))\r\n destination[property] = v;\r\n }\r\n if(sources)\r\n sources.forEach(\r\n s=>{\r\n for(let property in s){\r\n let v = s[property];\r\n if (!(v === null || v===undefined))\r\n destination[property] = v;\r\n else\r\n if (destination.hasOwnProperty(property)){\r\n delete destination[property];\r\n }\r\n }\r\n }\r\n )\r\n return destination;\r\n}\r\n\r\nfunction forEachRecursion(f, e){\r\n if (!e)\r\n return;\r\n let goOn = f(e.value); \r\n if (!(goOn===false))\r\n forEachRecursion(f, e.prev);\r\n}\r\n\r\nfunction indexRecursion(index, e){\r\n if (!e.prev)\r\n return index;\r\n indexRecursion(++index, e.prev);\r\n}\r\n\r\nexport function List(){\r\n var tail = null;\r\n var count = 0;\r\n return {\r\n add(e){\r\n if (tail){\r\n tail.next = {value:e, prev:tail, next:null};\r\n tail = tail.next;\r\n } else \r\n tail = {value:e, prev:null, next:null}\r\n count++;\r\n let node = tail;\r\n function remove(){\r\n if (node.prev){\r\n (node.prev).next = node.next;\r\n }\r\n if (node.next){\r\n (node.next).prev = node.prev;\r\n }\r\n if (tail == node){\r\n tail = node.prev;\r\n }\r\n count--;\r\n }\r\n function index(){\r\n return indexRecursion(0, node);\r\n }\r\n return {remove, index};\r\n },\r\n forEach(f){\r\n forEachRecursion(f, tail);\r\n },\r\n getTail(){ return (tail)?tail.value:null },\r\n getCount(){ return count },\r\n isEmpty(){ return count==0 },\r\n reset(){ tail=null; count = 0 }\r\n }\r\n}\r\n\r\nexport function DoublyLinkedList(getPrev, setPrev, getNext, setNext){\r\n var head = null, tail = null;\r\n var count = 0;\r\n return {\r\n add(e, next){\r\n if (!tail){\r\n head = tail = e;\r\n setPrev(e, null);\r\n setNext(e, null);\r\n }\r\n else {\r\n if (!next){\r\n setPrev(e, tail);\r\n setNext(e, null);\r\n setNext(tail, e);\r\n tail = e;\r\n } \r\n else{\r\n if (next===head)\r\n head=e;\r\n let prev = getPrev(next);\r\n setNext(e, next);\r\n setPrev(next, e);\r\n if (prev){\r\n setPrev(e, prev);\r\n setNext(prev, e);\r\n } else {\r\n setPrev(e, null);\r\n }\r\n } \r\n }\r\n count++;\r\n },\r\n remove(e){\r\n let next = getNext(e);\r\n let prev = getPrev(e);\r\n if (prev) {\r\n setNext(prev, next)\r\n }\r\n if (next) {\r\n setPrev(next, prev)\r\n }\r\n if (tail == e) {\r\n tail = prev;\r\n }\r\n if (head == e) {\r\n head = next; \r\n }\r\n count--;\r\n }, \r\n getHead(){ return head },\r\n getTail(){ return tail },\r\n getCount(){ return count },\r\n isEmpty(){ return count==0 },\r\n reset(){ \r\n tail=head=null; \r\n count = 0; }\r\n }\r\n}\r\n\r\nexport function DoublyLinkedCollection(getPrev, setPrev, getNext, setNext){\r\n var list = [];\r\n var head = null, tail = null;\r\n return {\r\n push(e){\r\n list.push(e);\r\n if (!tail){\r\n head = tail = e;\r\n setPrev(e, null);\r\n setNext(e, null);\r\n }\r\n else {\r\n setPrev(e, tail);\r\n setNext(e, null);\r\n setNext(tail, e);\r\n tail = e;\r\n }\r\n },\r\n add(e, key){\r\n list.splice(key, 0, e);\r\n if (!tail){\r\n head = tail = e;\r\n setPrev(e, null);\r\n setNext(e, null);\r\n }\r\n else {\r\n let next = list[key];\r\n if (!next) {\r\n setPrev(e, tail);\r\n setNext(e, null);\r\n setNext(tail, e);\r\n tail = e;\r\n } \r\n else {\r\n if (next===head)\r\n head=e;\r\n let prev = getPrev(next);\r\n setNext(e, next);\r\n setPrev(next, e);\r\n if (prev){\r\n setPrev(e, prev);\r\n setNext(prev, e);\r\n } else {\r\n setPrev(e, null);\r\n }\r\n } \r\n }\r\n },\r\n get: (key) => list[key],\r\n remove(key){\r\n var e = list[key];\r\n list.splice(key, 1);\r\n let next = getNext(e);\r\n let prev = getPrev(e);\r\n if (prev) {\r\n setNext(prev, next)\r\n }\r\n if (next) {\r\n setPrev(next, prev)\r\n }\r\n if (tail == e) {\r\n tail = prev;\r\n }\r\n if (head == e) {\r\n head = next; \r\n }\r\n return e;\r\n }, \r\n forLoop(f){\r\n for(let i=0; i list[key],\r\n getNext: (key, predicate) => {\r\n let count = list.length;\r\n let start = key+1;\r\n if (key functions.forEach(\r\n (f) => {\r\n if (f)\r\n f();\r\n }\r\n )\r\n}\r\n\r\nexport function defCall(...functions){\r\n for (let f of functions) \r\n if (f) {\r\n if (f instanceof Function){\r\n let tmp = f();\r\n if (tmp)\r\n return tmp;\r\n }\r\n else\r\n return f \r\n }\r\n}\r\n\r\nexport function ObservableValue(value){\r\n var list = List();\r\n return {\r\n getValue(){\r\n return value;\r\n },\r\n setValue(newValue){\r\n value = newValue;\r\n list.forEach(f=>f(newValue));\r\n },\r\n attach(f){\r\n return list.add(f)\r\n },\r\n detachAll(){\r\n list.reset();\r\n }\r\n }\r\n}\r\n\r\nexport function ObservableLambda(func){\r\n var list = List();\r\n var value = func();\r\n return {\r\n getValue(){\r\n return value;\r\n },\r\n call(){\r\n value = func();\r\n list.forEach(f=>f(value));\r\n },\r\n attach(f){\r\n return list.add(f)\r\n },\r\n detachAll(){\r\n list.reset();\r\n }\r\n }\r\n}\r\n\r\nexport function ObjectValues(object){ // Object.values(plugins) - problem for IE11; full impementation of polifill is mor complex, but for our purpose this is enough\r\n var arr = [];\r\n\tfor (var key in object) {\r\n arr.push(object[key]);\r\n\t}\r\n\treturn arr;\r\n}","export function findDirectChildByTagName(element, tagName){\r\n let value = null;\r\n for (let i = 0; i{ \r\n var event = new window.Event(eventName);\r\n e.dispatchEvent(event);\r\n }\r\n }\r\n else\r\n trigger = (e, eventName) => { // IE 11 polyfill\r\n let event = window.document.createEvent(\"CustomEvent\");\r\n event.initCustomEvent(eventName, false, false, undefined);\r\n e.dispatchEvent(event);\r\n }\r\n return trigger;\r\n}\r\n\r\nexport function closestByTagName(element, tagName){\r\n return closest(element, e => e.tagName === tagName) // TODO support xhtml? e.tagName.toUpperCase() ?\r\n}\r\n\r\nexport function closestByClassName(element, className){\r\n return closest(element, e => e.classList.contains(className))\r\n}\r\n\r\nexport function closestByAttribute(element, attributeName, attribute){\r\n return closest(element, e => e.getAttribute(attributeName)===attribute )\r\n}\r\n\r\nexport function containsAndSelf(node, otherNode ){\r\n return node === otherNode || node.contains(otherNode); \r\n}\r\n\r\nexport function getDataGuardedWithPrefix(element, prefix, name){\r\n var tmp1 = element.getAttribute('data-' + prefix + '-' + name);\r\n if (tmp1) {\r\n return tmp1;\r\n } else {\r\n var tmp2 = element.getAttribute('data-' + name);\r\n if (tmp2)\r\n return tmp2;\r\n }\r\n return null;\r\n}\r\n\r\nfunction closest(element, predicate){\r\n if (!element || !(element instanceof Element)) return null; // should be element, not document (TODO: check iframe)\r\n \r\n if (predicate(element)) return element;\r\n return closest(element.parentNode, predicate);\r\n}\r\n\r\nexport function siblingsAsArray(element){\r\n var value = []\r\n if (element.parentNode){\r\n var children = element.parentNode.children;\r\n var l = element.parentNode.children.length;\r\n if (children.length>1){\r\n for (var i=0; i < l; ++i){\r\n var e = children[i];\r\n if (e!=element)\r\n value.push(e);\r\n \r\n }\r\n }\r\n }\r\n return value;\r\n}\r\n\r\nexport function getIsRtl(element){\r\n var isRtl = false;\r\n var e = closestByAttribute(element,\"dir\",\"rtl\");\r\n if (e)\r\n isRtl = true;\r\n return isRtl;\r\n}\r\n\r\nexport function EventBinder(){\r\n var list = [];\r\n return {\r\n bind(element, eventName, handler) {\r\n element.addEventListener(eventName, handler)\r\n list.push( {element, eventName, handler} )\r\n },\r\n unbind() {\r\n list.forEach( e=> {\r\n let {element, eventName, handler}=e;\r\n element.removeEventListener(eventName, handler)\r\n })\r\n }\r\n }\r\n}\r\n\r\nexport function AttributeBackup(){\r\n var list = [];\r\n return {\r\n set(element, attributeName, attribute){\r\n var currentAtribute = element.getAttribute(attributeName); \r\n list.push( {element, currentAtribute, attribute} )\r\n element.setAttribute(attributeName, attribute)\r\n },\r\n restore(){\r\n list.forEach(e=>{\r\n let {element, attributeName, attribute} = e;\r\n if (attributeName)\r\n element.setAttribute(attributeName, attribute)\r\n else\r\n element.removeAttribute(attributeName)\r\n })\r\n }\r\n }\r\n}\r\n\r\nexport function EventLoopFlag(window) {\r\n var flag = false;\r\n return {\r\n get(){\r\n return flag;\r\n },\r\n set(){\r\n flag = true;\r\n pr = window.setTimeout( \r\n () => { \r\n flag = false;\r\n })\r\n \r\n }\r\n }\r\n}\r\n\r\nexport function EventLoopProlongableFlag(window) {\r\n var flag = false;\r\n var pr = null;\r\n return {\r\n get(){\r\n return flag;\r\n },\r\n set(timeout){\r\n if (flag && pr){\r\n window.clearTimeout(pr);\r\n }\r\n flag = true;\r\n pr = window.setTimeout( \r\n () => { \r\n flag = false;\r\n pr=null;\r\n }, timeout?timeout:0)\r\n \r\n }\r\n }\r\n}\r\n\r\nexport function ResetableFlag() {\r\n var flag = false;\r\n return {\r\n get(){\r\n return flag;\r\n },\r\n set(){\r\n flag = true;\r\n },\r\n reset(){\r\n flag = false;\r\n }\r\n }\r\n}","export function PluginManager(plugins, pluginData){\r\n let instances = [];\r\n if (plugins){\r\n for(let i = 0; i element.classList.add(e)) // todo use add(classes)\r\n backupStyling.classes = classes.slice();\r\n for (let property in styles){\r\n backupStyling.styles[property] = element.style[property];\r\n element.style[property] = styles[property]; // todo use Object.assign (need polyfill for IE11)\r\n }\r\n }\r\n return backupStyling;\r\n}\r\n\r\nfunction removeStyling(element, styling){\r\n if (styling) {\r\n var {classes, styles} = styling;\r\n classes.forEach(e=>element.classList.remove(e)) // todo use remove(classes)\r\n for (let property in styles)\r\n element.style[property] = styles[property]; // todo use Object.assign (need polyfill for IE11)\r\n }\r\n}\r\n\r\nexport function toggleStyling(element, styling){\r\n var backupStyling = {classes:[], styles:{}};\r\n var isOn=false;\r\n return (value)=>{\r\n if (value) {\r\n if (isOn===false){\r\n backupStyling = addStyling(element, styling)\r\n isOn=true;\r\n }\r\n } else {\r\n if (isOn===true){\r\n removeStyling(element, backupStyling);\r\n isOn=false;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction extendClasses(out, param, actionStr, actionArr, isRemoveEmptyClasses){\r\n if (isString(param)){\r\n if (param === \"\"){\r\n if (isRemoveEmptyClasses){\r\n out.classes = [];\r\n }\r\n } else {\r\n let c = param.split(' ');\r\n out.classes = actionStr(c);\r\n }\r\n return true;\r\n } else if (param instanceof Array){\r\n if (param.length==0){\r\n if (isRemoveEmptyClasses){\r\n out.classes = [];\r\n }\r\n }\r\n else{\r\n out.classes = actionArr(param);\r\n }\r\n return true;\r\n }\r\n return false;\r\n}\r\n\r\nfunction extend(value, param, actionStr, actionArr, actionObj, isRemoveEmptyClasses){\r\n var success = extendClasses(value, param, actionStr, actionArr, isRemoveEmptyClasses);\r\n if (success === false){\r\n if (param instanceof Object){\r\n var {classes, styles} = param;\r\n extendClasses(value, classes, actionStr, actionArr, isRemoveEmptyClasses);\r\n \r\n if (styles) {\r\n value.styles = actionObj(styles);\r\n } else if (!classes) {\r\n value.styles = actionObj(param)\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function Styling(param){\r\n var value = {classes:[], styles:{}};\r\n if (param){\r\n extend(value, param, a=>a, a=>a.slice(), o=>shallowClearClone(o), true);\r\n }\r\n return Object.freeze(value);\r\n}\r\n\r\nfunction createStyling(isReplace, param, ...params){\r\n var value = {classes:[], styles:{}};\r\n if (param){\r\n extend(value, param, a=>a, a=>a.slice(), o=>shallowClearClone(o),true);\r\n if (params){\r\n var {classes, styles} = value;\r\n var extendInt = isReplace? (p)=>extend(value, p, s=>s, a=>a.slice(), o=> shallowClearClone(styles, o),true):\r\n (p)=>extend(value, p, a=>classes.concat(a), a=>classes.concat(a), o=>shallowClearClone(styles, o),false)\r\n params.forEach(p=> extendInt(p));\r\n }\r\n }\r\n return Styling(value);\r\n}\r\n\r\nexport function createCss(stylings1, stylings2){\r\n var destination = {};\r\n for (let property in stylings1) {\r\n let param1 = stylings1[property];\r\n\r\n let param2 = stylings2?stylings2[property]:undefined;\r\n if (param2===undefined)\r\n destination[property] = Styling(param1)\r\n else{\r\n destination[property] = createStyling(true, param1, param2); \r\n }\r\n }\r\n if (stylings2)\r\n for (let property in stylings2) {\r\n if (!stylings1[property])\r\n destination[property] = Styling(stylings2[property])\r\n }\r\n return destination;\r\n}\r\n\r\nexport function extendCss(stylings1, stylings2){\r\n for (let property in stylings2) {\r\n let param2 = stylings2[property];\r\n let param1 = stylings1[property];\r\n if (param1 === undefined)\r\n stylings1[property] = Styling(param2)\r\n else{\r\n stylings1[property] = createStyling(false, param1, param2); \r\n }\r\n }\r\n}","import {EventBinder} from './ToolsDom';\r\nimport {addStyling, toggleStyling} from './ToolsStyling';\r\n\r\nexport function PickDomFactory(css, componentPropertiesAspect, optionPropertiesAspect, pickButtonAspect){\r\n return { \r\n create(pickElement, wrap, remove){\r\n let eventBinder = EventBinder();\r\n let buttonHTML = pickButtonAspect.getButtonHTML();\r\n pickElement.innerHTML = ''+buttonHTML;\r\n let pickContentElement = pickElement.querySelector('SPAN');\r\n let pickButtonElement = pickElement.querySelector('BUTTON');\r\n eventBinder.bind(pickButtonElement, \"click\", remove);\r\n \r\n addStyling(pickContentElement, css.pickContent);\r\n addStyling(pickButtonElement, css.pickButton);\r\n let disableToggle = toggleStyling(pickContentElement, css.pickContent_disabled);\r\n\r\n function updateData(){\r\n pickContentElement.textContent = optionPropertiesAspect.getText(wrap.option); \r\n }\r\n function updateDisabled(){\r\n disableToggle(wrap.isOptionDisabled)\r\n }\r\n function updateComponentDisabled(){\r\n pickButtonElement.disabled = componentPropertiesAspect.getDisabled();\r\n }\r\n \r\n\r\n return {\r\n pickDom:{\r\n pickContentElement,\r\n pickButtonElement,\r\n },\r\n pickDomManagerHandlers:{\r\n updateData,\r\n updateDisabled,\r\n updateComponentDisabled,\r\n },\r\n dispose(){\r\n eventBinder.unbind();\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import {EventBinder} from './ToolsDom';\r\nimport {addStyling, toggleStyling} from './ToolsStyling';\r\n\r\nexport function ChoiceDomFactory(css, optionPropertiesAspect, highlightAspect){\r\n \r\n var updateHighlightedInternal = function(wrap, choiceDom, element) {\r\n var text = optionPropertiesAspect.getText(wrap.option);\r\n var highlighter = highlightAspect.getHighlighter();\r\n if (highlighter)\r\n highlighter(element, choiceDom, text); \r\n else\r\n element.textContent = text;\r\n }\r\n var updateDataInternal = function(wrap, element){\r\n element.textContent = optionPropertiesAspect.getText(wrap.option);;\r\n }\r\n //TODO move check which aspects availbale like wrap.hasOwnProperty(\"isOptionSelected\") to there\r\n return {\r\n create(choiceElement, wrap, toggle){\r\n let choiceDom = null;\r\n let choiceDomManagerHandlers = null;\r\n let eventBinder = EventBinder();\r\n eventBinder.bind(choiceElement, \"click\", toggle);\r\n let choiceHoverToggle = toggleStyling(choiceElement, css.choice_hover);\r\n let updateHoverIn = function(){\r\n choiceHoverToggle(wrap.choice.isHoverIn);\r\n }\r\n \r\n if (wrap.hasOwnProperty(\"isOptionSelected\")){\r\n choiceElement.innerHTML = '
';\r\n \r\n let choiceContentElement = choiceElement.querySelector('DIV');\r\n let choiceCheckBoxElement = choiceContentElement.querySelector('INPUT');\r\n let choiceLabelElement = choiceContentElement.querySelector('LABEL');\r\n \r\n addStyling(choiceContentElement, css.choiceContent); \r\n addStyling(choiceCheckBoxElement, css.choiceCheckBox); \r\n addStyling(choiceLabelElement, css.choiceLabel); \r\n\r\n choiceDom = {\r\n choiceElement,\r\n choiceContentElement,\r\n choiceCheckBoxElement,\r\n choiceLabelElement\r\n };\r\n \r\n let choiceSelectedToggle = toggleStyling(choiceElement, css.choice_selected);\r\n let updateSelected = function(){ \r\n choiceSelectedToggle(wrap.isOptionSelected);\r\n choiceCheckBoxElement.checked = wrap.isOptionSelected;\r\n }\r\n\r\n let choiceDisabledToggle = toggleStyling(choiceElement, css.choice_disabled);\r\n let choiceCheckBoxDisabledToggle = toggleStyling(choiceCheckBoxElement, css.choiceCheckBox_disabled);\r\n let choiceLabelDisabledToggle = toggleStyling(choiceLabelElement, css.choiceLabel_disabled);\r\n let choiceCursorDisabledToggle = toggleStyling(choiceElement, {classes:[], styles:{cursor:\"default\"}}); \r\n let updateDisabled = function(){\r\n choiceDisabledToggle(wrap.isOptionDisabled);\r\n choiceCheckBoxDisabledToggle(wrap.isOptionDisabled);\r\n choiceLabelDisabledToggle(wrap.isOptionDisabled);\r\n \r\n // do not desable checkBox if option is selected! there should be possibility to unselect \"disabled\"\r\n let isCheckBoxDisabled = wrap.isOptionDisabled && !wrap.isOptionSelected;\r\n choiceCheckBoxElement.disabled = isCheckBoxDisabled;\r\n choiceCursorDisabledToggle(isCheckBoxDisabled);\r\n \r\n }\r\n\r\n choiceDomManagerHandlers = {\r\n updateData: ()=>updateDataInternal(wrap, choiceLabelElement),\r\n updateHighlighted: ()=>updateHighlightedInternal(wrap, choiceDom, choiceLabelElement), \r\n updateHoverIn,\r\n updateDisabled,\r\n updateSelected, \r\n }\r\n\r\n \r\n }else{\r\n choiceElement.innerHTML = '';\r\n let choiceContentElement = choiceElement.querySelector('SPAN');\r\n choiceDom = {\r\n \r\n choiceElement,\r\n choiceContentElement,\r\n };\r\n choiceDomManagerHandlers = {\r\n updateData: ()=>updateDataInternal(wrap, choiceContentElement),\r\n updateHighlighted: ()=>updateHighlightedInternal(wrap, choiceDom, choiceElement), \r\n updateHoverIn\r\n }\r\n }\r\n \r\n return {\r\n choiceDom,\r\n choiceDomManagerHandlers, \r\n dispose(){\r\n eventBinder.unbind();\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n\r\n","import {findDirectChildByTagName, closestByClassName} from './ToolsDom';\r\n\r\nexport function CreateElementAspect(createElement){\r\n return {\r\n createElement\r\n }\r\n}\r\n\r\nexport function StaticDomFactory(choicesDomFactory, createElementAspect){\r\n return {\r\n create(css){\r\n let choicesDom = choicesDomFactory.create(css);\r\n return {\r\n choicesDom,\r\n createStaticDom(element, containerClass){\r\n function showError(message){\r\n element.style.backgroundColor = 'red';\r\n element.style.color = 'white';\r\n throw new Error(message);\r\n }\r\n \r\n let containerElement, picksElement;\r\n let removableContainerClass= false;\r\n if (element.tagName == 'DIV') {\r\n containerElement = element;\r\n if (!containerElement.classList.contains(containerClass)){\r\n containerElement.classList.add(containerClass);\r\n removableContainerClass = true;\r\n }\r\n picksElement = findDirectChildByTagName(containerElement, 'UL');\r\n }\r\n else if (element.tagName == 'UL') {\r\n picksElement = element;\r\n containerElement = closestByClassName(element, containerClass);\r\n if (!containerElement){\r\n showError('BsMultiSelect: defined on UL but precedentant DIV for container not found; class='+containerClass);\r\n }\r\n } \r\n else if (element.tagName==\"INPUT\"){\r\n showError('BsMultiSelect: INPUT element is not supported');\r\n }\r\n let disposablePicksElement=false;\r\n if (!picksElement) {\r\n picksElement = createElementAspect.createElement('UL');\r\n disposablePicksElement = true; \r\n }\r\n \r\n return {\r\n choicesDom,\r\n staticDom: {\r\n initialElement:element,\r\n containerElement,\r\n picksElement,\r\n disposablePicksElement\r\n },\r\n staticManager: {\r\n appendToContainer(){ \r\n containerElement.appendChild(choicesDom.choicesElement); \r\n if (disposablePicksElement)\r\n containerElement.appendChild(picksElement)\r\n },\r\n dispose(){ \r\n containerElement.removeChild(choicesDom.choicesElement); \r\n if (removableContainerClass)\r\n containerElement.classList.remove(containerClass);\r\n if (disposablePicksElement)\r\n containerElement.removeChild(picksElement)\r\n }\r\n }\r\n };\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import {addStyling, toggleStyling} from './ToolsStyling';\r\n\r\nexport function PicksDom(picksElement, disposablePicksElement, createElementAspect, css){\r\n var pickFilterElement = createElementAspect.createElement('LI');\r\n \r\n addStyling(picksElement, css.picks);\r\n addStyling(pickFilterElement, css.pickFilter);\r\n\r\n let disableToggleStyling = toggleStyling(picksElement, css.picks_disabled);\r\n let focusToggleStyling = toggleStyling(picksElement, css.picks_focus);\r\n let isFocusIn = false;\r\n\r\n return {\r\n picksElement,\r\n pickFilterElement,\r\n\r\n createPickElement(){\r\n var pickElement = createElementAspect.createElement('LI');\r\n addStyling(pickElement, css.pick);\r\n return {\r\n pickElement, \r\n attach: (beforeElement) => picksElement.insertBefore(pickElement, beforeElement??pickFilterElement),\r\n detach: () => picksElement.removeChild(pickElement)\r\n };\r\n },\r\n disable(isComponentDisabled){\r\n disableToggleStyling(isComponentDisabled)\r\n },\r\n toggleFocusStyling(){\r\n focusToggleStyling(isFocusIn)\r\n },\r\n getIsFocusIn(){\r\n return isFocusIn;\r\n },\r\n setIsFocusIn(newIsFocusIn){\r\n isFocusIn = newIsFocusIn\r\n }, \r\n dispose(){\r\n if (!disposablePicksElement){\r\n disableToggleStyling(false)\r\n focusToggleStyling(false)\r\n \r\n if (pickFilterElement.parentNode)\r\n pickFilterElement.parentNode.removeChild(pickFilterElement)\r\n }\r\n }\r\n }\r\n}\r\n","import {addStyling} from './ToolsStyling';\r\nimport {EventBinder} from './ToolsDom';\r\n\r\nexport function FilterDom(disposablePicksElement, createElementAspect, css){\r\n var filterInputElement = createElementAspect.createElement('INPUT');\r\n addStyling(filterInputElement, css.filterInput);\r\n\r\n filterInputElement.setAttribute(\"type\",\"search\");\r\n filterInputElement.setAttribute(\"autocomplete\",\"off\");\r\n var eventBinder = EventBinder();\r\n return {\r\n filterInputElement,\r\n isEmpty(){return filterInputElement.value ? false : true},\r\n setEmpty(){\r\n filterInputElement.value ='';\r\n },\r\n getValue(){\r\n return filterInputElement.value;\r\n },\r\n setFocus(){\r\n filterInputElement.focus();\r\n },\r\n setWidth(text){\r\n filterInputElement.style.width = text.length * 1.3 + 2 + \"ch\"\r\n },\r\n // TODO: check why I need this comparision? \r\n setFocusIfNotTarget(target){\r\n if (target != filterInputElement)\r\n filterInputElement.focus();\r\n },\r\n onInput(onFilterInputInput){\r\n eventBinder.bind(filterInputElement,'input', onFilterInputInput);\r\n },\r\n onFocusIn(onFocusIn){\r\n eventBinder.bind(filterInputElement,'focusin', onFocusIn);\r\n },\r\n onFocusOut(onFocusOut){\r\n eventBinder.bind(filterInputElement,'focusout', onFocusOut);\r\n },\r\n onKeyDown(onfilterInputKeyDown){\r\n eventBinder.bind(filterInputElement,'keydown', onfilterInputKeyDown); \r\n },\r\n onKeyUp(onFilterInputKeyUp){\r\n eventBinder.bind(filterInputElement,'keyup', onFilterInputKeyUp);\r\n },\r\n dispose(){\r\n eventBinder.unbind();\r\n if (!disposablePicksElement){\r\n if (filterInputElement.parentNode)\r\n filterInputElement.parentNode.removeChild(filterInputElement)\r\n }\r\n }\r\n }\r\n}\r\n","import {addStyling} from './ToolsStyling';\r\n\r\nexport function ChoicesDomFactory(createElementAspect) {\r\n return {\r\n create(css){\r\n var choicesElement = createElementAspect.createElement('DIV');\r\n var choicesListElement = createElementAspect.createElement('UL');\r\n \r\n choicesElement.appendChild(choicesListElement);\r\n choicesElement.style.display = 'none';\r\n\r\n addStyling(choicesElement, css.choices);\r\n addStyling(choicesListElement, css.choicesList);\r\n return {\r\n choicesElement,\r\n choicesListElement,\r\n createChoiceElement(){\r\n var choiceElement = createElementAspect.createElement('LI');\r\n addStyling(choiceElement, css.choice);\r\n return {\r\n choiceElement,\r\n setVisible: (isVisible) => choiceElement.style.display = isVisible ? 'block': 'none',\r\n attach: (beforeElement) => choicesListElement.insertBefore(choiceElement, beforeElement),\r\n detach: () => choicesListElement.removeChild(choiceElement)\r\n };\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","export function ChoicesVisibilityAspect(choicesElement) {\r\n\r\n return {\r\n isChoicesVisible(){ \r\n return choicesElement.style.display != 'none'},\r\n setChoicesVisible(visible){\r\n choicesElement.style.display = visible ? 'block' : 'none';\r\n },\r\n updatePopupLocation(){\r\n\r\n }\r\n }\r\n}\r\n","export function SpecialPicksEventsAspect(){\r\n return {\r\n backSpace(pick){ \r\n pick.setSelectedFalse(); \r\n }\r\n }\r\n}","export function TriggerAspect(element, trigger) {\r\n return {\r\n trigger: (eventName) => {\r\n trigger(element, eventName)\r\n }\r\n }\r\n}\r\n\r\nexport function OnChangeAspect(triggerAspect, name) {\r\n return {\r\n onChange(){\r\n triggerAspect.trigger(name)\r\n }\r\n }\r\n}\r\n\r\nexport function ComponentPropertiesAspect(getDisabled) {\r\n return {\r\n getDisabled\r\n }\r\n}\r\n\r\n","export function OptionsAspect(options){\r\n return {\r\n getOptions : () => options\r\n }\r\n}\r\n\r\nexport function OptionPropertiesAspect(getText){\r\n if (!getText){\r\n getText = (option) => option.text;\r\n }\r\n return {\r\n getText\r\n }\r\n}\r\n","export function ChoicesEnumerableAspect(countableChoicesList, getNext){\r\n return {\r\n forEach(f){\r\n let wrap = countableChoicesList.getHead(); \r\n while(wrap){\r\n f(wrap);\r\n wrap = getNext(wrap);\r\n }\r\n }\r\n }\r\n}","export function NavigateManager(\r\n list, getPrev, getNext\r\n){\r\n return {\r\n navigate(down, wrap /* hoveredChoice */){ \r\n if (down) {\r\n return wrap?getNext(wrap): list.getHead();\r\n } else {\r\n return wrap?getPrev(wrap): list.getTail();\r\n }\r\n },\r\n getCount(){\r\n return list.getCount()\r\n },\r\n getHead(){\r\n return list.getHead()\r\n }\r\n }\r\n}\r\n\r\nexport function FilterPredicateAspect(){\r\n return {\r\n filterPredicate: (wrap, text) => \r\n wrap.choice.searchText.indexOf(text) >= 0 \r\n }\r\n}\r\n\r\nexport function FilterManagerAspect(\r\n emptyNavigateManager,\r\n filteredNavigateManager,\r\n filteredChoicesList, \r\n choicesEnumerableAspect,\r\n filterPredicateAspect\r\n ) {\r\n let showEmptyFilter=true;\r\n let filterText = \"\";\r\n return {\r\n getNavigateManager(){\r\n return (showEmptyFilter)?emptyNavigateManager:filteredNavigateManager;\r\n },\r\n processEmptyInput(){ // redefined in PlaceholderPulgin, HighlightPlugin\r\n showEmptyFilter =true;\r\n filterText =\"\";\r\n choicesEnumerableAspect.forEach( (wrap)=>{\r\n wrap.choice.setVisible(true);\r\n });\r\n },\r\n getFilter(){\r\n return filterText;\r\n },\r\n setFilter(text){ // redefined in HighlightPlugin\r\n showEmptyFilter =false;\r\n filterText = text;\r\n filteredChoicesList.reset();\r\n choicesEnumerableAspect.forEach( (wrap)=>{\r\n wrap.choice.filteredPrev = wrap.choice.filteredNext = null;\r\n var v = filterPredicateAspect.filterPredicate(wrap, text)\r\n if (v)\r\n filteredChoicesList.add(wrap);\r\n wrap.choice.setVisible(v);\r\n });\r\n }\r\n }\r\n}\r\n\r\n\r\n","export function BuildAndAttachChoiceAspect(\r\n buildChoiceAspect,\r\n ){\r\n return {\r\n buildAndAttachChoice(\r\n wrap,\r\n getNextElement \r\n ){\r\n buildChoiceAspect.buildChoice(wrap);\r\n wrap.choice.choiceElementAttach(getNextElement?.());\r\n }\r\n }\r\n}\r\n\r\nexport function BuildChoiceAspect(\r\n choicesDom,\r\n choiceDomFactory,\r\n choiceClickAspect\r\n ) {\r\n return {\r\n buildChoice(wrap) {\r\n var {choiceElement, setVisible, attach, detach} = choicesDom.createChoiceElement();\r\n wrap.choice.choiceElement = choiceElement;\r\n wrap.choice.choiceElementAttach = attach;\r\n wrap.choice.isChoiceElementAttached = true;\r\n \r\n let {dispose, choiceDom, choiceDomManagerHandlers} = choiceDomFactory.create(choiceElement, wrap, () => choiceClickAspect.choiceClick(wrap));\r\n wrap.choice.choiceDom=choiceDom;\r\n choiceDomManagerHandlers.updateData();\r\n if (choiceDomManagerHandlers.updateSelected) \r\n choiceDomManagerHandlers.updateSelected();\r\n if (choiceDomManagerHandlers.updateDisabled) \r\n choiceDomManagerHandlers.updateDisabled();\r\n \r\n\r\n wrap.choice.choiceDomManagerHandlers = choiceDomManagerHandlers;\r\n \r\n wrap.choice.remove = () => {\r\n detach();\r\n };\r\n \r\n wrap.choice.isFilteredIn = true;\r\n \r\n wrap.choice.setHoverIn = (v) => {\r\n wrap.choice.isHoverIn =v ;\r\n choiceDomManagerHandlers.updateHoverIn();\r\n }\r\n \r\n wrap.choice.setVisible = (v) => {\r\n wrap.choice.isFilteredIn = v;\r\n setVisible(wrap.choice.isFilteredIn)\r\n }\r\n \r\n wrap.choice.dispose = () => {\r\n wrap.choice.choiceDomManagerHandlers = null;\r\n dispose();\r\n \r\n wrap.choice.choiceElement = null;\r\n wrap.choice.choiceDom = null;\r\n wrap.choice.choiceElementAttach = null;\r\n wrap.choice.isChoiceElementAttached = false;\r\n wrap.choice.remove = null; \r\n \r\n // not real data manipulation but internal state\r\n wrap.choice.setVisible = null; // TODO: refactor it there should be 3 types of not visibility: for hidden, for filtered out, for optgroup, for message item\r\n wrap.choice.setHoverIn = null;\r\n \r\n wrap.choice.dispose = null;\r\n }\r\n\r\n wrap.dispose = () => {\r\n wrap.choice.dispose();\r\n wrap.dispose = null;\r\n }\r\n }\r\n }\r\n}","export function OptionAttachAspect(createWrapAspect, createChoiceBaseAspect, buildAndAttachChoiceAspect, wraps){\r\n return {\r\n attach(option){\r\n let wrap = createWrapAspect.createWrap(option);\r\n\r\n // let optGroup = optGroupAspect.getOptionOptGroup(option);\r\n // if (prevOptGroup != optGroup){\r\n // currentOptGroup = optGroup;\r\n // var optGroupWrap = optGroupBuildAspect.wrapAndAttachOptGroupItem(option);\r\n // }\r\n // wrap.optGroup = currentOptGroup;\r\n \r\n wrap.choice = createChoiceBaseAspect.createChoiceBase(option);\r\n wraps.push(wrap); // TODO move to the end\r\n buildAndAttachChoiceAspect.buildAndAttachChoice(wrap);\r\n //wraps.push(wrap);\r\n }\r\n }\r\n}\r\n\r\nexport function OptionsLoopAspect(optionsAspect, optionAttachAspect){ \r\n return{\r\n loop(){\r\n let options = optionsAspect.getOptions();\r\n for(let i = 0; ipick.dispose());\r\n picksList.reset();\r\n optionsLoopAspect.loop();\r\n }\r\n }\r\n}\r\n","import {composeSync} from './ToolsJs';\r\n\r\nexport function IsChoiceSelectableAspect(){ // TODO rename to IsSelectableByUserAspect ?\r\n return {\r\n isSelectable: (wrap)=>true \r\n }\r\n}\r\n\r\n// todo: remove?\r\nexport function ChoiceClickAspect(optionToggleAspect, filterDom){\r\n return {\r\n choiceClick: (wrap) => {\r\n optionToggleAspect.toggle(wrap);\r\n filterDom.setFocus();\r\n }\r\n }\r\n}\r\n\r\n// // fullMatchAspect trySetWrapSelected(fullMatchWrap.option, composeUpdateSelected(fullMatchWrap, true), true);\r\n\r\nexport function OptionToggleAspect(createPickHandlersAspect, addPickAspect /*, setOptionSelectedAspect*/){\r\n return {\r\n toggle: (wrap) => {\r\n let pickHandlers = createPickHandlersAspect.createPickHandlers(wrap);\r\n addPickAspect.addPick(wrap, pickHandlers);\r\n return true; // TODO: process setOptionSelectedAspect\r\n }\r\n }\r\n}\r\n\r\nexport function AddPickAspect(){\r\n return {\r\n addPick(wrap, pickHandlers){\r\n return pickHandlers.producePick();\r\n }\r\n }\r\n}\r\n\r\nexport function FullMatchAspect(createPickHandlersAspect, addPickAspect){\r\n return {\r\n fullMatch(wrap){\r\n let pickHandlers = createPickHandlersAspect.createPickHandlers(wrap);\r\n addPickAspect.addPick(wrap, pickHandlers);\r\n return true; // TODO: process setOptionSelectedAspect\r\n }\r\n }\r\n}\r\n\r\nexport function RemovePickAspect(){\r\n return {\r\n removePick(wrap, pick){\r\n pick.dispose(); // overrided in SelectedOptionPlugin with trySetWrapSelected(wrap, false);\r\n }\r\n }\r\n}\r\n\r\nexport function ProducePickAspect(picksList, removePickAspect, buildPickAspect){\r\n return {\r\n producePick(wrap, pickHandlers){\r\n let pick = buildPickAspect.buildPick(wrap, (event)=>pickHandlers.removeOnButton(event));\r\n \r\n let fixSelectedFalse = () => removePickAspect.removePick(wrap, pick)\r\n\r\n pickHandlers.removeOnButton = fixSelectedFalse;\r\n \r\n pick.pickElementAttach();\r\n let {remove: removeFromPicksList} = picksList.add(pick);\r\n pick.setSelectedFalse = fixSelectedFalse;\r\n pick.wrap = wrap; \r\n pick.dispose = composeSync(\r\n removeFromPicksList,\r\n ()=>{\r\n pick.setSelectedFalse=null;\r\n pick.wrap = null;\r\n }, \r\n pick.dispose);\r\n pickHandlers.removeAndDispose = () => pick.dispose();\r\n return pick;\r\n }\r\n }\r\n}\r\n\r\n// redefined in MultiSelectInlineLayout to redefine handlers removeOnButton\r\n// redefined in SelectedOptionPlugin to compose wrap.updateSelected\r\nexport function CreatePickHandlersAspect(producePickAspect){\r\n return{\r\n createPickHandlers(wrap){\r\n let pickHandlers = { \r\n producePick: null, // not redefined directly, but redefined in addPickAspect\r\n removeAndDispose: null, // not redefined, \r\n removeOnButton: null // redefined in MultiSelectInlineLayout\r\n }\r\n \r\n pickHandlers.producePick = () => producePickAspect.producePick(wrap, pickHandlers);\r\n return pickHandlers;\r\n }\r\n }\r\n}\r\n\r\nexport function CreateChoiceBaseAspect(optionPropertiesAspect){\r\n return {\r\n createChoiceBase(option){\r\n return {\r\n \r\n //updateDisabled:null, \r\n //updateHidden:null,\r\n \r\n // navigation and filter support\r\n filteredPrev: null, \r\n filteredNext: null, \r\n searchText: optionPropertiesAspect.getText(option).toLowerCase().trim(), // TODO make an index abstraction\r\n \r\n // internal state handlers, so they do not have \"update semantics\"\r\n isHoverIn: false,\r\n isFilteredIn: false,\r\n \r\n setVisible: null,\r\n setHoverIn: null,\r\n \r\n // TODO: is it a really sense to have them there?\r\n isChoiceElementAttached: false,\r\n choiceElement: null,\r\n choiceDom:null,\r\n choiceElementAttach: null,\r\n \r\n itemPrev: null,\r\n itemNext: null,\r\n \r\n remove: null,\r\n \r\n dispose: null\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function CreateWrapAspect(){\r\n return {\r\n createWrap(option){\r\n return {\r\n option: option\r\n }\r\n }\r\n }\r\n}","export function HoveredChoiceAspect(){\r\n let hoveredChoice=null;\r\n return {\r\n getHoveredChoice: () => hoveredChoice,\r\n setHoveredChoice: (wrap) => {hoveredChoice = wrap},\r\n resetHoveredChoice() {\r\n if (hoveredChoice) {\r\n hoveredChoice.choice.setHoverIn(false)\r\n hoveredChoice = null;\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function NavigateAspect(hoveredChoiceAspect, navigate){\r\n return {\r\n hoverIn(wrap){\r\n hoveredChoiceAspect.resetHoveredChoice(); \r\n hoveredChoiceAspect.setHoveredChoice(wrap);\r\n wrap.choice.setHoverIn(true);\r\n },\r\n navigate: (down) => navigate(down, hoveredChoiceAspect.getHoveredChoice()), \r\n }\r\n}","export function Wraps(wrapsCollection, \r\n listFacade_reset, listFacade_remove, listFacade_add) \r\n{\r\n return {\r\n push: (wrap) => push(wrap, wrapsCollection, listFacade_add),\r\n insert: (key, wrap) => insert(key, wrap, wrapsCollection, listFacade_add),\r\n remove: (key) => {\r\n var wrap = wrapsCollection.remove(key);\r\n listFacade_remove(wrap);\r\n return wrap;\r\n },\r\n clear: () => {\r\n wrapsCollection.reset();\r\n listFacade_reset();\r\n }, \r\n dispose: () => wrapsCollection.forLoop(wrap => wrap.dispose()) \r\n }\r\n}\r\n\r\nfunction push(wrap, wrapsCollection, listFacade_add){\r\n wrapsCollection.push(wrap);\r\n listFacade_add(wrap);\r\n}\r\n\r\nfunction insert(key, wrap, wrapsCollection, listFacade_add){\r\n if (key>=wrapsCollection.getCount()) {\r\n push(wrap, wrapsCollection, listFacade_add);\r\n }\r\n else {\r\n wrapsCollection.add(wrap, key);\r\n listFacade_add(wrap, key);\r\n }\r\n}","export function PickButtonAspect(buttonHTML){\r\n return {\r\n getButtonHTML : () => buttonHTML\r\n }\r\n}","export function BuildPickAspect(\r\n picksDom, \r\n pickDomFactory\r\n){\r\n return {\r\n buildPick(wrap, removeOnButton){\r\n let {pickElement, attach, detach} = picksDom.createPickElement(); \r\n let {dispose, pickDom, pickDomManagerHandlers} = pickDomFactory.create(pickElement, wrap, removeOnButton); \r\n \r\n pickDomManagerHandlers.updateData();\r\n if (pickDomManagerHandlers.updateDisabled)\r\n pickDomManagerHandlers.updateDisabled();\r\n if (pickDomManagerHandlers.updateComponentDisabled)\r\n pickDomManagerHandlers.updateComponentDisabled();\r\n let pick = {\r\n pickDom,\r\n pickDomManagerHandlers,\r\n pickElementAttach: attach,\r\n dispose: () => { \r\n detach(); \r\n dispose(); \r\n pick.pickDomManagerHandlers = null;\r\n pick.pickDom = pickDom;\r\n pick.pickElementAttach = null;\r\n pick.dispose = null;\r\n }\r\n }\r\n return pick;\r\n }\r\n }\r\n}","export function InputAspect(\r\n filterDom,\r\n filterManagerAspect,\r\n fullMatchAspect\r\n ){\r\n\r\n return {\r\n // overrided in SelectedOptionPlugin\r\n processInput(){ \r\n let filterInputValue = filterDom.getValue();\r\n let text = filterInputValue.trim();\r\n var isEmpty=false;\r\n if (text == '')\r\n isEmpty=true;\r\n else\r\n {\r\n filterManagerAspect.setFilter(text.toLowerCase());\r\n }\r\n \r\n if (!isEmpty)\r\n {\r\n if ( filterManagerAspect.getNavigateManager().getCount() == 1)\r\n {\r\n // todo: move exact match to filterManager\r\n let fullMatchWrap = filterManagerAspect.getNavigateManager().getHead();\r\n let text = filterManagerAspect.getFilter();\r\n if (fullMatchWrap.choice.searchText == text)\r\n {\r\n let success = fullMatchAspect.fullMatch(fullMatchWrap); \r\n if (success) {\r\n filterDom.setEmpty();\r\n isEmpty = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {filterInputValue, isEmpty};\r\n }\r\n }\r\n}","export function ResetFilterListAspect(filterDom, filterManagerAspect){\r\n return {\r\n forceResetFilter(){ // over in PlaceholderPlugin\r\n filterDom.setEmpty();\r\n filterManagerAspect.processEmptyInput(); // over in PlaceholderPlugin\r\n }\r\n }\r\n}\r\n\r\nexport function ResetFilterAspect(filterDom, resetFilterListAspect){\r\n return {\r\n resetFilter(){ // call in OptionsApiPlugin\r\n if (!filterDom.isEmpty()) // call in Placeholder\r\n resetFilterListAspect.forceResetFilter(); // over in Placeholder\r\n }\r\n }\r\n}\r\n\r\nexport function FocusInAspect(picksDom){\r\n return {\r\n setFocusIn(focus){ // call in OptionsApiPlugin\r\n picksDom.setIsFocusIn(focus) // unique call, call BsAppearancePlugin\r\n picksDom.toggleFocusStyling() // over BsAppearancePlugin\r\n }\r\n }\r\n}\r\n\r\n","import {composeSync} from './ToolsJs';\r\nimport {EventBinder, EventLoopProlongableFlag, containsAndSelf} from './ToolsDom'\r\n\r\nexport function MultiSelectInlineLayout (\r\n aspects\r\n ) \r\n{\r\n let {environment,filterDom,picksDom,choicesDom, \r\n choicesVisibilityAspect, \r\n hoveredChoiceAspect, navigateAspect, filterManagerAspect,\r\n focusInAspect, optionToggleAspect,\r\n createPickHandlersAspect,\r\n picksList,\r\n inputAspect, specialPicksEventsAspect, buildChoiceAspect, \r\n setDisabledComponentAspect, resetLayoutAspect, placeholderStopInputAspect,\r\n warningAspect,\r\n configuration,\r\n createPopperAspect, rtlAspect, staticManager\r\n } = aspects;\r\n\r\n let picksElement = picksDom.picksElement;\r\n let choicesElement = choicesDom.choicesElement;\r\n\r\n // pop up layout, require createPopperPlugin\r\n let filterInputElement = filterDom.filterInputElement;\r\n let pop = createPopperAspect.create(choicesElement, filterInputElement, true);\r\n staticManager.appendToContainer = composeSync(staticManager.appendToContainer, pop.init);\r\n var origBackSpace = specialPicksEventsAspect.backSpace;\r\n specialPicksEventsAspect.backSpace = (pick) => { origBackSpace(pick); pop.update();};\r\n if (rtlAspect){\r\n let origUpdateRtl = rtlAspect.updateRtl;\r\n rtlAspect.updateRtl = (isRtl) => {\r\n origUpdateRtl(isRtl); \r\n pop.setRtl(isRtl);\r\n };\r\n }\r\n choicesVisibilityAspect.updatePopupLocation = composeSync(choicesVisibilityAspect.updatePopupLocation, \r\n function(){pop.update();}\r\n )\r\n\r\n if (warningAspect) {\r\n let pop2 = createPopperAspect.create(warningAspect.warningElement, filterInputElement, false);\r\n staticManager.appendToContainer = composeSync(staticManager.appendToContainer, pop2.init);\r\n if (rtlAspect){\r\n let origUpdateRtl2 = rtlAspect.updateRtl;\r\n rtlAspect.updateRtl = (isRtl) => {\r\n origUpdateRtl2(isRtl); \r\n pop2.setRtl(isRtl);\r\n };\r\n }\r\n var origWarningAspectShow =warningAspect.show;\r\n warningAspect.show = (msg) => {\r\n pop2.update();\r\n origWarningAspectShow(msg);\r\n }\r\n pop.dispose = composeSync(pop.dispose, pop2.dispose);\r\n }\r\n\r\n var window = environment.window;\r\n var document = window.document;\r\n var eventLoopFlag =EventLoopProlongableFlag(window); \r\n var skipFocusout = false;\r\n \r\n function getSkipFocusout() {\r\n return skipFocusout;\r\n };\r\n function resetSkipFocusout() {\r\n skipFocusout = false;\r\n };\r\n function setSkipFocusout() {\r\n skipFocusout = true;\r\n };\r\n\r\n // we want to escape the closing of the menu (because of focus out from) on a user's click inside the container\r\n var skipoutMousedown = function() {\r\n setSkipFocusout();\r\n }\r\n\r\n var documentMouseup = function(event) {\r\n // if we would left without focus then \"close the drop\" do not remove focus border\r\n if (choicesElement == event.target) \r\n filterDom.setFocus()\r\n\r\n // if click outside container - close dropdown\r\n else if ( !containsAndSelf(choicesElement, event.target) && !containsAndSelf(picksElement, event.target)) {\r\n resetLayoutAspect.resetLayout();\r\n focusInAspect.setFocusIn(false);\r\n }\r\n }\r\n\r\n function showChoices() {\r\n if ( !choicesVisibilityAspect.isChoicesVisible() )\r\n {\r\n choicesVisibilityAspect.updatePopupLocation();\r\n eventLoopFlag.set();\r\n choicesVisibilityAspect.setChoicesVisible(true);\r\n // TODO: move to scroll plugin\r\n choicesElement.scrollTop =0;\r\n // add listeners that manages close dropdown on click outside container\r\n choicesElement.addEventListener(\"mousedown\", skipoutMousedown);\r\n document.addEventListener(\"mouseup\", documentMouseup);\r\n }\r\n }\r\n\r\n function hideChoices() {\r\n resetMouseCandidateChoice();\r\n hoveredChoiceAspect.resetHoveredChoice();\r\n if (choicesVisibilityAspect.isChoicesVisible())\r\n {\r\n // COOMENT OUT DEBUGGING popup layout\r\n choicesVisibilityAspect.setChoicesVisible(false);\r\n \r\n choicesElement.removeEventListener(\"mousedown\", skipoutMousedown);\r\n document.removeEventListener(\"mouseup\", documentMouseup);\r\n }\r\n }\r\n\r\n var preventDefaultClickEvent = null;\r\n\r\n var componentDisabledEventBinder = EventBinder();\r\n\r\n\r\n // TODO: remove setTimeout: set on start of mouse event reset on end\r\n function skipoutAndResetMousedown(){\r\n skipoutMousedown();\r\n window.setTimeout(()=>resetSkipFocusout());\r\n }\r\n picksElement.addEventListener(\"mousedown\", skipoutAndResetMousedown);\r\n\r\n function clickToShowChoices(event){\r\n filterDom.setFocusIfNotTarget(event.target);\r\n if (preventDefaultClickEvent != event) {\r\n if (choicesVisibilityAspect.isChoicesVisible()){\r\n hideChoices() \r\n } else {\r\n if (filterManagerAspect.getNavigateManager().getCount()>0)\r\n showChoices();\r\n }\r\n }\r\n preventDefaultClickEvent=null;\r\n }\r\n\r\n function processUncheck(uncheckOption, event){\r\n // we can't remove item on \"click\" in the same loop iteration - it is unfrendly for 3PP event handlers (they will get detached element)\r\n // never remove elements in the same event iteration\r\n window.setTimeout(()=>uncheckOption())\r\n preventDefaultClickEvent = event; // setPreventDefaultMultiSelectEvent\r\n }\r\n\r\n // function handleOnRemoveButton(onRemove, setSelectedFalse){\r\n // // processRemoveButtonClick removes the item\r\n // // what is a problem with calling 'remove' directly (not using setTimeout('remove', 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 'remove' 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 \r\n // // that belomgs to DOM (e.g. panel)\r\n\r\n\r\n // onRemove(event => {\r\n // processUncheck(setSelectedFalse, event);\r\n // hideChoices();\r\n // resetFilterAspect.resetFilter(); \r\n // });\r\n // }\r\n \r\n function handleOnRemoveButton(setSelectedFalse){ return (event) => {\r\n processUncheck(setSelectedFalse, event);\r\n resetLayoutAspect.resetLayout(); \r\n }}\r\n \r\n let mouseCandidateEventBinder = EventBinder();\r\n var resetMouseCandidateChoice = () => {\r\n mouseCandidateEventBinder.unbind();\r\n };\r\n\r\n var mouseOverToHoveredAndReset = (wrap) => {\r\n \r\n if (!wrap.choice.isHoverIn)\r\n navigateAspect.hoverIn(wrap);\r\n resetMouseCandidateChoice();\r\n };\r\n \r\n function adoptChoiceElement(wrap){\r\n let choiceElement = wrap.choice.choiceElement;\r\n // in chrome it happens on \"become visible\" so we need to skip it, \r\n // for IE11 and edge it doesn't happens, but for IE11 and Edge it doesn't happens on small \r\n // mouse moves inside the item. \r\n // https://stackoverflow.com/questions/59022563/browser-events-mouseover-doesnt-happen-when-you-make-element-visible-and-mous\r\n \r\n var onChoiceElementMouseover = () => \r\n {\r\n if (eventLoopFlag.get() )\r\n {\r\n resetMouseCandidateChoice();\r\n mouseCandidateEventBinder.bind(choiceElement, 'mousemove', ()=>mouseOverToHoveredAndReset(wrap));\r\n mouseCandidateEventBinder.bind(choiceElement, 'mousedown', ()=>mouseOverToHoveredAndReset(wrap));\r\n }\r\n else\r\n {\r\n if (!wrap.choice.isHoverIn)\r\n {\r\n // NOTE: mouseleave is not enough to guarantee remove hover styles in situations\r\n // when style was setuped without mouse (keyboard arrows)\r\n // therefore force reset manually (done inside hoverIn)\r\n navigateAspect.hoverIn(wrap);\r\n } \r\n }\r\n }\r\n \r\n // note 1: mouseleave preferred to mouseout - which fires on each descendant\r\n // note 2: since I want add aditional info panels to the dropdown put mouseleave on dropdwon would not work\r\n var onChoiceElementMouseleave = () => {\r\n if (!eventLoopFlag.get()) {\r\n hoveredChoiceAspect.resetHoveredChoice();\r\n }\r\n }\r\n var overAndLeaveEventBinder = EventBinder();\r\n overAndLeaveEventBinder.bind(choiceElement, 'mouseover', onChoiceElementMouseover);\r\n overAndLeaveEventBinder.bind(choiceElement, 'mouseleave', onChoiceElementMouseleave);\r\n\r\n return overAndLeaveEventBinder.unbind;\r\n }\r\n\r\n \r\n filterDom.onFocusIn(()=>focusInAspect.setFocusIn(true));\r\n filterDom.onFocusOut(() => { \r\n if (!getSkipFocusout()){ // skip initiated by mouse click (we manage it different way)\r\n resetLayoutAspect.resetLayout(); // if do not do this we will return to filtered list without text filter in input\r\n focusInAspect.setFocusIn(false);\r\n }\r\n resetSkipFocusout();\r\n }\r\n );\r\n\r\n // it can be initated by 3PP functionality\r\n // sample (1) BS functionality - input x button click - clears input\r\n // sample (2) BS functionality - esc keydown - clears input\r\n // and there could be difference in processing: (2) should hide the menu, then reset , when (1) should just reset without hiding.\r\n\r\n function afterInput(){\r\n let visibleCount = filterManagerAspect.getNavigateManager().getCount();\r\n\r\n if (visibleCount > 0){\r\n if (warningAspect){\r\n warningAspect.hide();\r\n }\r\n let panelIsVisble = choicesVisibilityAspect.isChoicesVisible();\r\n if (!panelIsVisble){\r\n showChoices(); \r\n }\r\n if (visibleCount == 1){\r\n navigateAspect.hoverIn(filterManagerAspect.getNavigateManager().getHead())\r\n }else{\r\n if (panelIsVisble)\r\n hoveredChoiceAspect.resetHoveredChoice();\r\n } \r\n }else{\r\n if (choicesVisibilityAspect.isChoicesVisible()){\r\n hideChoices();\r\n }\r\n if (warningAspect){\r\n if (filterManagerAspect.getFilter())\r\n warningAspect.show(configuration.noResultsWarning);\r\n else\r\n warningAspect.hide();\r\n } \r\n }\r\n }\r\n\r\n filterDom.onInput(() => {\r\n if (placeholderStopInputAspect && placeholderStopInputAspect.get()){\r\n placeholderStopInputAspect.reset();\r\n return; \r\n }\r\n let {filterInputValue, isEmpty} = inputAspect.processInput();\r\n if (isEmpty)\r\n filterManagerAspect.processEmptyInput();\r\n else\r\n filterDom.setWidth(filterInputValue); \r\n eventLoopFlag.set(); // means disable mouse handlers that set hovered item; otherwise we will get \"Hover On MouseEnter\" when filter's changes should remove hover\r\n afterInput();\r\n });\r\n\r\n function keyDownArrow(down) {\r\n let wrap = navigateAspect.navigate(down); \r\n if (wrap)\r\n {\r\n // TODO: next line should be moved to planned \"HeightAndScroll\" plugin, actual only for scrolling with keyDown functionality\r\n eventLoopFlag.set(400); // means disable mouse handlers that set hovered choice item; arrowDown can intiate scrolling when scrolling can itiate mouse leave on hovered item; this stops it\r\n navigateAspect.hoverIn(wrap); // !\r\n showChoices(); \r\n }\r\n }\r\n\r\n function hoveredToSelected(){\r\n \r\n let hoveredWrap = hoveredChoiceAspect.getHoveredChoice(); \r\n if (hoveredWrap){\r\n let wasToggled = optionToggleAspect.toggle(hoveredWrap); \r\n if (wasToggled) {\r\n resetLayoutAspect.resetLayout();\r\n }\r\n }\r\n }\r\n\r\n // TODO: bind it more declarative way? (compact code)\r\n var onKeyDown = (event) => {\r\n let keyCode = event.which;\r\n var empty = filterDom.isEmpty();\r\n if ([ 13,\r\n 27 // '27-esc' there is \"just in case\", I can imagine that there are user agents that do UNDO\r\n ].indexOf(keyCode)>=0 \r\n || (keyCode == 9 && !empty) // otherwice there are no keyup (true at least for '9-tab'),\r\n ) {\r\n event.preventDefault(); \r\n \r\n // '13-enter' - prevention against form's default button \r\n // but doesn't help with bootsrap modal ESC or ENTER (close behaviour);\r\n }\r\n if ([ 38, 40 ].indexOf(keyCode) >= 0 )\r\n event.preventDefault(); \r\n if (keyCode == 8 /*backspace*/) {\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 // let isBackspaceAtStartPoint = (this.filterInput.selectionStart == 0 && this.filterInput.selectionEnd == 0);\r\n if (empty) {\r\n let pick = picksList.getTail();\r\n if (pick){ \r\n specialPicksEventsAspect.backSpace(pick);\r\n }\r\n }\r\n }\r\n // ---------------------------------------------------------------------------------\r\n // NOTE: no preventDefault called in case of empty for 9-tab\r\n else if (keyCode == 9 /*tab*/) { // NOTE: no keydown for this (without preventDefaul after TAB keyup event will be targeted another element) \r\n if (empty) { \r\n hideChoices(); // hideChoices inside (and no filter reset since it is empty) \r\n }\r\n }\r\n else if (keyCode == 27 /*esc*/ ) { // NOTE: forbid the ESC to close the modal (in case the nonempty or dropdown is open)\r\n if (!empty || choicesVisibilityAspect.isChoicesVisible())\r\n event.stopPropagation()\r\n }\r\n else if (keyCode == 38) {\r\n keyDownArrow(false); // up\r\n }\r\n else if (keyCode == 40) {\r\n keyDownArrow(true); // down\r\n }\r\n }\r\n var onKeyUp = (event) => {\r\n let keyCode = event.which;\r\n //var handler = keyUp[event.which/* key code */];\r\n //handler(); \r\n if (keyCode == 9) {\r\n if (choicesVisibilityAspect.isChoicesVisible()) {\r\n hoveredToSelected();\r\n } \r\n }\r\n else if (keyCode == 13 ) {\r\n if (choicesVisibilityAspect.isChoicesVisible()) {\r\n hoveredToSelected();\r\n } else {\r\n if (filterManagerAspect.getNavigateManager().getCount()>0){\r\n showChoices();\r\n }\r\n }\r\n }\r\n else if (keyCode == 27) { // escape\r\n // is it always empty (bs x can still it) \r\n resetLayoutAspect.resetLayout();\r\n }\r\n }\r\n\r\n filterDom.onKeyDown(onKeyDown); \r\n filterDom.onKeyUp(onKeyUp);\r\n\r\n let origSetDisabledComponent = setDisabledComponentAspect.setDisabledComponent; \r\n setDisabledComponentAspect.setDisabledComponent = (isComponentDisabled) => {\r\n origSetDisabledComponent(isComponentDisabled);\r\n if (isComponentDisabled)\r\n componentDisabledEventBinder.unbind();\r\n else\r\n componentDisabledEventBinder.bind(picksElement, \"click\", clickToShowChoices); \r\n }\r\n\r\n resetLayoutAspect.resetLayout = composeSync(\r\n hideChoices,\r\n ()=>{if (warningAspect)\r\n warningAspect.hide();},\r\n resetLayoutAspect.resetLayout // resetFilter by default\r\n );\r\n\r\n let origCreatePickHandlers = createPickHandlersAspect.createPickHandlers;\r\n createPickHandlersAspect.createPickHandlers = (wrap) => {\r\n let pickHandlers = origCreatePickHandlers(wrap);\r\n pickHandlers.removeOnButton = handleOnRemoveButton(pickHandlers.removeOnButton);\r\n return pickHandlers;\r\n } \r\n\r\n let origBuildChoice = buildChoiceAspect.buildChoice;\r\n buildChoiceAspect.buildChoice = (wrap) => {\r\n origBuildChoice(wrap);\r\n let pickHandlers = createPickHandlersAspect.createPickHandlers(wrap);\r\n\r\n wrap.choice.remove = composeSync(wrap.choice.remove, () => {\r\n if (pickHandlers.removeAndDispose) {\r\n pickHandlers.removeAndDispose();\r\n pickHandlers.removeAndDispose=null;\r\n }\r\n })\r\n \r\n let unbindChoiceElement = adoptChoiceElement(wrap);\r\n wrap.choice.dispose = composeSync(unbindChoiceElement, wrap.choice.dispose);\r\n }\r\n\r\n return {\r\n dispose(){\r\n resetMouseCandidateChoice();\r\n picksElement.removeEventListener(\"mousedown\", skipoutAndResetMousedown);\r\n componentDisabledEventBinder.unbind();\r\n pop.dispose(); \r\n }\r\n }\r\n}\r\n","\r\nexport function SetDisabledComponentAspect(picksList, picksDom){\r\n return {\r\n setDisabledComponent(isComponentDisabled){\r\n picksList.forEach(pick=>pick.pickDomManagerHandlers.updateComponentDisabled())\r\n picksDom.disable(isComponentDisabled);\r\n }\r\n }\r\n}\r\n\r\nexport function UpdateDisabledComponentAspect(componentPropertiesAspect, setDisabledComponentAspect\r\n ){\r\n let isComponentDisabled;\r\n return {\r\n updateDisabledComponent(){\r\n let newIsComponentDisabled = componentPropertiesAspect.getDisabled();\r\n if (isComponentDisabled!==newIsComponentDisabled){\r\n isComponentDisabled=newIsComponentDisabled;\r\n setDisabledComponentAspect.setDisabledComponent(newIsComponentDisabled);\r\n }\r\n }\r\n }\r\n}\r\n\r\nexport function ResetLayoutAspect(resetLayout){\r\n return {\r\n resetLayout\r\n }\r\n}\r\n\r\nexport function AppearanceAspect(updateDisabledComponentAspect){\r\n return {\r\n updateAppearance(){\r\n updateDisabledComponentAspect.updateDisabledComponent();\r\n }\r\n }\r\n}\r\n","\r\nexport function LoadAspect(optionsLoopAspect, appearanceAspect){\r\n return {\r\n load(){ // redriven in FormRestoreOnBackwardPlugin\r\n optionsLoopAspect.loop();\r\n appearanceAspect.updateAppearance(); \r\n }\r\n }\r\n}","export function CountableChoicesListInsertAspect(countableChoicesList, wrapsCollection){\r\n return {\r\n countableChoicesListInsert(wrap, key){\r\n let choiceNext = wrapsCollection.getNext(key);\r\n countableChoicesList.add(wrap, choiceNext)\r\n }\r\n }\r\n}","import {PluginManager, plugStaticDom} from './PluginManager'\r\n\r\nimport {composeSync, List, extendIfUndefined} from './ToolsJs';\r\nimport {PickDomFactory} from './PickDomFactory';\r\nimport {ChoiceDomFactory} from './ChoiceDomFactory';\r\n\r\nimport {StaticDomFactory, CreateElementAspect} from './StaticDomFactory';\r\n\r\nimport {PicksDom} from './PicksDom';\r\nimport {FilterDom} from './FilterDom';\r\n\r\nimport {ChoicesDomFactory} from './ChoicesDomFactory';\r\nimport {ChoicesVisibilityAspect} from './ChoicesVisibilityAspect';\r\nimport {SpecialPicksEventsAspect} from './SpecialPicksEventsAspect';\r\n \r\nimport {ComponentPropertiesAspect, TriggerAspect, OnChangeAspect} from './ComponentPropertiesAspect';\r\nimport {OptionsAspect, OptionPropertiesAspect} from './OptionsAspect';\r\n\r\nimport {ChoicesEnumerableAspect } from './ChoicesEnumerableAspect'\r\nimport {FilterManagerAspect, NavigateManager, FilterPredicateAspect} from './FilterManagerAspect'\r\nimport {BuildAndAttachChoiceAspect, BuildChoiceAspect} from './BuildChoiceAspect'\r\nimport {OptionsLoopAspect, OptionAttachAspect} from './OptionsLoopAspect'\r\n\r\nimport {UpdateDataAspect } from './UpdateDataAspect'\r\nimport {CreateWrapAspect, CreateChoiceBaseAspect, OptionToggleAspect, CreatePickHandlersAspect, RemovePickAspect, \r\n AddPickAspect, FullMatchAspect, ChoiceClickAspect, IsChoiceSelectableAspect, ProducePickAspect} from './CreateWrapAspect.js'\r\nimport {NavigateAspect, HoveredChoiceAspect} from './NavigateAspect'\r\nimport {Wraps} from './Wraps'\r\n\r\n\r\nimport {PickButtonAspect} from './PickButtonAspect'\r\n\r\nimport {BuildPickAspect} from './BuildPickAspect'\r\nimport {InputAspect} from './InputAspect'\r\nimport {ResetFilterAspect, FocusInAspect, ResetFilterListAspect} from './ResetFilterListAspect'\r\n\r\nimport {MultiSelectInlineLayout} from './MultiSelectInlineLayout'\r\n\r\nimport {SetDisabledComponentAspect, UpdateDisabledComponentAspect, AppearanceAspect, ResetLayoutAspect} from './AppearanceAspect'\r\nimport {LoadAspect} from './LoadAspect'\r\nimport {DoublyLinkedList, ArrayFacade} from './ToolsJs'\r\nimport {CountableChoicesListInsertAspect} from './CountableChoicesListInsertAspect'\r\n\r\n/// environment - common for many; configuration for concreate\r\nexport function BsMultiSelect(element, environment, plugins, configuration, onInit){\r\n var {window} = environment;\r\n environment.isIE11 = !!window.MSInputMethodContext && !!document.documentMode;\r\n\r\n let { containerClass,\r\n css, \r\n getDisabled,\r\n options, \r\n getText\r\n } = configuration;\r\n \r\n let disposeAspect = {};\r\n let triggerAspect = TriggerAspect(element, environment.trigger);\r\n let onChangeAspect = OnChangeAspect(triggerAspect, 'dashboardcode.multiselect:change');\r\n let componentPropertiesAspect = ComponentPropertiesAspect(getDisabled??(() => false));\r\n let optionsAspect = OptionsAspect(options); \r\n let optionPropertiesAspect = OptionPropertiesAspect(getText);\r\n let isChoiceSelectableAspect = IsChoiceSelectableAspect();\r\n let createWrapAspect = CreateWrapAspect();\r\n let createChoiceBaseAspect = CreateChoiceBaseAspect(optionPropertiesAspect);\r\n //let rtlAspect = RtlAspect();\r\n //let setOptionSelectedAspect = SetOptionSelectedAspect(optionPropertiesAspect);\r\n \r\n let addPickAspect = AddPickAspect();\r\n let removePickAspect = RemovePickAspect();\r\n \r\n let createElementAspect = CreateElementAspect(name => window.document.createElement(name));\r\n \r\n let choicesDomFactory = ChoicesDomFactory(createElementAspect);\r\n let staticDomFactory = StaticDomFactory(choicesDomFactory, createElementAspect);\r\n \r\n let wrapsCollection = ArrayFacade();\r\n \r\n let countableChoicesList = DoublyLinkedList(\r\n (wrap)=>wrap.choice.itemPrev, \r\n (warp, v)=>warp.choice.itemPrev=v, \r\n (wrap)=>wrap.choice.itemNext, \r\n (wrap, v)=>wrap.choice.itemNext=v\r\n );\r\n \r\n let countableChoicesListInsertAspect = CountableChoicesListInsertAspect(countableChoicesList, wrapsCollection);\r\n\r\n let choicesEnumerableAspect = ChoicesEnumerableAspect(countableChoicesList, wrap=>wrap.choice.itemNext)\r\n \r\n let filteredChoicesList = DoublyLinkedList(\r\n (wrap)=>wrap.choice.filteredPrev, \r\n (wrap, v)=>wrap.choice.filteredPrev=v, \r\n (wrap)=>wrap.choice.filteredNext, \r\n (wrap, v)=>wrap.choice.filteredNext=v\r\n );\r\n \r\n let emptyNavigateManager = NavigateManager(\r\n countableChoicesList,\r\n (wrap)=>wrap.choice.itemPrev,\r\n (wrap)=>wrap.choice.itemNext \r\n \r\n ); \r\n let filteredNavigateManager = NavigateManager(\r\n filteredChoicesList, \r\n (wrap)=>wrap.choice.filteredPrev,\r\n (wrap)=>wrap.choice.filteredNext ); \r\n\r\n let filterPredicateAspect = FilterPredicateAspect()\r\n\r\n let filterManagerAspect = FilterManagerAspect(\r\n emptyNavigateManager,\r\n filteredNavigateManager,\r\n \r\n filteredChoicesList, \r\n choicesEnumerableAspect,\r\n filterPredicateAspect\r\n );\r\n\r\n let hoveredChoiceAspect = HoveredChoiceAspect()\r\n let navigateAspect = NavigateAspect(hoveredChoiceAspect, \r\n (down, hoveredChoice)=>filterManagerAspect.getNavigateManager().navigate(down, hoveredChoice));\r\n let picksList = List();\r\n let wraps = Wraps(\r\n wrapsCollection,\r\n ()=>countableChoicesList.reset(), \r\n (w)=>countableChoicesList.remove(w),\r\n (w, key)=>countableChoicesListInsertAspect.countableChoicesListInsert(w, key));\r\n\r\n let aspects = {\r\n environment, configuration, triggerAspect, onChangeAspect, componentPropertiesAspect, disposeAspect, \r\n countableChoicesList, countableChoicesListInsertAspect,\r\n optionsAspect, optionPropertiesAspect, \r\n createWrapAspect, createChoiceBaseAspect, isChoiceSelectableAspect, \r\n createElementAspect,\r\n choicesDomFactory, staticDomFactory,\r\n filterPredicateAspect, wrapsCollection, choicesEnumerableAspect, \r\n filteredChoicesList, filterManagerAspect, hoveredChoiceAspect, navigateAspect, picksList, wraps,\r\n addPickAspect, removePickAspect\r\n }\r\n\r\n plugStaticDom(plugins, aspects); // apply cssPatch to css, apply selectElement support; \r\n\r\n let {choicesDom, createStaticDom} = staticDomFactory.create(css)\r\n\r\n let {staticDom, staticManager} = createStaticDom(element, containerClass)\r\n\r\n // after this we can use staticDom in construtctor, this simplifies parameters passing a lot \r\n\r\n let filterDom = FilterDom(staticDom.disposablePicksElement, createElementAspect, css);\r\n let specialPicksEventsAspect = SpecialPicksEventsAspect();\r\n\r\n let choicesVisibilityAspect = ChoicesVisibilityAspect(choicesDom.choicesElement);\r\n let resetFilterListAspect = ResetFilterListAspect(filterDom, filterManagerAspect)\r\n let resetFilterAspect = ResetFilterAspect(filterDom, resetFilterListAspect)\r\n \r\n\r\n // TODO get picksDom from staticDomFactory\r\n let picksDom = PicksDom(staticDom.picksElement, staticDom.disposablePicksElement, createElementAspect, css);\r\n let focusInAspect = FocusInAspect(picksDom);\r\n \r\n let pickButtonAspect = PickButtonAspect(configuration.pickButtonHTML);\r\n \r\n let pickDomFactory = PickDomFactory(css, componentPropertiesAspect, optionPropertiesAspect, pickButtonAspect);\r\n let buildPickAspect = BuildPickAspect(picksDom, pickDomFactory);\r\n let producePickAspect = ProducePickAspect(picksList, removePickAspect, buildPickAspect)\r\n let createPickHandlersAspect = CreatePickHandlersAspect(producePickAspect);\r\n \r\n \r\n let optionToggleAspect = OptionToggleAspect(createPickHandlersAspect, addPickAspect);\r\n let fullMatchAspect = FullMatchAspect(createPickHandlersAspect, addPickAspect);\r\n let inputAspect = InputAspect(filterDom, filterManagerAspect, fullMatchAspect); \r\n\r\n let choiceClickAspect = ChoiceClickAspect(optionToggleAspect, filterDom);\r\n\r\n let choiceDomFactory = ChoiceDomFactory(css, optionPropertiesAspect, aspects.highlightAspect); // optional highlightAspect added by highlightPlugin\r\n \r\n let buildChoiceAspect = BuildChoiceAspect( choicesDom, choiceDomFactory, choiceClickAspect);\r\n let buildAndAttachChoiceAspect = BuildAndAttachChoiceAspect(buildChoiceAspect);\r\n let resetLayoutAspect = ResetLayoutAspect(() => resetFilterAspect.resetFilter());\r\n\r\n let setDisabledComponentAspect = SetDisabledComponentAspect(picksList, picksDom);\r\n let updateDisabledComponentAspect = UpdateDisabledComponentAspect(componentPropertiesAspect,setDisabledComponentAspect );\r\n let appearanceAspect = AppearanceAspect(updateDisabledComponentAspect);\r\n \r\n let optionAttachAspect = OptionAttachAspect(createWrapAspect, createChoiceBaseAspect, buildAndAttachChoiceAspect, wraps);\r\n let optionsLoopAspect = OptionsLoopAspect(optionsAspect, optionAttachAspect);\r\n let loadAspect = LoadAspect(optionsLoopAspect, appearanceAspect);\r\n let updateDataAspect = UpdateDataAspect(choicesDom, wraps, picksList, optionsLoopAspect, resetLayoutAspect);\r\n\r\n extendIfUndefined(aspects, {\r\n staticDom, picksDom, choicesDom,filterDom, resetLayoutAspect, pickDomFactory, choiceDomFactory,\r\n choicesVisibilityAspect, staticManager, buildChoiceAspect, optionToggleAspect, choiceClickAspect, \r\n buildAndAttachChoiceAspect, optionsLoopAspect, optionAttachAspect,\r\n buildPickAspect, producePickAspect, createPickHandlersAspect, inputAspect, resetFilterListAspect, resetFilterAspect, \r\n specialPicksEventsAspect,\r\n resetLayoutAspect, focusInAspect, \r\n updateDisabledComponentAspect, setDisabledComponentAspect, appearanceAspect, loadAspect,\r\n updateDataAspect, fullMatchAspect} )\r\n \r\n let pluginManager = PluginManager(plugins, aspects);\r\n \r\n let multiSelectInlineLayout = MultiSelectInlineLayout(aspects);\r\n\r\n let api = {component: \"BsMultiSelect.api\"} // key used in memory leak analyzes\r\n \r\n pluginManager.buildApi(api);\r\n // after this we can pass aspects methods call without wrapping - there should be no more overridings. TODO freeze aspects?\r\n api.dispose = composeSync(\r\n resetLayoutAspect.resetLayout,\r\n disposeAspect.dispose,\r\n pluginManager.dispose, \r\n ()=>{picksList.forEach(pick=>pick.dispose());},\r\n multiSelectInlineLayout.dispose, // TODO move to layout\r\n wraps.dispose,\r\n staticManager.dispose, picksDom.dispose, filterDom.dispose );\r\n \r\n api.updateAppearance = appearanceAspect.updateAppearance;\r\n api.updateData = updateDataAspect.updateData;\r\n api.update = () => {\r\n updateDataAspect.updateData();\r\n appearanceAspect.updateAppearance();\r\n }\r\n\r\n api.updateDisabled = updateDisabledComponentAspect.updateDisabledComponent;\r\n // TODO api.updateOption = (key) => {/* all updates: selected, disabled, hidden, text */}\r\n\r\n onInit?.(api, aspects);\r\n picksDom.pickFilterElement.appendChild(filterDom.filterInputElement);\r\n picksDom.picksElement.appendChild(picksDom.pickFilterElement); \r\n staticManager.appendToContainer();\r\n loadAspect.load();\r\n return api;\r\n}\r\n","const transformStyles = [\r\n {old:'selectedPanelDisabledBackgroundColor', opt:'picks_disabled', style:\"backgroundColor\"},\r\n {old:'selectedPanelFocusValidBoxShadow', opt:'picks_focus_valid', style:\"boxShadow\"},\r\n {old:'selectedPanelFocusInvalidBoxShadow', opt:'picks_focus_invalid', style:\"boxShadow\"},\r\n {old:'selectedPanelDefMinHeight', opt:'picks_def', style:\"minHeight\"},\r\n {old:'selectedPanelLgMinHeight', opt:'picks_lg', style:\"minHeight\"},\r\n {old:'selectedPanelSmMinHeight', opt:'picks_sm', style:\"minHeight\"},\r\n {old:'selectedItemContentDisabledOpacity', opt:'choiceLabel_disabled', style:\"opacity\"}\r\n]\r\n\r\nconst transformClasses = [\r\n {old:'dropDownMenuClass', opt:'choices'},\r\n {old:'dropDownItemClass', opt:'choice'},\r\n {old:'dropDownItemHoverClass', opt:'choice_hover'},\r\n {old:'selectedPanelClass', opt:'picks'},\r\n {old:'selectedItemClass', opt:'pick'},\r\n {old:'removeSelectedItemButtonClass', opt:'pickButton'},\r\n {old:'filterInputItemClass', opt:'pickFilter'},\r\n {old:'filterInputClass', opt:'filterInput'},\r\n {old:'selectedPanelFocusClass', opt:'picks_focus'},\r\n {old:'selectedPanelDisabledClass', opt:'picks_disabled'},\r\n {old:'selectedItemContentDisabledClass', opt:'pick_disabled'}\r\n]\r\n\r\nexport function adjustLegacySettings(settings){\r\n if (!settings.css)\r\n settings.css={}\r\n var css =settings.css;\r\n\r\n if (!settings.cssPatch)\r\n settings.cssPatch={}\r\n var cssPatch =settings.cssPatch;\r\n\r\n if (settings.selectedPanelFocusBorderColor || settings.selectedPanelFocusBoxShadow){\r\n console.log(\"DashboarCode.BsMultiSelect: selectedPanelFocusBorderColor and selectedPanelFocusBoxShadow are depricated, use - cssPatch:{picks_focus:{borderColor:'myValue', boxShadow:'myValue'}}\");\r\n if(!cssPatch.picks_focus){\r\n cssPatch.picks_focus = {boxShadow: settings.selectedPanelFocusBoxShadow, borderColor: settings.selectedPanelFocusBorderColor}\r\n }\r\n delete settings.selectedPanelFocusBorderColor;\r\n delete settings.selectedPanelFocusBoxShadow;\r\n }\r\n\r\n transformStyles.forEach(\r\n (i)=>{\r\n if (settings[i.old]){\r\n console.log(`DashboarCode.BsMultiSelect: ${i.old} is depricated, use - cssPatch:{${i.opt}:{${i.style}:'myValue'}}`);\r\n if(!settings[i.opt]){\r\n let opt = {}\r\n opt[i.style] = settings[i.old]\r\n settings.cssPatch[i.opt]=opt;\r\n }\r\n delete settings[i.old];\r\n }\r\n }\r\n )\r\n \r\n transformClasses.forEach( (i) => {\r\n if (settings[i.old]){\r\n console.log(`DashboarCode.BsMultiSelect: ${i.old} is depricated, use - css:{${i.opt}:'myValue'}`);\r\n if(!css[i.opt]){\r\n css[i.opt]= settings[i.old]\r\n }\r\n delete settings[i.old];\r\n }\r\n })\r\n \r\n if (settings.inputColor){\r\n console.log(\"DashboarCode.BsMultiSelect: inputColor is depricated, remove parameter\");\r\n delete settings.inputColor;\r\n }\r\n\r\n if (settings.useCss){\r\n console.log(\"DashboarCode.BsMultiSelect: useCss(=true) is depricated, use - 'useCssPatch: false'\");\r\n if(!css.pick_disabled){\r\n settings.useCssPatch = !settings.useCss\r\n }\r\n delete settings.useCss;\r\n } \r\n\r\n if (settings.getIsValid || settings.getIsInValid){\r\n throw \"DashboarCode.BsMultiSelect: parameters getIsValid and getIsInValid are depricated and removed, use - getValidity that should return (true|false|null) \"\r\n } \r\n}","import {BsMultiSelect} from './BsMultiSelect'\r\nimport {plugMergeSettings, plugDefaultConfig} from './PluginManager'\r\n\r\nimport {adjustLegacySettings} from './BsMultiSelectDepricatedParameters'\r\n\r\nimport {createCss} from './ToolsStyling'\r\nimport {extendIfUndefined} from './ToolsJs'\r\n\r\n// TODO: remove environment - replace it with plugins\r\nexport function MultiSelectBuilder(environment, plugins) \r\n{\r\n const defaults = {containerClass: \"dashboardcode-bsmultiselect\"}\r\n\r\n let create = (element, options) => { \r\n if (options && options.plugins)\r\n console.log(\"DashboarCode.BsMultiSelect: 'options.plugins' is depricated, use - MultiSelectBuilder(environment, plugins) instead\");\r\n let configuration = {};\r\n let buildConfiguration;\r\n if (options instanceof Function) {\r\n buildConfiguration = options;\r\n options = null;\r\n } else {\r\n buildConfiguration = options?.buildConfiguration;\r\n }\r\n if (options){\r\n adjustLegacySettings(options);\r\n }\r\n configuration.css = createCss(defaults.css, options?.css);\r\n plugMergeSettings(plugins, configuration, defaults, options); // merge settings.cssPatch and defaults.cssPatch\r\n extendIfUndefined(configuration, options);\r\n extendIfUndefined(configuration, defaults);\r\n let onInit = buildConfiguration?.(element, configuration);\r\n let multiSelect = BsMultiSelect(element, environment, plugins, configuration, onInit); // onInit(api, aspects) - before load data\r\n return multiSelect;\r\n }\r\n plugDefaultConfig(plugins, defaults);\r\n return {create, defaultSettings: defaults}\r\n}\r\n","import {addToJQueryPrototype} from './AddToJQueryPrototype'\r\n\r\nimport {composeSync, shallowClearClone, ObjectValues, isString} from './ToolsJs'\r\nimport {composeEventTrigger} from './ToolsDom'\r\n\r\nimport {MultiSelectBuilder} from './MultiSelectBuilder'\r\n\r\nexport function createForJQuery(window, $, createPopper, name, pluginsSet, stylePlugin){\r\n let trigger = null;\r\n let isJQyery = $ && !window.document.body.hasAttribute('data-bs-no-jquery');\r\n if (isJQyery) {\r\n trigger = (e, eventName) => $(e).trigger(eventName);\r\n } else {\r\n trigger = composeEventTrigger(window);\r\n }\r\n let plugins = shallowClearClone({stylePlugin}, pluginsSet);\r\n\r\n let environment = {trigger, window, createPopper}\r\n let pluginsArray = ObjectValues(plugins)\r\n let {create, defaultSettings} = MultiSelectBuilder(environment, pluginsArray);\r\n let createForUmd = (element, settings) => {\r\n if (isString(element))\r\n element = window.document.querySelector(element);\r\n return create(element, settings);\r\n }\r\n createForUmd.Default = defaultSettings;\r\n\r\n if (isJQyery) {\r\n let constructorForJquery = (element, settings, removeInstanceData) => {let multiSelect = create(element, settings); multiSelect.dispose = composeSync(multiSelect.dispose, removeInstanceData); return multiSelect;} \r\n let prototypable = addToJQueryPrototype(name, constructorForJquery, $);\r\n \r\n prototypable.defaults = defaultSettings;\r\n }\r\n return createForUmd; \r\n}\r\n","import {defCall} from '../ToolsJs';\r\n\r\nexport function LabelPlugin(pluginData){\r\n let {configuration, staticDom, filterDom} = pluginData;\r\n let {containerClass, label} = configuration\r\n let getLabelElementAspect = () => defCall(label); \r\n let labelPluginData = {getLabelElementAspect}; // overrided by BS Appearance Plugin\r\n pluginData.labelPluginData=labelPluginData;\r\n let createInputId = null;\r\n let {selectElement, containerElement} = staticDom;\r\n let {filterInputElement} = filterDom;\r\n if(selectElement)\r\n createInputId = () => `${containerClass}-generated-input-${((selectElement.id)?selectElement.id:selectElement.name).toLowerCase()}-id`;\r\n else\r\n createInputId = () => `${containerClass}-generated-filter-${containerElement.id}`;\r\n\r\n return {\r\n buildApi(){\r\n let labelElement = labelPluginData.getLabelElementAspect();\r\n let backupedForAttribute = null; // state saved between init and dispose\r\n if (labelElement) {\r\n backupedForAttribute = labelElement.getAttribute('for');\r\n var newId = createInputId();\r\n filterInputElement.setAttribute('id', newId);\r\n labelElement.setAttribute('for',newId);\r\n }\r\n if (backupedForAttribute)\r\n return () => labelElement.setAttribute('for',backupedForAttribute);\r\n }\r\n }\r\n}","import {getIsRtl, AttributeBackup} from '../ToolsDom';\r\nimport {isBoolean} from '../ToolsJs';\r\n\r\nexport function RtlPlugin(pluginData){\r\n \r\n let {configuration, rtlAspect, staticDom} = pluginData;\r\n let {isRtl} = configuration;\r\n let forceRtlOnContainer = false; \r\n if (isBoolean(isRtl))\r\n forceRtlOnContainer = true;\r\n else\r\n isRtl = getIsRtl(staticDom.initialElement);\r\n \r\n var attributeBackup = AttributeBackup();\r\n if (forceRtlOnContainer){\r\n attributeBackup.set(staticDom.containerElement, \"dir\", \"rtl\");\r\n }\r\n else if (staticDom.selectElement){\r\n var dirAttributeValue = staticDom.selectElement.getAttribute(\"dir\");\r\n if (dirAttributeValue){\r\n attributeBackup.set(staticDom.containerElement, \"dir\", dirAttributeValue);\r\n }\r\n } \r\n \r\n return {\r\n buildApi(api){\r\n // TODO there is something wrong with this. may be should moved to specific plugin\r\n // sample of correct plugin - aspect pair is WarningPlugin: aspect is added on plugin constrictor\r\n if (rtlAspect.updateRtl)\r\n rtlAspect.updateRtl(isRtl);\r\n },\r\n dispose(){\r\n attributeBackup.restore;\r\n }\r\n }\r\n}\r\n\r\nRtlPlugin.plugStaticDom = (aspects) => {\r\n aspects.rtlAspect = RtlAspect();\r\n}\r\n\r\nfunction RtlAspect() {\r\n return {\r\n updateRtl(){},\r\n }\r\n}","import {EventBinder, closestByTagName} from '../ToolsDom';\r\n\r\nexport function FormResetPlugin(pluginData){\r\n var {staticDom, environment} = pluginData;\r\n return {\r\n buildApi(api){\r\n var eventBuilder = EventBinder();\r\n if (staticDom.selectElement){\r\n var form = closestByTagName(staticDom.selectElement, 'FORM');\r\n if (form) {\r\n eventBuilder.bind(form, \r\n 'reset', \r\n () => environment.window.setTimeout( ()=>api.updateData() ) );\r\n }\r\n }\r\n return eventBuilder.unbind;\r\n }\r\n }\r\n}","function createValidity(valueMissing, customError){\r\n return Object.freeze({\r\n valueMissing,\r\n customError,\r\n valid: !(valueMissing || customError),\r\n });\r\n}\r\n\r\nexport function ValidityApi(visibleElement, isValueMissingObservable, valueMissingMessage, onValid, trigger){\r\n var customValidationMessage = \"\";\r\n var validationMessage = \"\";\r\n var validity = null;\r\n var willValidate = true;\r\n \r\n function setMessage(valueMissing, customError){\r\n validity = createValidity(valueMissing, customError);\r\n validationMessage = customError?customValidationMessage:(valueMissing?valueMissingMessage:\"\")\r\n visibleElement.setCustomValidity(validationMessage);\r\n onValid(validity.valid);\r\n }\r\n\r\n setMessage(isValueMissingObservable.getValue(), false);\r\n\r\n isValueMissingObservable.attach(\r\n (value) => {\r\n setMessage(value, validity.customError);\r\n }\r\n );\r\n var checkValidity = () => {\r\n if (!validity.valid)\r\n trigger('dashboardcode.multiselect:invalid')\r\n return validity.valid;\r\n }\r\n return {\r\n validationMessage,\r\n willValidate,\r\n validity,\r\n setCustomValidity(message){\r\n customValidationMessage = message;\r\n setMessage(validity.valueMissing, customValidationMessage?true:false);\r\n },\r\n checkValidity,\r\n reportValidity(){\r\n visibleElement.reportValidity();\r\n return checkValidity();\r\n }\r\n }\r\n}","import {ValidityApi} from '../ValidityApi'\r\nimport {ObservableValue, ObservableLambda, defCall, isBoolean, composeSync} from '../ToolsJs';\r\nimport {getDataGuardedWithPrefix} from '../ToolsDom';\r\n\r\nconst defValueMissingMessage = 'Please select an item in the list'\r\n\r\nexport function ValidationApiPlugin(pluginData){\r\n var {configuration, triggerAspect, onChangeAspect, optionsAspect, \r\n staticDom, filterDom, updateDataAspect} = pluginData;\r\n // TODO: required could be a function\r\n let {getIsValueMissing, valueMissingMessage, required, getValueRequired} = configuration;\r\n if (!isBoolean(required))\r\n required = getValueRequired(); \r\n valueMissingMessage = defCall(valueMissingMessage,\r\n ()=> getDataGuardedWithPrefix(staticDom.initialElement,\"bsmultiselect\",\"value-missing-message\"),\r\n defValueMissingMessage)\r\n\r\n if (!getIsValueMissing) {\r\n getIsValueMissing = () => {\r\n let count = 0;\r\n let optionsArray = optionsAspect.getOptions();\r\n for (var i=0; i < optionsArray.length; i++) {\r\n if (optionsArray[i].selected) \r\n count++;\r\n }\r\n return count===0;\r\n }\r\n }\r\n \r\n var isValueMissingObservable = ObservableLambda(()=>required && getIsValueMissing());\r\n var validationApiObservable = ObservableValue(!isValueMissingObservable.getValue());\r\n\r\n onChangeAspect.onChange = composeSync(isValueMissingObservable.call, onChangeAspect.onChange);\r\n updateDataAspect.updateData = composeSync(isValueMissingObservable.call, updateDataAspect.updateData);\r\n pluginData.validationApiPluginData = {validationApiObservable};\r\n\r\n var validationApi = ValidityApi(\r\n filterDom.filterInputElement, \r\n isValueMissingObservable, \r\n valueMissingMessage,\r\n (isValid)=>validationApiObservable.setValue(isValid),\r\n triggerAspect.trigger\r\n );\r\n\r\n return {\r\n buildApi(api){\r\n api.validationApi = validationApi;\r\n },\r\n dispose(){\r\n isValueMissingObservable.detachAll(); \r\n validationApiObservable.detachAll();\r\n }\r\n }\r\n}\r\n\r\nValidationApiPlugin.plugDefaultConfig = (defaults)=>{\r\n defaults.getValueRequired = function(){\r\n return false;\r\n }\r\n defaults.valueMissingMessage = '';\r\n}","import {closestByClassName, siblingsAsArray} from '../ToolsDom';\r\nimport {addStyling} from '../ToolsStyling'\r\nimport {ObservableLambda, composeSync} from '../ToolsJs';\r\n\r\nexport function BsAppearancePlugin(pluginData){\r\n let {configuration, validationApiPluginData, \r\n picksDom, staticDom, labelPluginData, appearanceAspect, componentPropertiesAspect, floatingLabelAspect} = pluginData;\r\n let {getValidity, getSize, useCssPatch, css, composeGetSize, getDefaultLabel} = configuration;\r\n let selectElement = staticDom.selectElement;\r\n \r\n let initialElement = staticDom.initialElement;\r\n\r\n let isFloatingLabel = false;\r\n if (floatingLabelAspect){\r\n isFloatingLabel = closestByClassName(initialElement, 'form-floating');\r\n floatingLabelAspect.isFloatingLabel = () => isFloatingLabel\r\n }\r\n\r\n if (labelPluginData){\r\n let origGetLabelElementAspect = labelPluginData.getLabelElementAspect;\r\n labelPluginData.getLabelElementAspect = () => {\r\n var e = origGetLabelElementAspect();\r\n if (e)\r\n return e;\r\n else{\r\n if (selectElement){\r\n let labelElement = getDefaultLabel(selectElement);\r\n return labelElement;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (staticDom.selectElement) {\r\n if(!getValidity)\r\n getValidity = composeGetValidity(selectElement)\r\n if(!getSize) \r\n getSize = composeGetSize(selectElement)\r\n } else {\r\n if (!getValidity)\r\n getValidity = () => null\r\n if (!getSize)\r\n getSize = () => null\r\n }\r\n\r\n componentPropertiesAspect.getSize=getSize;\r\n componentPropertiesAspect.getValidity=getValidity;\r\n\r\n var updateSize;\r\n if (!useCssPatch){\r\n updateSize= () => updateSizeForAdapter(picksDom.picksElement, getSize)\r\n }\r\n else{\r\n let {picks_lg, picks_sm, picks_def, picks_floating_def} = css;\r\n if (isFloatingLabel)\r\n picks_lg = picks_sm = picks_def = picks_floating_def;\r\n updateSize = () => updateSizeJsForAdapter(picksDom.picksElement, picks_lg, picks_sm, picks_def, getSize);\r\n }\r\n\r\n if (useCssPatch){\r\n var origToggleFocusStyling = picksDom.toggleFocusStyling;\r\n picksDom.toggleFocusStyling = () => {\r\n var validity = validationObservable.getValue();\r\n var isFocusIn = picksDom.getIsFocusIn();\r\n origToggleFocusStyling(isFocusIn)\r\n if (isFocusIn){\r\n if (validity===false) { \r\n // but not toggle events (I know it will be done in future)\r\n picksDom.setIsFocusIn(isFocusIn);\r\n \r\n addStyling(picksDom.picksElement, css.picks_focus_invalid)\r\n } else if (validity===true) {\r\n // but not toggle events (I know it will be done in future)\r\n picksDom.setIsFocusIn(isFocusIn);\r\n \r\n addStyling(picksDom.picksElement, css.picks_focus_valid) \r\n } \r\n }\r\n }\r\n }\r\n\r\n var getWasValidated = () => {\r\n var wasValidatedElement = closestByClassName(staticDom.initialElement, 'was-validated');\r\n return wasValidatedElement?true:false;\r\n }\r\n var wasUpdatedObservable = ObservableLambda(()=>getWasValidated());\r\n var getManualValidationObservable = ObservableLambda(()=>getValidity());\r\n let validationApiObservable = validationApiPluginData?.validationApiObservable;\r\n \r\n var validationObservable = ObservableLambda(\r\n () => wasUpdatedObservable.getValue()?validationApiObservable.getValue():getManualValidationObservable.getValue()\r\n )\r\n \r\n validationObservable.attach(\r\n (value)=>{\r\n var {validMessages, invalidMessages} = getMessagesElements(staticDom.containerElement);\r\n updateValidity( picksDom.picksElement, validMessages, invalidMessages, value);\r\n picksDom.toggleFocusStyling();\r\n }\r\n )\r\n wasUpdatedObservable.attach(\r\n ()=>validationObservable.call()\r\n )\r\n if (validationApiObservable)\r\n validationApiObservable.attach(\r\n ()=>validationObservable.call()\r\n )\r\n getManualValidationObservable.attach(\r\n ()=>validationObservable.call()\r\n )\r\n\r\n appearanceAspect.updateAppearance = composeSync(\r\n appearanceAspect.updateAppearance, \r\n updateSize, \r\n validationObservable.call, getManualValidationObservable.call);\r\n\r\n return {\r\n buildApi(api){\r\n api.updateSize = updateSize;\r\n api.updateValidity = ()=> getManualValidationObservable.call();\r\n api.updateWasValidated = ()=>wasUpdatedObservable.call();\r\n },\r\n dispose(){\r\n wasUpdatedObservable.detachAll();\r\n validationObservable.detachAll();\r\n getManualValidationObservable.detachAll();\r\n }\r\n }\r\n}\r\n\r\nfunction updateValidity(picksElement, validMessages, invalidMessages, validity){\r\n if (validity===false){\r\n picksElement.classList.add('is-invalid');\r\n picksElement.classList.remove('is-valid');\r\n invalidMessages.map(e=>e.style.display='block'); \r\n validMessages.map(e=>e.style.display='none'); \r\n }\r\n else if (validity===true){\r\n picksElement.classList.remove('is-invalid');\r\n picksElement.classList.add('is-valid');\r\n invalidMessages.map(e=>e.style.display='none'); \r\n validMessages.map(e=>e.style.display='block'); \r\n }else {\r\n picksElement.classList.remove('is-invalid');\r\n picksElement.classList.remove('is-valid');\r\n invalidMessages.map(e=>e.style.display=''); \r\n validMessages.map(e=>e.style.display=''); \r\n }\r\n}\r\n\r\nfunction updateSizeClasses(picksElement, size){\r\n if (size==\"lg\"){\r\n picksElement.classList.add('form-control-lg');\r\n picksElement.classList.remove('form-control-sm');\r\n }\r\n else if (size==\"sm\"){\r\n picksElement.classList.remove('form-control-lg');\r\n picksElement.classList.add('form-control-sm');\r\n }\r\n else{\r\n picksElement.classList.remove('form-control-lg');\r\n picksElement.classList.remove('form-control-sm');\r\n }\r\n}\r\n\r\nfunction updateSizeJsPicks(picksElement, picksLgStyling, picksSmStyling, picksDefStyling, size){\r\n if (size==\"lg\"){\r\n addStyling(picksElement, picksLgStyling);\r\n } else if (size==\"sm\"){\r\n addStyling(picksElement, picksSmStyling);\r\n } else {\r\n addStyling(picksElement, picksDefStyling);\r\n }\r\n}\r\n\r\nfunction updateSizeJs(picksElement, picksLgStyling, picksSmStyling, picksDefStyling, size){\r\n updateSizeClasses(picksElement, size);\r\n updateSizeJsPicks(picksElement, picksLgStyling, picksSmStyling, picksDefStyling, size)\r\n}\r\n\r\nfunction updateSizeForAdapter(picksElement, getSize){\r\n updateSizeClasses(picksElement, getSize())\r\n}\r\n\r\nfunction updateSizeJsForAdapter(picksElement, picksLgStyling, picksSmStyling, picksDefStyling, getSize){\r\n updateSizeJs(picksElement, picksLgStyling, picksSmStyling, picksDefStyling, getSize())\r\n}\r\n\r\nfunction getMessagesElements(containerElement){\r\n var siblings = siblingsAsArray(containerElement);\r\n var invalidMessages = siblings.filter(e=>e.classList.contains('invalid-feedback') || \r\n e.classList.contains('invalid-tooltip'));\r\n var validMessages = siblings.filter(e=>e.classList.contains('valid-feedback') || \r\n e.classList.contains('valid-tooltip'));\r\n return {validMessages, invalidMessages} \r\n} \r\n\r\nfunction composeGetValidity(selectElement){\r\n var getValidity = () => \r\n selectElement.classList.contains('is-invalid')?false:\r\n (selectElement.classList.contains('is-valid')?true:null);\r\n return getValidity;\r\n}\r\n\r\n\r\n\r\n","export function HiddenOptionPlugin(aspects){\r\n let {configuration, createWrapAspect, isChoiceSelectableAspect,\r\n wrapsCollection, buildChoiceAspect, buildAndAttachChoiceAspect,\r\n countableChoicesListInsertAspect, countableChoicesList} = aspects;\r\n\r\n countableChoicesListInsertAspect.countableChoicesListInsert = (wrap, key) => {\r\n if ( !wrap.isOptionHidden ){\r\n let choiceNext = wrapsCollection.getNext(key, c=>!c.isOptionHidden );\r\n countableChoicesList.add(wrap, choiceNext)\r\n }\r\n }\r\n\r\n let origBuildAndAttachChoice = buildAndAttachChoiceAspect.buildAndAttachChoice;\r\n buildAndAttachChoiceAspect.buildAndAttachChoice=(wrap, getNextElement)=>{\r\n if (wrap.isOptionHidden){ \r\n buildHiddenChoice(wrap);\r\n }\r\n else{ \r\n origBuildAndAttachChoice(wrap, getNextElement);\r\n }\r\n }\r\n\r\n var origIsSelectable = isChoiceSelectableAspect.isSelectable;\r\n isChoiceSelectableAspect.isSelectable = (wrap) => origIsSelectable(wrap) && !wrap.isOptionHidden;\r\n\r\n let {getIsOptionHidden, options} = configuration;\r\n if (options) {\r\n if (!getIsOptionHidden)\r\n getIsOptionHidden = (option) => (option.hidden===undefined)?false:option.hidden; \r\n } else {\r\n if (!getIsOptionHidden)\r\n getIsOptionHidden = (option) => {\r\n return option.hidden; \r\n } \r\n }\r\n \r\n var origCreateWrap = createWrapAspect.createWrap;\r\n createWrapAspect.createWrap = (option) => {\r\n let wrap = origCreateWrap(option);\r\n wrap.isOptionHidden = getIsOptionHidden(option);\r\n return wrap;\r\n };\r\n\r\n return {\r\n buildApi(api){ \r\n let getNextNonHidden = (key) => wrapsCollection.getNext(key, c => !c.isOptionHidden );\r\n\r\n api.updateOptionsHidden = () => \r\n wrapsCollection.forLoop( (wrap, key) => \r\n updateChoiceHidden(wrap, key, getNextNonHidden, countableChoicesList, getIsOptionHidden, buildChoiceAspect)\r\n );\r\n\r\n api.updateOptionHidden = (key) => \r\n updateChoiceHidden(wrapsCollection.get(key), key, getNextNonHidden, countableChoicesList, getIsOptionHidden, buildChoiceAspect);\r\n // TODO create updateHidden ? \r\n // it is too complex since we need to find the next non hidden, when this depends on key \r\n // there should be the backreference \"wrap -> index\" invited before\r\n // api.updateOptionHidden = (key) => wrapsCollection.get(key).updateHidden();\r\n }\r\n }\r\n}\r\n\r\nfunction buildHiddenChoice(wrap){\r\n wrap.updateSelected = () => void 0;\r\n \r\n wrap.choice.isChoiceElementAttached = false;\r\n wrap.choice.choiceElement = null;\r\n wrap.choice.choiceElementAttach = null;\r\n wrap.choice.setVisible = null; \r\n wrap.choice.setHoverIn = null;\r\n wrap.choice.remove = null; \r\n \r\n wrap.choice.dispose = () => { \r\n wrap.choice.dispose = null;\r\n };\r\n\r\n wrap.dispose = () => { \r\n wrap.choice.dispose();\r\n wrap.dispose = null;\r\n };\r\n}\r\n\r\nfunction updateChoiceHidden(wrap, key, getNextNonHidden, countableChoicesList, getIsOptionHidden, buildChoiceAspect){\r\n let newIsOptionHidden = getIsOptionHidden(wrap.option);\r\n if (newIsOptionHidden != wrap.isOptionHidden)\r\n {\r\n wrap.isOptionHidden= newIsOptionHidden;\r\n if (wrap.isOptionHidden) {\r\n\r\n countableChoicesList.remove(wrap);\r\n wrap.choice.remove(); \r\n buildHiddenChoice(wrap);\r\n } else {\r\n let nextChoice = getNextNonHidden(key);\r\n countableChoicesList.add(wrap, nextChoice);\r\n buildChoiceAspect.buildChoice(wrap);\r\n wrap.choice.choiceElementAttach(nextChoice?.choice.choiceElement);\r\n }\r\n }\r\n}\r\n","import {createCss, extendCss} from '../ToolsStyling';\r\nimport {isBoolean} from '../ToolsJs';\r\n\r\nexport function CssPatchPlugin(){\r\n}\r\n\r\nCssPatchPlugin.plugMergeSettings = (configuration, defaults, settings) => {\r\n let cssPatch = settings?.cssPatch;\r\n if (isBoolean(cssPatch))\r\n throw new Error(\"BsMultiSelect: 'cssPatch' was used instead of 'useCssPatch'\") // often type of error\r\n configuration.cssPatch = createCss(defaults.cssPatch, cssPatch); // replace classes, merge styles\r\n}\r\n\r\nCssPatchPlugin.plugStaticDom = (configurationPluginData) => {\r\n let {configuration} = configurationPluginData;\r\n if (configuration.useCssPatch)\r\n extendCss(configuration.css, configuration.cssPatch); \r\n}","import {composeSync} from '../ToolsJs';\r\nimport {getDataGuardedWithPrefix} from '../ToolsDom';\r\nimport {toggleStyling} from '../ToolsStyling';\r\nimport {ResetableFlag} from '../ToolsDom'\r\n\r\nexport function PlaceholderPlugin(aspects){\r\n let {configuration, staticManager, picksList, picksDom, filterDom, staticDom, updateDataAspect,\r\n resetFilterListAspect, filterManagerAspect, environment} = aspects;\r\n let isIE11 = environment.isIE11;\r\n let {placeholder, css} = configuration;\r\n let {picksElement} = picksDom;\r\n let filterInputElement = filterDom.filterInputElement;\r\n\r\n function setPlaceholder(placeholder){\r\n filterInputElement.placeholder = placeholder;\r\n }\r\n if (isIE11){\r\n var ignoreNextInputResetableFlag = ResetableFlag(); \r\n let placeholderStopInputAspect = PlaceholderStopInputAspect(ignoreNextInputResetableFlag);\r\n var setPlaceholderOrig = setPlaceholder;\r\n setPlaceholder = function(placeholder){\r\n ignoreNextInputResetableFlag.set();\r\n setPlaceholderOrig(placeholder);\r\n }\r\n \r\n aspects.placeholderStopInputAspect=placeholderStopInputAspect;\r\n }\r\n\r\n if (!placeholder){\r\n placeholder = getDataGuardedWithPrefix(staticDom.initialElement,\"bsmultiselect\",\"placeholder\");\r\n }\r\n\r\n function setEmptyInputWidth(isVisible){\r\n if(isVisible)\r\n filterInputElement.style.width ='100%';\r\n else \r\n filterInputElement.style.width ='2ch';\r\n }\r\n var emptyToggleStyling = toggleStyling(filterInputElement, css.filterInput_empty);\r\n function showPlacehodler(isVisible){\r\n if (isVisible)\r\n {\r\n setPlaceholder(placeholder?placeholder:'');\r\n picksElement.style.display = 'block';\r\n }\r\n else\r\n {\r\n setPlaceholder('');\r\n picksElement.style.display = 'flex';\r\n }\r\n emptyToggleStyling(isVisible);\r\n setEmptyInputWidth(isVisible);\r\n }\r\n showPlacehodler(true);\r\n \r\n function setDisabled(isComponentDisabled){ \r\n filterInputElement.disabled = isComponentDisabled;\r\n };\r\n let isEmpty = () => picksList.isEmpty() && filterDom.isEmpty()\r\n\r\n function updatePlacehodlerVisibility(){\r\n showPlacehodler(isEmpty());\r\n };\r\n function updateEmptyInputWidth(){\r\n setEmptyInputWidth(isEmpty())\r\n };\r\n \r\n let origDisable = picksDom.disable;\r\n picksDom.disable = (isComponentDisabled)=>{\r\n setDisabled(isComponentDisabled);\r\n origDisable(isComponentDisabled);\r\n };\r\n\r\n staticManager.appendToContainer = composeSync(staticManager.appendToContainer, updateEmptyInputWidth);\r\n\r\n filterManagerAspect.processEmptyInput = composeSync(updateEmptyInputWidth, filterManagerAspect.processEmptyInput);\r\n resetFilterListAspect.forceResetFilter = composeSync(resetFilterListAspect.forceResetFilter, updatePlacehodlerVisibility);\r\n \r\n let origAdd = picksList.add;\r\n picksList.add = (pick) => { \r\n let returnValue = origAdd(pick);\r\n if (picksList.getCount()==1 ){ // make flex\r\n if (filterDom.isEmpty()){\r\n setPlaceholder('');\r\n picksElement.style.display = 'flex';\r\n emptyToggleStyling(false);\r\n filterInputElement.style.width ='2ch';\r\n } else {\r\n picksElement.style.display = 'flex';\r\n }\r\n }\r\n pick.dispose = composeSync(pick.dispose, function()\r\n { \r\n if (isEmpty()) {\r\n showPlacehodler(true);\r\n }\r\n });\r\n return returnValue;\r\n };\r\n\r\n updateDataAspect.updateData = composeSync(updateDataAspect.updateData, updatePlacehodlerVisibility);\r\n \r\n}\r\n\r\n// ie11 support\r\nfunction PlaceholderStopInputAspect(resetableFlag){\r\n return{\r\n get(){\r\n return resetableFlag.get();\r\n },\r\n reset(){\r\n return resetableFlag.reset();\r\n } \r\n }\r\n}","import {EventBinder} from '../ToolsDom';\r\nimport {addStyling, toggleStyling} from '../ToolsStyling';\r\n\r\nexport function JQueryMethodsPlugin(pluginData){\r\n let {staticDom, choicesDom, filterDom, picksList} = pluginData;\r\n return {\r\n buildApi(api){\r\n api.getContainer = () => staticDom.containerElement;\r\n api.getChoices = () => choicesDom.choicesElement;\r\n api.getChoicesList = () => choicesDom.choicesListElement;\r\n api.getFilterInput = () => filterDom.filterInputElement;\r\n api.getPicks = () => picksDom.picksElement;\r\n \r\n api.picksCount = () => picksList.getCount();\r\n\r\n pluginData.jQueryMethodsPluginData = {EventBinder, addStyling, toggleStyling}\r\n }\r\n }\r\n}","export function OptionsApiPlugin(pluginData){\r\n let {buildAndAttachChoiceAspect, wraps, wrapsCollection, createWrapAspect, createChoiceBaseAspect,\r\n optionsAspect, resetLayoutAspect} = pluginData;\r\n return {\r\n buildApi(api){\r\n\r\n api.updateOptionAdded = (key) => { // TODO: generalize index as key \r\n let options = optionsAspect.getOptions();\r\n let option = options[key];\r\n \r\n let wrap = createWrapAspect.createWrap(option);\r\n wrap.choice= createChoiceBaseAspect.createChoiceBase(option);\r\n wraps.insert(key, wrap);\r\n let nextChoice = ()=> wrapsCollection.getNext(key, c => c.choice.choiceElement);\r\n\r\n buildAndAttachChoiceAspect.buildAndAttachChoice(\r\n wrap,\r\n () => nextChoice()?.choice.choiceElement\r\n )\r\n }\r\n \r\n api.updateOptionRemoved = (key) => { // TODO: generalize index as key \r\n resetLayoutAspect.resetLayout(); // always hide 1st, then reset filter\r\n \r\n var wrap = wraps.remove(key);\r\n wrap.choice.remove?.();\r\n wrap.dispose?.();\r\n }\r\n }\r\n }\r\n}","export function FormRestoreOnBackwardPlugin(pluginData){\r\n let {staticDom, environment, loadAspect, configuration} = pluginData;\r\n let window = environment.window;\r\n return {\r\n buildApi(api){\r\n if (!api.updateOptionsSelected){\r\n if (options && configuration.setSelected)\r\n throw new Error(\"BsMultisilect: FormRestoreOnBackwardPlugin requires SelectedOptionPlugin defined first\");\r\n }\r\n else{\r\n let origLoadAspectLoad = loadAspect.load;\r\n loadAspect.load = ()=>{\r\n origLoadAspectLoad();\r\n // support browser's \"step backward\" and form's values restore\r\n if (staticDom.selectElement && window.document.readyState !=\"complete\"){\r\n window.setTimeout(function(){\r\n //TODO : from do not use api, migrate to aspects\r\n //console.log(\"FormRestoreOnBackwardPlugin\");\r\n api.updateOptionsSelected();\r\n // there are no need to add more updates as api.updateWasValidated() because backward never trigger .was-validate\r\n // also backward never set the state to invalid\r\n });\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}","import {closestByTagName, findDirectChildByTagName, closestByClassName} from '../ToolsDom';\r\nimport {composeSync} from '../ToolsJs';\r\n\r\nexport function SelectElementPlugin(aspects){\r\n var {/*optionsLoopAspect,*/ loadAspect, environment} = aspects;\r\n // var origOptionsLoopAspectLoop = optionsLoopAspect.loop;\r\n // var document = environment.window.document;\r\n\r\n // optionsLoopAspect.loop = function(){\r\n // // browsers can change select value as part of \"autocomplete\" (IE11) \r\n // // or \"show preserved on go back\" (Chrome) after page is loaded but before \"ready\" event;\r\n // // but they never \"restore\" selected-disabled options.\r\n // // TODO: make the FROM Validation for 'selected-disabled' easy.\r\n // if (document.readyState != 'loading'){\r\n // origOptionsLoopAspectLoop();\r\n // }else{\r\n // var domContentLoadedHandler = function(){\r\n // origOptionsLoopAspectLoop();\r\n // document.removeEventListener(\"DOMContentLoaded\", domContentLoadedHandler);\r\n // }\r\n // document.addEventListener('DOMContentLoaded', domContentLoadedHandler); // IE9+\r\n // }\r\n // }\r\n\r\n var origLoadAspectLoop = loadAspect.loop;\r\n var document = environment.window.document;\r\n\r\n loadAspect.loop = function(){\r\n // browsers can change select value as part of \"autocomplete\" (IE11) \r\n // or \"show preserved on go back\" (Chrome) after page is loaded but before \"ready\" event;\r\n // but they never \"restore\" selected-disabled options.\r\n // TODO: make the FROM Validation for 'selected-disabled' easy.\r\n if (document.readyState != 'loading'){\r\n origLoadAspectLoop();\r\n }else{\r\n var domContentLoadedHandler = function(){\r\n origLoadAspectLoop();\r\n document.removeEventListener(\"DOMContentLoaded\", domContentLoadedHandler);\r\n }\r\n document.addEventListener('DOMContentLoaded', domContentLoadedHandler); // IE9+\r\n }\r\n }\r\n}\r\n\r\nSelectElementPlugin.plugStaticDom = (aspects)=>{\r\n let {configuration, staticDomFactory, createElementAspect,\r\n componentPropertiesAspect, onChangeAspect, triggerAspect, optionsAspect, optGroupAspect, disposeAspect} = aspects;\r\n let origStaticDomFactoryCreate = staticDomFactory.create;\r\n staticDomFactory.create = (css) => {\r\n let {choicesDom, createStaticDom: origCreateStaticDom} = origStaticDomFactoryCreate(css);\r\n let {choicesElement} = choicesDom;\r\n return { \r\n choicesDom,\r\n createStaticDom(element, containerClass){\r\n let selectElement = null;\r\n let containerElement = null;\r\n let picksElement = null;\r\n if (element.tagName == 'SELECT') {\r\n selectElement = element;\r\n if (containerClass){\r\n containerElement = closestByClassName(selectElement, containerClass)\r\n if (containerElement)\r\n picksElement = findDirectChildByTagName(containerElement, 'UL');\r\n }\r\n } else if (element.tagName == 'DIV') {\r\n selectElement = findDirectChildByTagName(element, 'SELECT');\r\n if (selectElement) {\r\n if (containerClass){\r\n containerElement = closestByClassName(element, containerClass);\r\n if (containerElement)\r\n picksElement = findDirectChildByTagName(containerElement, 'UL');\r\n }\r\n } else {\r\n return origCreateStaticDom(element, containerClass);\r\n } \r\n }\r\n\r\n let disposableContainerElement = false;\r\n if (!containerElement) {\r\n containerElement = createElementAspect.createElement('DIV');\r\n containerElement.classList.add(containerClass);\r\n disposableContainerElement= true;\r\n }\r\n \r\n let disposablePicksElement = false;\r\n if (!picksElement) {\r\n picksElement = createElementAspect.createElement('UL');\r\n disposablePicksElement = true; \r\n }\r\n \r\n if (selectElement){\r\n var backupDisplay = selectElement.style.display;\r\n selectElement.style.display = 'none';\r\n var backupedRequired = selectElement.required;\r\n\r\n configuration.getValueRequired = function(){\r\n return backupedRequired;\r\n }\r\n\r\n if(selectElement.required===true)\r\n selectElement.required = false;\r\n\r\n let {getDisabled} = configuration;\r\n\r\n if(!getDisabled) {\r\n var fieldsetElement = closestByTagName(selectElement, 'FIELDSET');\r\n if (fieldsetElement) {\r\n componentPropertiesAspect.getDisabled = () => selectElement.disabled || fieldsetElement.disabled;\r\n } else {\r\n componentPropertiesAspect.getDisabled = () => selectElement.disabled;\r\n }\r\n }\r\n onChangeAspect.onChange = composeSync(() => triggerAspect.trigger('change'), onChangeAspect.onChange) \r\n optionsAspect.getOptions = () => selectElement.options;\r\n \r\n if (optGroupAspect){\r\n optGroupAspect.getOptionOptGroup = (option) => option.parentNode;\r\n optGroupAspect.getOptGroupText = (optGroup) => optGroup.label;\r\n optGroupAspect.getOptGroupId = (optGroup) => optGroup.id;\r\n }\r\n\r\n // if (!setSelected){\r\n // setSelected = (option, value) => {option.selected = value};\r\n // // NOTE: adding this (setAttribute) break Chrome's html form reset functionality:\r\n // // if (value) option.setAttribute('selected','');\r\n // // else option.removeAttribute('selected');\r\n // }\r\n \r\n disposeAspect.dispose = composeSync(disposeAspect.dispose, () => {\r\n selectElement.required = backupedRequired;\r\n selectElement.style.display = backupDisplay;\r\n });\r\n }\r\n\r\n return {\r\n staticDom:{\r\n initialElement:element,\r\n containerElement,\r\n picksElement,\r\n disposablePicksElement,\r\n selectElement\r\n }, \r\n staticManager:{\r\n appendToContainer(){ \r\n if (disposableContainerElement){\r\n selectElement.parentNode.insertBefore(containerElement, selectElement.nextSibling) \r\n containerElement.appendChild(choicesElement)\r\n }else {\r\n selectElement.parentNode.insertBefore(choicesElement, selectElement.nextSibling)\r\n }\r\n if (disposablePicksElement)\r\n containerElement.appendChild(picksElement)\r\n },\r\n dispose(){ \r\n choicesElement.parentNode.removeChild(choicesElement);\r\n if (disposableContainerElement)\r\n selectElement.parentNode.removeChild(containerElement) \r\n if (disposablePicksElement)\r\n containerElement.removeChild(picksElement)\r\n }\r\n }\r\n };\r\n }\r\n }\r\n }\r\n}","import {composeSync} from '../ToolsJs';\r\n\r\n// TODO: there should be two new \"independent aspects\" AddPickAspect and RemovePickAspect \r\n// plugin should overdrive them : call setWrapSelected and etc\r\n// therefore there should new component API methods\r\n// addOptionPick(key) -> call addPick(pick) which returns removePick() \r\n// SetOptionSelectedAspect, OptionToggleAspect should be moved there \r\n// OptionToggleAspect overrided in DisabledOptionPlugin\r\n\r\n// wrap.isOptionSelected , wrap.updateSelected\r\nexport function SelectedOptionPlugin(aspects){\r\n let {configuration, wrapsCollection, \r\n createWrapAspect, buildChoiceAspect, removePickAspect,\r\n resetLayoutAspect, picksList, isChoiceSelectableAspect, optionToggleAspect,\r\n /*inputAspect, filterDom, filterManagerAspect,*/ createPickHandlersAspect, addPickAspect, fullMatchAspect, \r\n onChangeAspect, filterPredicateAspect\r\n } = aspects;\r\n let {getSelected : getIsOptionSelected, setSelected : setIsOptionSelected, options} = configuration;\r\n \r\n if (options) {\r\n if (!setIsOptionSelected){\r\n setIsOptionSelected = (option, value) => {option.selected = value};\r\n }\r\n if (!getIsOptionSelected)\r\n getIsOptionSelected = (option) => option.selected; \r\n } else { // selectElement\r\n if (!getIsOptionSelected){\r\n getIsOptionSelected = (option) => option.selected;\r\n }\r\n if (!setIsOptionSelected){\r\n setIsOptionSelected = (option, value) => {option.selected = value};\r\n // NOTE: adding this (setAttribute) break Chrome's html form reset functionality:\r\n // if (value) option.setAttribute('selected','');\r\n // else option.removeAttribute('selected');\r\n }\r\n }\r\n\r\n let origFilterPredicate = filterPredicateAspect.filterPredicate;\r\n filterPredicateAspect.filterPredicate = (wrap, text) =>\r\n !wrap.isOptionSelected && origFilterPredicate(wrap, text)\r\n\r\n\r\n let origBuildChoice = buildChoiceAspect.buildChoice;\r\n buildChoiceAspect.buildChoice= (wrap) => {\r\n origBuildChoice(wrap);\r\n wrap.updateSelected = () => {\r\n wrap.choice.choiceDomManagerHandlers.updateSelected();\r\n onChangeAspect.onChange();\r\n }\r\n wrap.dispose = composeSync( ()=>{wrap.updateSelected = null}, wrap.dispose)\r\n }\r\n\r\n // TODO: test this instead of wrap.updateSelected\r\n // function updateSelected(wrap){\r\n // if (wrap.pick){\r\n // if (wrap.isOptionSelected)\r\n // pickHandlers.producePick();\r\n // else {\r\n // pickHandlers.removeAndDispose();\r\n // pickHandlers.removeAndDispose=null;\r\n // }\r\n // }\r\n // wrap.choice.choiceDomManagerHandlers.updateSelected();\r\n // onChangeAspect.onChange();\r\n // }\r\n\r\n\r\n function composeUpdateSelected(wrap, booleanValue){\r\n return () => {\r\n wrap.isOptionSelected = booleanValue;\r\n wrap.updateSelected();\r\n }\r\n }\r\n\r\n function trySetWrapSelected(option, updateSelected, booleanValue){ // wrap.option\r\n let success = false;\r\n var confirmed = setIsOptionSelected(option, booleanValue); \r\n if (!(confirmed===false)) {\r\n updateSelected(); \r\n success = true;\r\n }\r\n return success;\r\n }\r\n\r\n let origCreateWrap = createWrapAspect.createWrap;\r\n createWrapAspect.createWrap = (option)=>{\r\n let wrap = origCreateWrap(option);\r\n wrap.isOptionSelected = getIsOptionSelected(option);\r\n wrap.updateSelected = null; // can it be combined ?\r\n return wrap;\r\n }\r\n \r\n\r\n let origToggle = optionToggleAspect.toggle; // TODO: improve design, no replace\r\n optionToggleAspect.toggle= (wrap) => {\r\n return trySetWrapSelected(wrap.option, composeUpdateSelected(wrap, !wrap.isOptionSelected), !wrap.isOptionSelected)\r\n }\r\n \r\n let origFullMatch = fullMatchAspect.fullMatch;\r\n fullMatchAspect.fullMatch = (wrap) => {\r\n return trySetWrapSelected(wrap.option, composeUpdateSelected(wrap, true), true);\r\n }\r\n\r\n let removePickOrig = removePickAspect.removePick; // TODO: improve design, no replace\r\n removePickAspect.removePick = (wrap, pick) => { // TODO: try remove pick\r\n return trySetWrapSelected(wrap.option, composeUpdateSelected(wrap, false), false);\r\n }\r\n\r\n \r\n let origCreatePickHandlers = createPickHandlersAspect.createPickHandlers;\r\n createPickHandlersAspect.createPickHandlers = (wrap)=>{\r\n let pickHandlers = origCreatePickHandlers(wrap);\r\n wrap.updateSelected = composeSync(\r\n ()=>{\r\n if (wrap.isOptionSelected){\r\n let pick = pickHandlers.producePick();\r\n wrap.pick = pick;\r\n pick.dispose = composeSync(pick.dispose, ()=>{wrap.pick=null;});\r\n }\r\n else {\r\n pickHandlers.removeAndDispose();\r\n pickHandlers.removeAndDispose=null;\r\n }\r\n },\r\n wrap.updateSelected\r\n )\r\n\r\n addPickAspect.addPick(wrap, pickHandlers); \r\n return pickHandlers;\r\n }\r\n\r\n let origAddPick = addPickAspect.addPick;\r\n addPickAspect.addPick = (wrap, pickHandlers) => {\r\n if (wrap.isOptionSelected){\r\n let pick = origAddPick(wrap, pickHandlers);\r\n wrap.pick = pick;\r\n pick.dispose = composeSync(pick.dispose, ()=>{wrap.pick=null;});\r\n return pick;\r\n }\r\n }\r\n\r\n return {\r\n buildApi(api){\r\n api.selectAll= ()=>{\r\n resetLayoutAspect.resetLayout(); // always hide 1st\r\n wrapsCollection.forLoop(\r\n wrap => {\r\n if (isChoiceSelectableAspect.isSelectable(wrap) && !wrap.isOptionSelected)\r\n trySetWrapSelected(wrap.option, composeUpdateSelected(wrap, true), true)\r\n }\r\n ); \r\n }\r\n \r\n api.deselectAll= ()=>{\r\n resetLayoutAspect.resetLayout(); // always hide 1st\r\n picksList.forEach(pick=>pick.setSelectedFalse())\r\n }\r\n\r\n api.setOptionSelected = (key, value) => {\r\n let wrap = wrapsCollection.get(key);\r\n return trySetWrapSelected(wrap.option, composeUpdateSelected(wrap, value), value);\r\n }\r\n\r\n // used in FormRestoreOnBackwardPlugin\r\n api.updateOptionsSelected = () => wrapsCollection.forLoop( wrap => updateChoiceSelected(wrap, getIsOptionSelected))\r\n api.updateOptionSelected = (key) => updateChoiceSelected(wrapsCollection.get(key), getIsOptionSelected)\r\n }\r\n }\r\n}\r\n\r\nfunction updateChoiceSelected(wrap, getIsOptionSelected){\r\n let newIsSelected = getIsOptionSelected(wrap.option);\r\n if (newIsSelected != wrap.isOptionSelected)\r\n {\r\n wrap.isOptionSelected = newIsSelected;\r\n wrap.updateSelected?.(); // some hidden oesn't have element (and need to be updated)\r\n }\r\n}","import {composeSync} from '../ToolsJs';\r\n\r\nexport function DisabledOptionPlugin(pluginData){\r\n let {configuration, isChoiceSelectableAspect, createWrapAspect, buildChoiceAspect,\r\n filterPredicateAspect, wrapsCollection, optionToggleAspect, buildPickAspect } = pluginData;\r\n \r\n let {getIsOptionDisabled, options} = configuration;\r\n if (options) {\r\n if (!getIsOptionDisabled)\r\n getIsOptionDisabled = (option) => (option.disabled===undefined) ? false : option.disabled; \r\n } else { // selectElement\r\n if (!getIsOptionDisabled)\r\n getIsOptionDisabled = (option) => option.disabled; \r\n }\r\n\r\n // TODO check this instead of wrap.updateDisabled\r\n // function updateDisabled(wrap){\r\n // wrap?.choice?.choiceDomManagerHandlers?.updateDisabled?.();\r\n // wrap?.pick?.pickDomManagerHandlers?.updateDisabled?.();\r\n // }\r\n\r\n let origCreateWrap = createWrapAspect.createWrap;\r\n createWrapAspect.createWrap = (option) => {\r\n let wrap = origCreateWrap(option);\r\n wrap.isOptionDisabled = getIsOptionDisabled(option); // TODO: remove usage wrap.isOptionDisabled\r\n wrap.updateDisabled = null; \r\n return wrap;\r\n };\r\n\r\n let origToggle = optionToggleAspect.toggle;\r\n optionToggleAspect.toggle = (wrap) => {\r\n let success = false;\r\n if (wrap.isOptionSelected!==undefined){\r\n if (wrap.isOptionSelected || !wrap.isOptionDisabled) // TODO: declare dependency on SelectedOptionPlugin\r\n success = origToggle(wrap);\r\n }\r\n else{\r\n if (!wrap.isOptionDisabled) {\r\n success = origToggle(wrap);\r\n }\r\n }\r\n return success;\r\n };\r\n\r\n let origIsSelectable = isChoiceSelectableAspect.isSelectable\r\n isChoiceSelectableAspect.isSelectable = (wrap) => {\r\n return origIsSelectable(wrap) && !wrap.isOptionDisabled ;\r\n };\r\n\r\n let origFilterPredicate = filterPredicateAspect.filterPredicate;\r\n filterPredicateAspect.filterPredicate = (wrap, text) => {\r\n return !wrap.isOptionDisabled && origFilterPredicate(wrap, text) ;\r\n };\r\n\r\n let origBuildChoice = buildChoiceAspect.buildChoice;\r\n buildChoiceAspect.buildChoice = (wrap) => {\r\n origBuildChoice(wrap);\r\n wrap.updateDisabled = wrap.choice.choiceDomManagerHandlers.updateDisabled\r\n wrap.choice.dispose = composeSync(()=>{wrap.updateDisabled=null;}, wrap.choice.dispose);\r\n }\r\n \r\n let origBuildPick = buildPickAspect.buildPick;\r\n buildPickAspect.buildPick = (wrap, removeOnButton) => {\r\n let pick = origBuildPick(wrap, removeOnButton);\r\n \r\n pick.updateDisabled = () => pick.pickDomManagerHandlers.updateDisabled();\r\n pick.dispose = composeSync(pick.dispose, ()=>{pick.updateDisabled=null});\r\n\r\n let choiceUpdateDisabledBackup = wrap.updateDisabled;\r\n wrap.updateDisabled = composeSync(choiceUpdateDisabledBackup, pick.updateDisabled); // add pickDisabled\r\n pick.dispose = composeSync(pick.dispose, \r\n ()=>{\r\n wrap.updateDisabled = choiceUpdateDisabledBackup; // remove pickDisabled\r\n wrap.updateDisabled(); // make \"true disabled\" without it checkbox only looks disabled\r\n }\r\n )\r\n return pick;\r\n }\r\n\r\n return {\r\n buildApi(api){\r\n api.updateOptionsDisabled = () => wrapsCollection.forLoop( wrap => updateChoiceDisabled(wrap, getIsOptionDisabled))\r\n api.updateOptionDisabled = (key) => updateChoiceDisabled(wrapsCollection.get(key), getIsOptionDisabled)\r\n }\r\n };\r\n}\r\n\r\nfunction updateChoiceDisabled(wrap, getIsOptionDisabled){\r\n let newIsDisabled = getIsOptionDisabled(wrap.option);\r\n if (newIsDisabled != wrap.isOptionDisabled)\r\n {\r\n wrap.isOptionDisabled= newIsDisabled;\r\n wrap.updateDisabled?.(); // some hidden oesn't have element (and need to be updated)\r\n }\r\n}","export function PicksApiPlugin(pluginData){\r\n let {picksList, createWrapAspect, createPickHandlersAspect, addPickAspect} = pluginData;\r\n return {\r\n buildApi(api){\r\n api.forEachPeak = (f) => \r\n picksList.forEach(wrap=>f(wrap.option));\r\n // TODO: getHeadPeak\r\n api.getTailPeak = () => picksList.getTail()?.option;\r\n api.countPeaks = () => picksList.getCount();\r\n api.isEmptyPeaks = () => picksList.isEmpty();\r\n \r\n api.addPick = (option) => {\r\n let wrap = createWrapAspect.createWrap(option);\r\n // TODO should be moved to specific plugins\r\n wrap.updateDisabled = ()=>{};\r\n wrap.updateHidden = ()=>{};\r\n let pickHandlers = createPickHandlersAspect.createPickHandlers(wrap);\r\n addPickAspect.addPick(wrap, pickHandlers);\r\n }\r\n }\r\n }\r\n}","import {composeSync} from '../ToolsJs';\r\n\r\nexport function PicksPlugin(aspects){\r\n let {configuration, inputAspect, filterDom, filterManagerAspect} = aspects;\r\n let {picks, addOptionPicked} = configuration;\r\n /*\r\n if (!addOptionPicked){\r\n addOptionPicked = (option, index, value) => {\r\n if (value)\r\n picks.push(option);\r\n else\r\n picks.splice(index, 1);\r\n return true;\r\n };\r\n }\r\n\r\n function trySetWrapSelected(option, updateSelected, booleanValue){\r\n let success = false;\r\n var confirmed = setIsOptionSelected(option, booleanValue);\r\n if (!(confirmed===false)) {\r\n updateSelected();\r\n success = true;\r\n }\r\n return success;\r\n }\r\n\r\n let origProcessInput = inputAspect.processInput;\r\n inputAspect.processInput = () => {\r\n let origResult = origProcessInput();\r\n if (!origResult.isEmpty)\r\n {\r\n if ( filterManagerAspect.getNavigateManager().getCount() == 1)\r\n {\r\n // todo: move exact match to filterManager\r\n let fullMatchWrap = filterManagerAspect.getNavigateManager().getHead();\r\n let text = filterManagerAspect.getFilter();\r\n if (fullMatchWrap.choice.searchText == text)\r\n {\r\n let success = trySetWrapSelected(fullMatchWrap, true);\r\n if (success) {\r\n filterDom.setEmpty();\r\n origResult.isEmpty = true;\r\n }\r\n }\r\n }\r\n }\r\n return origResult;\r\n }*/\r\n}\r\n\r\nPicksPlugin.plugStaticDom = (aspects) => {\r\n let {configuration, picksList} = aspects;\r\n let {picks} = configuration;\r\n if (picks) {\r\n let {add: origAdd, reset: origReset} = picksList;\r\n\r\n picksList.add = (e) => {\r\n let {remove, index} = origAdd(e);\r\n picks.push(e);\r\n return { remove: composeSync(remove, () => void picks.splice(index(), 1)), index};\r\n }\r\n\r\n picksList.reset = () => {\r\n origReset();\r\n picks.length = 0;\r\n }\r\n }\r\n}","export function CreatePopperPlugin(pluginData){\r\n let {environment} = pluginData;\r\n let {createPopper, Popper} = environment;\r\n\r\n if (typeof createPopper === 'undefined') {\r\n createPopper = Popper;\r\n if (typeof createPopper === 'undefined') {\r\n throw new Error(\"BsMultiSelect: Popper component (https://popper.js.org) is required\")\r\n }\r\n } else {\r\n if (createPopper.createPopper) {\r\n createPopper = createPopper.createPopper;\r\n }\r\n }\r\n\r\n pluginData.createPopperAspect = {\r\n create(element, anchorElement, preventOverflow){\r\n let popperConfiguration = {\r\n placement: 'bottom-start',\r\n modifiers: {\r\n preventOverflow: {enabled:preventOverflow},\r\n hide: {enabled:false},\r\n flip: {enabled:false}\r\n }\r\n };\r\n let popper = null;\r\n return {\r\n init(){\r\n if (!!createPopper.prototype && !!createPopper.prototype.constructor) { // it is a constructor\r\n popper = new createPopper(anchorElement, element, popperConfiguration); \r\n }else{\r\n popper = createPopper(anchorElement, element, popperConfiguration); \r\n }\r\n },\r\n update(){ \r\n popper.update(); // become async in poppoer 2; use forceUpdate if sync is needed? \r\n },\r\n setRtl(isRtl){\r\n if (isRtl) {\r\n popperConfiguration.placement = 'bottom-end';\r\n }\r\n },\r\n dispose(){\r\n popper.destroy();\r\n }\r\n }\r\n }\r\n };\r\n}\r\n\r\n","import {composeSync} from '../ToolsJs';\r\nimport {toggleStyling} from '../ToolsStyling';\r\n\r\nexport function FloatingLabelPlugin(pluginData){\r\n let {configuration, picksList, picksDom, filterDom, staticDom, updateDataAspect,\r\n resetFilterListAspect, floatingLabelAspect} = pluginData;\r\n let {css, getDefaultLabel} = configuration;\r\n \r\n let initialElement = staticDom.initialElement;\r\n if (floatingLabelAspect.isFloatingLabel() ){\r\n \r\n let labelElement = getDefaultLabel(initialElement);\r\n let picksElement = picksDom.picksElement;\r\n\r\n var liftToggleStyling1 = toggleStyling(labelElement, css.label_floating_lifted);\r\n var liftToggleStyling2 = toggleStyling(picksElement, css.picks_floating_lifted);\r\n\r\n function liftedLabel(isEmpty){\r\n liftToggleStyling1(isEmpty);\r\n liftToggleStyling2(isEmpty);\r\n }\r\n\r\n let isEmpty = () => picksList.isEmpty() && filterDom.isEmpty() && !picksDom.getIsFocusIn();;\r\n\r\n function updateLiftedLabel(){\r\n liftedLabel(!isEmpty());\r\n };\r\n\r\n updateLiftedLabel();\r\n\r\n resetFilterListAspect.forceResetFilter = composeSync(resetFilterListAspect.forceResetFilter, updateLiftedLabel);\r\n \r\n let origAdd = picksList.add;\r\n picksList.add = (pick) => { \r\n let returnValue = origAdd(pick);\r\n if (picksList.getCount()==1) \r\n updateLiftedLabel()\r\n pick.dispose = composeSync(pick.dispose, ()=>\r\n { \r\n if (picksList.getCount()==0) \r\n updateLiftedLabel()\r\n })\r\n return returnValue;\r\n };\r\n \r\n var origToggleFocusStyling = picksDom.toggleFocusStyling;\r\n picksDom.toggleFocusStyling = () => {\r\n var isFocusIn = picksDom.getIsFocusIn();\r\n origToggleFocusStyling(isFocusIn);\r\n updateLiftedLabel();\r\n }\r\n\r\n updateDataAspect.updateData = composeSync(updateDataAspect.updateData, updateLiftedLabel);\r\n }\r\n}\r\n\r\nFloatingLabelPlugin.plugStaticDom = (aspects) => {\r\n aspects.floatingLabelAspect = FloatingLabelAspect();\r\n}\r\n\r\nfunction FloatingLabelAspect() {\r\n return {\r\n isFloatingLabel(){},\r\n }\r\n}","export function ChoicesDynamicStylingPlugin(aspects){\r\n let {configuration} = aspects;\r\n if (configuration.useChoicesDynamicStyling) {\r\n let {choicesVisibilityAspect, specialPicksEventsAspect} = aspects;\r\n var origSetChoicesVisible = choicesVisibilityAspect.setChoicesVisible;\r\n aspects.choicesVisibilityAspect.setChoicesVisible = \r\n function(visible){\r\n if (visible)\r\n choicesDynamicStyling(aspects);\r\n origSetChoicesVisible(visible);\r\n };\r\n var origBackSpace = specialPicksEventsAspect.backSpace;\r\n specialPicksEventsAspect.backSpace = (pick) => { origBackSpace(pick); choicesDynamicStyling(aspects);};\r\n }\r\n}\r\n\r\nfunction choicesDynamicStyling(aspects){\r\n let {configuration, environment, choicesDom, navigateAspect} = aspects;\r\n let window = environment.window;\r\n let choicesElement = choicesDom.choicesElement;\r\n let minimalChoicesDynamicStylingMaxHeight = configuration.minimalChoicesDynamicStylingMaxHeight;\r\n\r\n //find height of the browser window\r\n var g = window.document.getElementsByTagName('body')[0],\r\n e = window.document.documentElement,\r\n y = window.innerHeight || e.clientHeight || g.clientHeight;\r\n \r\n //find position of choicesElement, if it's at the bottom of the page make the choicesElement shorter\r\n var pos = choicesElement.parentNode.getBoundingClientRect();\r\n var new_y = y - pos.top;\r\n \r\n //calculate multi select max-height\r\n var msHeight = Math.max(minimalChoicesDynamicStylingMaxHeight, Math.round((new_y * 0.85))); // Michalek: 0.85 is empiric value, without it list was longer than footer height ; TODO: propose better way\r\n \r\n //add css height value\r\n choicesElement.style.setProperty(\"max-height\", msHeight+\"px\");\r\n choicesElement.style.setProperty(\"overflow-y\", \"auto\");\r\n\r\n if (!choicesDom.ChoicesDynamicStylingPlugin_scrollHandle){\r\n choicesDom.ChoicesDynamicStylingPlugin_scrollHandle = true;\r\n var origNavigateAspectNavigate = navigateAspect.navigate;\r\n navigateAspect.navigate = function(down){\r\n var wrap = origNavigateAspectNavigate(down);\r\n if (wrap!= null && wrap.choice!=null && wrap.choice.choiceElement!=null)\r\n wrap.choice.choiceElement.scrollIntoView(false); // alignTo false - scroll to the top bottom of dropdown first\r\n // TODO: BUG if mouse left on the dropdow scroll to bottom and one after doesn't work properly\r\n return wrap;\r\n }\r\n }\r\n}\r\n\r\nChoicesDynamicStylingPlugin.plugDefaultConfig = (defaults)=>{\r\n defaults.useChoicesDynamicStyling = false;\r\n defaults.choicesDynamicStyling = choicesDynamicStyling;\r\n defaults.minimalChoicesDynamicStylingMaxHeight = 20;\r\n}\r\n","import { addStyling } from \"../ToolsStyling\";\r\n\r\nexport function WarningPlugin(pluginData){\r\n\r\n let {configuration, choicesDom, createElementAspect, staticManager} = pluginData;\r\n let {css} = configuration;\r\n if (configuration.isNoResultsWarningEnabled)\r\n pluginData.warningAspect = WarningAspect(choicesDom, createElementAspect, staticManager, css)\r\n}\r\n\r\nWarningPlugin.plugDefaultConfig = (defaults)=>{\r\n defaults.noResultsWarning = \"No results found\";\r\n defaults.isNoResultsWarningEnabled = false;\r\n}\r\n\r\nfunction WarningAspect(choicesDom, createElementAspect, staticManager, css){\r\n let choicesElement = choicesDom.choicesElement;\r\n\r\n var warningElement = createElementAspect.createElement('div'); \r\n \r\n var origAppendToContainer = staticManager.appendToContainer;\r\n staticManager.appendToContainer = function(){\r\n origAppendToContainer();\r\n choicesElement.parentNode.insertBefore(warningElement, choicesElement.nextSibling); // insert after\r\n }\r\n \r\n warningElement.style.display = 'none';\r\n addStyling(warningElement, css.warning);\r\n\r\n return {\r\n warningElement,\r\n show(message){\r\n warningElement.style.display = 'block';\r\n warningElement.innerHTML = message;\r\n },\r\n hide(){\r\n warningElement.style.display = 'none';\r\n warningElement.innerHTML = \"\";\r\n }\r\n }\r\n}","export function HighlightPlugin(aspects){\r\n let {highlightAspect, filterManagerAspect, buildChoiceAspect} = aspects;\r\n if (highlightAspect) {\r\n let origProcessEmptyInput = filterManagerAspect.processEmptyInput;\r\n filterManagerAspect.processEmptyInput = function(){\r\n highlightAspect.reset();\r\n origProcessEmptyInput(); \r\n }\r\n let origSetFilter = filterManagerAspect.setFilter;\r\n filterManagerAspect.setFilter = function(text){\r\n highlightAspect.set(text);\r\n origSetFilter(text);\r\n }\r\n let origBuildChoice = buildChoiceAspect.buildChoice;\r\n buildChoiceAspect.buildChoice = function(wrap){\r\n origBuildChoice(wrap);\r\n let origSetVisible = wrap.choice.setVisible;\r\n wrap.choice.setVisible = function(v){\r\n origSetVisible(v);\r\n wrap.choice.choiceDomManagerHandlers.updateHighlighted();\r\n }\r\n }\r\n }\r\n}\r\n\r\nHighlightPlugin.plugStaticDom = (aspects) => {\r\n if (aspects.configuration.useHighlighting)\r\n aspects.highlightAspect = HighlightAspect();\r\n}\r\n\r\nHighlightPlugin.plugDefaultConfig = (defaults) => {\r\n defaults.useHighlighting = false;\r\n}\r\n\r\nfunction HighlightAspect(){\r\n let highlighter = null;\r\n return {\r\n getHighlighter(){\r\n return highlighter;\r\n },\r\n set(filter){\r\n var guarded = filter.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n var regex = new RegExp(\"(\"+guarded+\")\",\"gi\");\r\n highlighter = function(e, choiceDom, text){\r\n // TODO replace with\r\n // var pos = text.indexOf(filter);\r\n e.innerHTML = text.replace(regex,\"$1\");\r\n // TODO to method\r\n // var nodes = e.querySelectorAll('u');\r\n // var array = Array.prototype.slice.call(nodes);\r\n // if (choiceDom.highlightedElements)\r\n // choiceDom.highlightedElements.concat(array);\r\n // else\r\n // choiceDom.highlightedElements = array;\r\n }\r\n },\r\n reset(){\r\n highlighter = null;\r\n }\r\n }\r\n}","import { composeSync } from \"../ToolsJs\";\r\n\r\nexport function CustomChoiceStylingsPlugin(apsects){\r\n let {configuration, choiceDomFactory} = apsects;\r\n let customChoiceStylingsAspect = CustomChoiceStylingsAspect(configuration.customChoiceStylings);\r\n let origChoiceDomFactoryCreate = choiceDomFactory.create;\r\n choiceDomFactory.create = function(choiceElement, wrap, toggle){\r\n var o = origChoiceDomFactoryCreate(choiceElement, wrap, toggle);\r\n customChoiceStylingsAspect.customize(wrap, o.choiceDom, o.choiceDomManagerHandlers);\r\n return o;\r\n }\r\n}\r\n\r\nCustomChoiceStylingsPlugin.plugDefaultConfig = (defaults)=>{\r\n defaults.customChoiceStylings = null;\r\n}\r\n\r\nexport function CustomChoiceStylingsAspect(customChoiceStylings){\r\n \r\n return {\r\n customize(wrap, choiceDom, choiceDomManagerHandlers){\r\n if (customChoiceStylings){\r\n var handlers = customChoiceStylings(choiceDom, wrap.option);\r\n\r\n if (handlers){\r\n function customChoiceStylingsClosure(custom){\r\n return function() {\r\n custom({\r\n isOptionSelected: wrap.isOptionSelected,\r\n isOptionDisabled: wrap.isOptionDisabled,\r\n isHoverIn: wrap.choice.isHoverIn,\r\n //isHighlighted: wrap.choice.isHighlighted // TODO isHighlighted should be developed\r\n });\r\n }\r\n }\r\n if (choiceDomManagerHandlers.updateHoverIn && handlers.updateHoverIn) \r\n choiceDomManagerHandlers.updateHoverIn \r\n = composeSync(choiceDomManagerHandlers.updateHoverIn, customChoiceStylingsClosure(handlers.updateHoverIn) );\r\n if (choiceDomManagerHandlers.updateSelected && handlers.updateSelected) \r\n choiceDomManagerHandlers.updateSelected \r\n = composeSync(choiceDomManagerHandlers.updateSelected, customChoiceStylingsClosure(handlers.updateSelected));\r\n if (choiceDomManagerHandlers.updateDisabled && handlers.updateDisabled) \r\n choiceDomManagerHandlers.updateDisabled\r\n = composeSync(choiceDomManagerHandlers.updateDisabled, customChoiceStylingsClosure(handlers.updateDisabled));\r\n if (choiceDomManagerHandlers.updateHighlighted && handlers.updateHighlighted) \r\n choiceDomManagerHandlers.updateHighlighted\r\n = composeSync(choiceDomManagerHandlers.updateHighlighted, customChoiceStylingsClosure(handlers.updateHighlighted));\r\n }\r\n }\r\n }\r\n }\r\n}","import { composeSync } from \"../ToolsJs\";\r\n\r\nexport function CustomPickStylingsPlugin(aspects){\r\n let {componentPropertiesAspect,configuration, pickDomFactory} = aspects;\r\n let customPickStylingsAspect = CustomPickStylingsAspect(componentPropertiesAspect, configuration.customPickStylings);\r\n let origPickDomFactoryCreate = pickDomFactory.create;\r\n pickDomFactory.create = function(pickElement, wrap, removeOnButton){\r\n var o = origPickDomFactoryCreate(pickElement, wrap, removeOnButton);\r\n customPickStylingsAspect.customize(wrap, o.pickDom, o.pickDomManagerHandlers);\r\n return o;\r\n }\r\n}\r\n\r\nCustomPickStylingsPlugin.plugDefaultConfig = (defaults)=>{\r\n defaults.customPickStylings = null;\r\n}\r\n\r\nfunction CustomPickStylingsAspect(componentPropertiesAspect, customPickStylings){\r\n \r\n return {\r\n customize(wrap, pickDom, pickDomManagerHandlers){\r\n if (customPickStylings){\r\n var handlers = customPickStylings(pickDom, wrap.option);\r\n\r\n if (handlers){\r\n function customPickStylingsClosure(custom){\r\n return function() {\r\n custom({\r\n isOptionDisabled: wrap.isOptionDisabled,\r\n isComponentDisabled: componentPropertiesAspect.getDisabled()\r\n });\r\n }\r\n }\r\n if (pickDomManagerHandlers.updateDisabled && handlers.updateDisabled) \r\n pickDomManagerHandlers.updateDisabled \r\n = composeSync(pickDomManagerHandlers.updateDisabled, customPickStylingsClosure(handlers.updateDisabled));\r\n if (pickDomManagerHandlers.updateComponentDisabled && handlers.updateComponentDisabled) \r\n pickDomManagerHandlers.updateComponentDisabled \r\n = composeSync(pickDomManagerHandlers.updateComponentDisabled, customPickStylingsClosure(handlers.updateComponentDisabled));\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","import {LabelPlugin} from './plugins/LabelPlugin'\r\nimport {RtlPlugin} from './plugins/RtlPlugin'\r\nimport {FormResetPlugin} from './plugins/FormResetPlugin'\r\nimport {ValidationApiPlugin} from './plugins/ValidationApiPlugin'\r\nimport {BsAppearancePlugin} from './plugins/BsAppearancePlugin'\r\n\r\nimport {HiddenOptionPlugin} from './plugins/HiddenOptionPlugin'\r\n//import {HiddenOptionPlugin} from './plugins/HiddenOptionAltPlugin'\r\n\r\nimport {CssPatchPlugin} from './plugins/CssPatchPlugin'\r\nimport {PlaceholderPlugin} from './plugins/PlaceholderPlugin'\r\nimport {JQueryMethodsPlugin} from './plugins/JQueryMethodsPlugin'\r\nimport {OptionsApiPlugin} from './plugins/OptionsApiPlugin'\r\nimport {FormRestoreOnBackwardPlugin} from './plugins/FormRestoreOnBackwardPlugin'\r\nimport {SelectElementPlugin} from './plugins/SelectElementPlugin'\r\nimport {SelectedOptionPlugin} from './plugins/SelectedOptionPlugin'\r\nimport {DisabledOptionPlugin} from './plugins/DisabledOptionPlugin'\r\nimport {PicksApiPlugin} from './plugins/PicksApiPlugin'\r\nimport {PicksPlugin} from './plugins/PicksPlugin'\r\n\r\nimport {CreatePopperPlugin} from './plugins/CreatePopperPlugin'\r\n\r\nimport {FloatingLabelPlugin} from './plugins/FloatingLabelPlugin'\r\n\r\nimport {ChoicesDynamicStylingPlugin} from './plugins/ChoicesDynamicStylingPlugin'\r\n\r\nimport {shallowClearClone} from './ToolsJs'\r\n\r\nimport {WarningPlugin} from './plugins/WarningPlugin'\r\nimport {HighlightPlugin} from './plugins/HighlightPlugin'\r\n\r\nimport {CustomChoiceStylingsPlugin} from './plugins/CustomChoiceStylingsPlugin'\r\nimport {CustomPickStylingsPlugin} from './plugins/CustomPickStylingsPlugin'\r\n\r\n\r\nexport let defaultPlugins = {CssPatchPlugin, SelectElementPlugin, LabelPlugin, HiddenOptionPlugin, ValidationApiPlugin, \r\n BsAppearancePlugin, FormResetPlugin, CreatePopperPlugin, WarningPlugin, RtlPlugin, PlaceholderPlugin, FloatingLabelPlugin, OptionsApiPlugin, \r\n JQueryMethodsPlugin, SelectedOptionPlugin, FormRestoreOnBackwardPlugin, \r\n DisabledOptionPlugin, PicksApiPlugin, HighlightPlugin,\r\n ChoicesDynamicStylingPlugin, CustomPickStylingsPlugin, CustomChoiceStylingsPlugin};\r\n\r\nexport let picksPlugins = {CssPatchPlugin, PicksPlugin, LabelPlugin, ValidationApiPlugin, \r\n BsAppearancePlugin, CreatePopperPlugin, WarningPlugin, RtlPlugin, PlaceholderPlugin, FloatingLabelPlugin, OptionsApiPlugin, \r\n JQueryMethodsPlugin, PicksApiPlugin, HighlightPlugin,\r\n ChoicesDynamicStylingPlugin, CustomPickStylingsPlugin, CustomChoiceStylingsPlugin};\r\n\r\nexport let allPlugins = shallowClearClone(defaultPlugins, {PicksPlugin});\r\n\r\n","import {closestByClassName} from '../ToolsDom'\r\n\r\nexport function Bs5Plugin(){\r\n}\r\n\r\nBs5Plugin.plugDefaultConfig = (defaults) => {\r\n defaults.css = css;\r\n setDefaults(defaults);\r\n}\r\n\r\n\r\nfunction setDefaults(defaults){\r\n defaults.useCssPatch = true;\r\n defaults.cssPatch = cssPatch;\r\n defaults.pickButtonHTML = ''\r\n defaults.composeGetSize = composeGetSize;\r\n defaults.getDefaultLabel = getDefaultLabel;\r\n}\r\n\r\nfunction composeGetSize(selectElement){\r\n let inputGroupElement = closestByClassName(selectElement, 'input-group');\r\n let getSize = null;\r\n if (inputGroupElement){\r\n getSize = function(){\r\n var value = null;\r\n if (inputGroupElement.classList.contains('input-group-lg'))\r\n value = 'lg';\r\n else if (inputGroupElement.classList.contains('input-group-sm'))\r\n value = 'sm';\r\n return value;\r\n }\r\n }\r\n else{ \r\n getSize = function(){\r\n var value = null;\r\n if (selectElement.classList.contains('form-select-lg') || selectElement.classList.contains('form-control-lg')) // changed for BS\r\n value = 'lg';\r\n else if (selectElement.classList.contains('form-select-sm') || selectElement.classList.contains('form-control-sm'))\r\n value = 'sm'; \r\n return value;\r\n }\r\n }\r\n return getSize;\r\n}\r\n\r\nfunction getDefaultLabel(selectElement){\r\n let value = null;\r\n let query = `label[for=\"${selectElement.id}\"]`;\r\n let p1 = selectElement.parentElement;\r\n value = p1.querySelector(query); // label can be wrapped into col-auto\r\n if (!value){\r\n let p2 = p1.parentElement;\r\n value = p2.querySelector(query);\r\n }\r\n return value;\r\n}\r\n\r\nconst css = {\r\n choices: 'dropdown-menu', // bs, in bsmultiselect.scss as div.dropdown-menu\r\n choicesList: '', // bs, in bsmultiselect.scss as div.dropdown-menu>ul (first child)\r\n choice_hover: 'hover', // not bs, in scss as 'ul.dropdown-menu li.hover'\r\n choice_selected: '', \r\n choice_disabled: '', \r\n\r\n picks: 'form-control', // bs, in scss 'ul.form-control'\r\n picks_focus: 'focus', // not bs, in scss 'ul.form-control.focus'\r\n picks_disabled: 'disabled', // not bs, in scss 'ul.form-control.disabled'\r\n pick_disabled: '', \r\n \r\n pickFilter: '', \r\n filterInput: '',\r\n\r\n // used in pickContentGenerator\r\n pick: 'badge text-dark', // bs\r\n pickContent: '',\r\n pickContent_disabled: 'disabled', // not bs, in scss 'ul.form-control li span.disabled'\r\n pickButton: 'btn-close', // bs\r\n\r\n // used in choiceContentGenerator\r\n // choice: 'dropdown-item', // it seems like hover should be managed manually since there should be keyboard support\r\n choiceCheckBox_disabled: 'disabled', // not bs, in scss as 'ul.form-control li .custom-control-input.disabled ~ .custom-control-label'\r\n choiceContent: 'form-check', // bs d-flex required for rtl to align items\r\n choiceCheckBox: 'form-check-input', // bs\r\n choiceLabel: 'form-check-label',\r\n choiceLabel_disabled: '',\r\n\r\n label_floating_lifted: 'floating-lifted',\r\n picks_floating_lifted: 'floating-lifted',\r\n\r\n warning: 'alert-warning',\r\n}\r\n\r\nconst cssPatch = {\r\n choicesList: {listStyleType:'none', paddingLeft:'0', paddingRight:'0', marginBottom:'0'},\r\n picks: {listStyleType:'none', display:'flex', flexWrap:'wrap', height: 'auto', marginBottom: '0', cursor: 'text'},\r\n choice: {classes:'px-md-2 px-1', styles:{cursor:'pointer'}},\r\n choice_hover: 'text-primary bg-light', \r\n filterInput: {\r\n border:'0px', height: 'auto', boxShadow:'none', \r\n padding:'0', margin:'0', \r\n outline:'none', backgroundColor:'transparent',\r\n backgroundImage: 'none' // otherwise BS .was-validated set its image\r\n },\r\n filterInput_empty: 'form-control', // need for placeholder, TODO test form-control-plaintext\r\n\r\n // used in PicksDom\r\n picks_disabled: {backgroundColor: '#e9ecef'},\r\n\r\n picks_focus: {borderColor: '#80bdff', boxShadow: '0 0 0 0.2rem rgba(0, 123, 255, 0.25)'},\r\n picks_focus_valid: {borderColor: '', boxShadow: '0 0 0 0.2rem rgba(40, 167, 69, 0.25)'},\r\n picks_focus_invalid: {borderColor: '', boxShadow: '0 0 0 0.2rem rgba(220, 53, 69, 0.25)'},\r\n \r\n // used in BsAppearancePlugin\r\n picks_def: {minHeight: 'calc(2.25rem + 2px)'},\r\n picks_lg: {minHeight: 'calc(2.875rem + 2px)'},\r\n picks_sm: {minHeight: 'calc(1.8125rem + 2px)'},\r\n picks_floating_def: {minHeight: 'calc(3.5rem + 2px)'},\r\n \r\n // used in pickContentGenerator\r\n pick: {paddingLeft: '0', paddingRight: '.5rem', paddingInlineStart:'0', paddingInlineEnd:'0.5rem'},\r\n pickButton: {fontSize:'0.8em', float : \"none\", verticalAlign: \"text-top\"},\r\n pickContent_disabled: {opacity: '.65'}, \r\n \r\n // used in choiceContentGenerator\r\n choiceContent: {justifyContent: 'flex-start', cursor:'inherit'}, // BS problem: without this on inline form menu items justified center\r\n choiceLabel: {color: 'inherit', cursor:'inherit'}, // otherwise BS .was-validated set its color\r\n choiceCheckBox: {color: 'inherit', cursor:'inherit'},\r\n choiceLabel_disabled: {opacity: '.65'}, // more flexible than {color: '#6c757d'}; note: avoid opacity on pickElement's border; TODO write to BS \r\n\r\n // floating plugin\r\n label_floating_lifted: {opacity: '.65', transform : 'scale(.85) translateY(-.5rem) translateX(.15rem)'},\r\n picks_floating_lifted: {paddingTop: '1.625rem', paddingLeft:'0.8rem', paddingBottom : '0'},\r\n\r\n warning: {paddingLeft: '.25rem', paddingRight: '.25rem', zIndex: 4, fontSize:'small', backgroundColor: 'var(--bs-warning)'}, // zIndex=4 since the input-group zIndex=3\r\n}\r\n\r\n","import {composeSync} from './ToolsJs'\r\nimport {EventBinder} from './ToolsDom'\r\nimport {addStyling, toggleStyling} from './ToolsStyling'\r\n\r\nexport let utilities = {composeSync, EventBinder, addStyling, toggleStyling};\r\n","import Popper from '@popperjs/core'\r\n\r\nimport {createForJQuery} from './CreateForJQuery'\r\n\r\nimport {defaultPlugins, picksPlugins, allPlugins} from './PluginSet'\r\nimport {Bs5Plugin} from './plugins/Bs5Plugin'\r\n\r\nimport {MultiSelectBuilder} from './MultiSelectBuilder'\r\nimport {utilities} from './ToolSet'\r\n\r\nimport {shallowClearClone} from './ToolsJs'\r\n\r\nconst BsMultiSelect = (\r\n (window, jQuery, createPopper) => {\r\n return createForJQuery(window, jQuery, createPopper, 'BsMultiSelect', defaultPlugins, Bs5Plugin)\r\n }\r\n)(window, window.jQuery, Popper)\r\n\r\n\r\nconst BsPicks = (\r\n (window, jQuery, createPopper) => {\r\n return createForJQuery(window, jQuery, createPopper, 'BsPicks', picksPlugins, Bs5Plugin)\r\n }\r\n)(window, window.jQuery, Popper)\r\n\r\n\r\nexport default {BsMultiSelect, BsPicks , MultiSelectTools: {MultiSelectBuilder, plugins: shallowClearClone({Bs5Plugin}, allPlugins), utilities} }"],"names":["addToJQueryPrototype","pluginName","createPlugin","$","firstChar","charAt","firstCharLower","toLowerCase","Error","prototypableName","slice","noConflictPrototypable","fn","noConflictPrototypableForInstance","dataKey","createInstance","options","e","$e","optionsRef","Function","instance","removeData","data","prototypable","output","each","i","isMethodName","test","methodName","lMethodName","result","undefined","push","length","prototypableForInstance","get","noConflict","isBoolean","value","isString","String","extendIfUndefined","destination","source","property","shallowClearClone","v","sources","forEach","s","hasOwnProperty","forEachRecursion","f","goOn","prev","indexRecursion","index","List","tail","count","add","next","node","remove","getTail","getCount","isEmpty","reset","DoublyLinkedList","getPrev","setPrev","getNext","setNext","head","getHead","ArrayFacade","list","key","splice","predicate","start","c","forLoop","composeSync","functions","defCall","tmp","ObservableValue","getValue","setValue","newValue","attach","detachAll","ObservableLambda","func","call","ObjectValues","object","arr","findDirectChildByTagName","element","tagName","children","composeEventTrigger","window","trigger","Event","eventName","event","dispatchEvent","document","createEvent","initCustomEvent","closestByTagName","closest","closestByClassName","className","classList","contains","closestByAttribute","attributeName","attribute","getAttribute","containsAndSelf","otherNode","getDataGuardedWithPrefix","prefix","name","tmp1","tmp2","Element","parentNode","siblingsAsArray","l","getIsRtl","isRtl","EventBinder","bind","handler","addEventListener","unbind","removeEventListener","AttributeBackup","set","currentAtribute","setAttribute","restore","removeAttribute","EventLoopProlongableFlag","flag","pr","timeout","clearTimeout","setTimeout","ResetableFlag","PluginManager","plugins","pluginData","instances","disposes","buildApi","api","dispose","plugDefaultConfig","constructors","defaults","plugMergeSettings","configuration","settings","plugStaticDom","aspects","addStyling","styling","backupStyling","classes","styles","style","removeStyling","toggleStyling","isOn","extendClasses","out","param","actionStr","actionArr","isRemoveEmptyClasses","split","Array","extend","actionObj","success","Object","Styling","a","o","freeze","createStyling","isReplace","params","extendInt","p","concat","createCss","stylings1","stylings2","param1","param2","extendCss","PickDomFactory","css","componentPropertiesAspect","optionPropertiesAspect","pickButtonAspect","create","pickElement","wrap","eventBinder","buttonHTML","getButtonHTML","innerHTML","pickContentElement","querySelector","pickButtonElement","pickContent","pickButton","disableToggle","pickContent_disabled","updateData","textContent","getText","option","updateDisabled","isOptionDisabled","updateComponentDisabled","disabled","getDisabled","pickDom","pickDomManagerHandlers","ChoiceDomFactory","highlightAspect","updateHighlightedInternal","choiceDom","text","highlighter","getHighlighter","updateDataInternal","choiceElement","toggle","choiceDomManagerHandlers","choiceHoverToggle","choice_hover","updateHoverIn","choice","isHoverIn","choiceContentElement","choiceCheckBoxElement","choiceLabelElement","choiceContent","choiceCheckBox","choiceLabel","choiceSelectedToggle","choice_selected","updateSelected","isOptionSelected","checked","choiceDisabledToggle","choice_disabled","choiceCheckBoxDisabledToggle","choiceCheckBox_disabled","choiceLabelDisabledToggle","choiceLabel_disabled","choiceCursorDisabledToggle","cursor","isCheckBoxDisabled","updateHighlighted","CreateElementAspect","createElement","StaticDomFactory","choicesDomFactory","createElementAspect","choicesDom","createStaticDom","containerClass","showError","message","backgroundColor","color","containerElement","picksElement","removableContainerClass","disposablePicksElement","staticDom","initialElement","staticManager","appendToContainer","appendChild","choicesElement","removeChild","PicksDom","pickFilterElement","picks","pickFilter","disableToggleStyling","picks_disabled","focusToggleStyling","picks_focus","isFocusIn","createPickElement","pick","beforeElement","insertBefore","detach","disable","isComponentDisabled","toggleFocusStyling","getIsFocusIn","setIsFocusIn","newIsFocusIn","FilterDom","filterInputElement","filterInput","setEmpty","setFocus","focus","setWidth","width","setFocusIfNotTarget","target","onInput","onFilterInputInput","onFocusIn","onFocusOut","onKeyDown","onfilterInputKeyDown","onKeyUp","onFilterInputKeyUp","ChoicesDomFactory","choicesListElement","display","choices","choicesList","createChoiceElement","setVisible","isVisible","ChoicesVisibilityAspect","isChoicesVisible","setChoicesVisible","visible","updatePopupLocation","SpecialPicksEventsAspect","backSpace","setSelectedFalse","TriggerAspect","OnChangeAspect","triggerAspect","onChange","ComponentPropertiesAspect","OptionsAspect","getOptions","OptionPropertiesAspect","ChoicesEnumerableAspect","countableChoicesList","NavigateManager","navigate","down","FilterPredicateAspect","filterPredicate","searchText","indexOf","FilterManagerAspect","emptyNavigateManager","filteredNavigateManager","filteredChoicesList","choicesEnumerableAspect","filterPredicateAspect","showEmptyFilter","filterText","getNavigateManager","processEmptyInput","getFilter","setFilter","filteredPrev","filteredNext","BuildAndAttachChoiceAspect","buildChoiceAspect","buildAndAttachChoice","getNextElement","buildChoice","choiceElementAttach","BuildChoiceAspect","choiceDomFactory","choiceClickAspect","isChoiceElementAttached","choiceClick","isFilteredIn","setHoverIn","OptionAttachAspect","createWrapAspect","createChoiceBaseAspect","buildAndAttachChoiceAspect","wraps","createWrap","createChoiceBase","OptionsLoopAspect","optionsAspect","optionAttachAspect","loop","UpdateDataAspect","picksList","optionsLoopAspect","resetLayoutAspect","resetLayout","clear","IsChoiceSelectableAspect","isSelectable","ChoiceClickAspect","optionToggleAspect","filterDom","OptionToggleAspect","createPickHandlersAspect","addPickAspect","pickHandlers","createPickHandlers","addPick","AddPickAspect","producePick","FullMatchAspect","fullMatch","RemovePickAspect","removePick","ProducePickAspect","removePickAspect","buildPickAspect","buildPick","removeOnButton","fixSelectedFalse","pickElementAttach","removeFromPicksList","removeAndDispose","CreatePickHandlersAspect","producePickAspect","CreateChoiceBaseAspect","trim","itemPrev","itemNext","CreateWrapAspect","HoveredChoiceAspect","hoveredChoice","getHoveredChoice","setHoveredChoice","resetHoveredChoice","NavigateAspect","hoveredChoiceAspect","hoverIn","Wraps","wrapsCollection","listFacade_reset","listFacade_remove","listFacade_add","insert","PickButtonAspect","BuildPickAspect","picksDom","pickDomFactory","InputAspect","filterManagerAspect","fullMatchAspect","processInput","filterInputValue","fullMatchWrap","ResetFilterListAspect","forceResetFilter","ResetFilterAspect","resetFilterListAspect","resetFilter","FocusInAspect","setFocusIn","MultiSelectInlineLayout","environment","choicesVisibilityAspect","navigateAspect","focusInAspect","inputAspect","specialPicksEventsAspect","setDisabledComponentAspect","placeholderStopInputAspect","warningAspect","createPopperAspect","rtlAspect","pop","init","origBackSpace","update","origUpdateRtl","updateRtl","setRtl","pop2","warningElement","origUpdateRtl2","origWarningAspectShow","show","msg","eventLoopFlag","skipFocusout","getSkipFocusout","resetSkipFocusout","setSkipFocusout","skipoutMousedown","documentMouseup","showChoices","scrollTop","hideChoices","resetMouseCandidateChoice","preventDefaultClickEvent","componentDisabledEventBinder","skipoutAndResetMousedown","clickToShowChoices","processUncheck","uncheckOption","handleOnRemoveButton","mouseCandidateEventBinder","mouseOverToHoveredAndReset","adoptChoiceElement","onChoiceElementMouseover","onChoiceElementMouseleave","overAndLeaveEventBinder","afterInput","visibleCount","hide","panelIsVisble","noResultsWarning","keyDownArrow","hoveredToSelected","hoveredWrap","wasToggled","keyCode","which","empty","preventDefault","stopPropagation","origSetDisabledComponent","setDisabledComponent","origCreatePickHandlers","origBuildChoice","unbindChoiceElement","SetDisabledComponentAspect","UpdateDisabledComponentAspect","updateDisabledComponent","newIsComponentDisabled","ResetLayoutAspect","AppearanceAspect","updateDisabledComponentAspect","updateAppearance","LoadAspect","appearanceAspect","load","CountableChoicesListInsertAspect","countableChoicesListInsert","choiceNext","BsMultiSelect","onInit","isIE11","MSInputMethodContext","documentMode","disposeAspect","onChangeAspect","isChoiceSelectableAspect","staticDomFactory","warp","countableChoicesListInsertAspect","w","resetFilterAspect","pickButtonHTML","loadAspect","updateDataAspect","pluginManager","multiSelectInlineLayout","component","transformStyles","old","opt","transformClasses","adjustLegacySettings","cssPatch","selectedPanelFocusBorderColor","selectedPanelFocusBoxShadow","console","log","boxShadow","borderColor","inputColor","useCss","pick_disabled","useCssPatch","getIsValid","getIsInValid","MultiSelectBuilder","buildConfiguration","multiSelect","defaultSettings","createForJQuery","createPopper","pluginsSet","stylePlugin","isJQyery","body","hasAttribute","pluginsArray","createForUmd","Default","constructorForJquery","removeInstanceData","LabelPlugin","label","getLabelElementAspect","labelPluginData","createInputId","selectElement","id","labelElement","backupedForAttribute","newId","RtlPlugin","forceRtlOnContainer","attributeBackup","dirAttributeValue","RtlAspect","FormResetPlugin","eventBuilder","form","createValidity","valueMissing","customError","valid","ValidityApi","visibleElement","isValueMissingObservable","valueMissingMessage","onValid","customValidationMessage","validationMessage","validity","willValidate","setMessage","setCustomValidity","checkValidity","reportValidity","defValueMissingMessage","ValidationApiPlugin","getIsValueMissing","required","getValueRequired","optionsArray","selected","validationApiObservable","validationApiPluginData","validationApi","isValid","BsAppearancePlugin","floatingLabelAspect","getValidity","getSize","composeGetSize","getDefaultLabel","isFloatingLabel","origGetLabelElementAspect","composeGetValidity","updateSize","updateSizeForAdapter","picks_lg","picks_sm","picks_def","picks_floating_def","updateSizeJsForAdapter","origToggleFocusStyling","validationObservable","picks_focus_invalid","picks_focus_valid","getWasValidated","wasValidatedElement","wasUpdatedObservable","getManualValidationObservable","getMessagesElements","validMessages","invalidMessages","updateValidity","updateWasValidated","map","updateSizeClasses","size","updateSizeJsPicks","picksLgStyling","picksSmStyling","picksDefStyling","updateSizeJs","siblings","filter","HiddenOptionPlugin","isOptionHidden","origBuildAndAttachChoice","buildHiddenChoice","origIsSelectable","getIsOptionHidden","hidden","origCreateWrap","getNextNonHidden","updateOptionsHidden","updateChoiceHidden","updateOptionHidden","newIsOptionHidden","nextChoice","CssPatchPlugin","configurationPluginData","PlaceholderPlugin","placeholder","setPlaceholder","ignoreNextInputResetableFlag","PlaceholderStopInputAspect","setPlaceholderOrig","setEmptyInputWidth","emptyToggleStyling","filterInput_empty","showPlacehodler","setDisabled","updatePlacehodlerVisibility","updateEmptyInputWidth","origDisable","origAdd","returnValue","resetableFlag","JQueryMethodsPlugin","getContainer","getChoices","getChoicesList","getFilterInput","getPicks","picksCount","jQueryMethodsPluginData","OptionsApiPlugin","updateOptionAdded","updateOptionRemoved","FormRestoreOnBackwardPlugin","updateOptionsSelected","setSelected","origLoadAspectLoad","readyState","SelectElementPlugin","origLoadAspectLoop","domContentLoadedHandler","optGroupAspect","origStaticDomFactoryCreate","origCreateStaticDom","disposableContainerElement","backupDisplay","backupedRequired","fieldsetElement","getOptionOptGroup","getOptGroupText","optGroup","getOptGroupId","nextSibling","SelectedOptionPlugin","getIsOptionSelected","getSelected","setIsOptionSelected","origFilterPredicate","composeUpdateSelected","booleanValue","trySetWrapSelected","confirmed","origAddPick","selectAll","deselectAll","setOptionSelected","updateChoiceSelected","updateOptionSelected","newIsSelected","DisabledOptionPlugin","getIsOptionDisabled","origToggle","origBuildPick","choiceUpdateDisabledBackup","updateOptionsDisabled","updateChoiceDisabled","updateOptionDisabled","newIsDisabled","PicksApiPlugin","forEachPeak","getTailPeak","countPeaks","isEmptyPeaks","updateHidden","PicksPlugin","addOptionPicked","origReset","CreatePopperPlugin","Popper","anchorElement","preventOverflow","popperConfiguration","placement","modifiers","enabled","flip","popper","prototype","constructor","destroy","FloatingLabelPlugin","liftedLabel","liftToggleStyling1","liftToggleStyling2","updateLiftedLabel","label_floating_lifted","picks_floating_lifted","FloatingLabelAspect","ChoicesDynamicStylingPlugin","useChoicesDynamicStyling","origSetChoicesVisible","choicesDynamicStyling","minimalChoicesDynamicStylingMaxHeight","g","getElementsByTagName","documentElement","y","innerHeight","clientHeight","pos","getBoundingClientRect","new_y","top","msHeight","Math","max","round","setProperty","ChoicesDynamicStylingPlugin_scrollHandle","origNavigateAspectNavigate","scrollIntoView","WarningPlugin","isNoResultsWarningEnabled","WarningAspect","origAppendToContainer","warning","HighlightPlugin","origProcessEmptyInput","origSetFilter","origSetVisible","useHighlighting","HighlightAspect","guarded","replace","regex","RegExp","CustomChoiceStylingsPlugin","apsects","customChoiceStylingsAspect","CustomChoiceStylingsAspect","customChoiceStylings","origChoiceDomFactoryCreate","customize","handlers","customChoiceStylingsClosure","custom","CustomPickStylingsPlugin","customPickStylingsAspect","CustomPickStylingsAspect","customPickStylings","origPickDomFactoryCreate","customPickStylingsClosure","defaultPlugins","picksPlugins","allPlugins","Bs5Plugin","setDefaults","inputGroupElement","query","p1","parentElement","p2","listStyleType","paddingLeft","paddingRight","marginBottom","flexWrap","height","border","padding","margin","outline","backgroundImage","minHeight","paddingInlineStart","paddingInlineEnd","fontSize","float","verticalAlign","opacity","justifyContent","transform","paddingTop","paddingBottom","zIndex","utilities","jQuery","BsPicks","MultiSelectTools"],"mappings":";;;;;;;;;;;;;;;IAAO,SAASA,oBAAT,CAA8BC,UAA9B,EAA0CC,YAA1C,EAAwDC,CAAxD,EAA0D;IAC7D,MAAMC,SAAS,GAAGH,UAAU,CAACI,MAAX,CAAkB,CAAlB,CAAlB;IACA,MAAMC,cAAc,GAAGF,SAAS,CAACG,WAAV,EAAvB;;IACA,MAAID,cAAc,IAAIF,SAAtB,EAAiC;IAC7B,UAAM,IAAII,KAAJ,mBAA0BP,UAA1B,8CAAN;IACH;;IACD,MAAMQ,gBAAgB,GAAGH,cAAc,GAAGL,UAAU,CAACS,KAAX,CAAiB,CAAjB,CAA1C;IACA,MAAMC,sBAAsB,GAAGR,CAAC,CAACS,EAAF,CAAKH,gBAAL,CAA/B;IACA,MAAMI,iCAAiC,GAAGV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