{"version":3,"sources":["../../js/src/ToolsJs.js","../../js/src/ToolsDom.js","../../js/src/ToolsStyling.js","../../js/src/FilterManagerAspect.js","../../js/src/Wraps.js","../../js/src/MultiSelectInlineLayout.js","../../js/src/BsMultiSelect.js","../../js/src/NavigateAspect.js","../../js/src/ComponentPropertiesAspect.js","../../js/src/OptionsAspect.js","../../js/src/CreateWrapAspect.js","../../js/src/StaticDomFactory.js","../../js/src/ChoicesDomFactory.js","../../js/src/CountableChoicesListInsertAspect.js","../../js/src/ChoicesEnumerableAspect.js","../../js/src/PluginManager.js","../../js/src/ChoicesVisibilityAspect.js","../../js/src/PickButtonAspect.js","../../js/src/FilterDom.js","../../js/src/SpecialPicksEventsAspect.js","../../js/src/ResetFilterListAspect.js","../../js/src/PicksDom.js","../../js/src/PickDomFactory.js","../../js/src/BuildPickAspect.js","../../js/src/InputAspect.js","../../js/src/ChoiceDomFactory.js","../../js/src/BuildChoiceAspect.js","../../js/src/AppearanceAspect.js","../../js/src/FillChoicesAspect.js","../../js/src/UpdateDataAspect.js","../../js/src/BsMultiSelectDepricatedParameters.js","../../js/src/MultiSelectBuilder.js","../../js/src/CreateForJQuery.js","../../js/src/AddToJQueryPrototype.js","../../js/src/plugins/LabelPlugin.js","../../js/src/plugins/RtlPlugin.js","../../js/src/ValidityApi.js","../../js/src/plugins/ValidationApiPlugin.js","../../js/src/plugins/BsAppearancePlugin.js","../../js/src/plugins/HiddenOptionPlugin.js","../../js/src/plugins/PlaceholderPlugin.js","../../js/src/plugins/JQueryMethodsPlugin.js","../../js/src/plugins/OptionsApiPlugin.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/plugins/CssPatchPlugin.js","../../js/src/plugins/SelectElementPlugin.js","../../js/src/PluginSet.js","../../js/src/plugins/FormResetPlugin.js","../../js/src/plugins/FormRestoreOnBackwardPlugin.js","../../js/src/plugins/Bs5Plugin.js","../../js/src/ToolSet.js"],"names":["value","String","extendIfUndefined","source","destination","property","undefined","shallowClearClone","v","sources","_len","arguments","length","Array","_key","forEach","s","_property","_v","hasOwnProperty","forEachRecursion","f","e","goOn","prev","index","indexRecursion","tail","count","add","next","remove","node","getTail","getCount","isEmpty","head","getPrev","setPrev","getNext","setNext","getHead","composeSync","functions","_len2","_key2","defCall","_len3","_key3","_i","_functions","Function","tmp","list","func","List","getValue","attach","reset","element","tagName","i","children","closest","className","classList","contains","otherNode","tmp1","prefix","name","tmp2","predicate","parentNode","isRtl","closestByAttribute","attributeName","attribute","getAttribute","bind","addEventListener","eventName","handler","push","removeEventListener","backupStyling","styling","classes","styles","style","isOn","addStyling","removeStyling","isString","out","param","actionStr","actionArr","isRemoveEmptyClasses","c","success","extendClasses","Object","actionObj","extend","a","slice","o","freeze","isReplace","params","extendInt","p","concat","Styling","stylings1","stylings2","param1","param2","createStyling","NavigateManager","navigate","down","wrap","Wraps","wrapsCollection","listFacade_reset","listFacade_remove","listFacade_add","_push","insert","key","_insert","dispose","forLoop","environment","filterDom","aspects","picksDom","choicesDom","choicesVisibilityAspect","hoveredChoiceAspect","navigateAspect","filterManagerAspect","focusInAspect","optionToggleAspect","createPickHandlersAspect","picksList","inputAspect","specialPicksEventsAspect","buildChoiceAspect","setDisabledComponentAspect","resetLayoutAspect","placeholderStopInputAspect","warningAspect","configuration","createPopperAspect","rtlAspect","staticManager","picksElement","choicesElement","pop","filterInputElement","appendToContainer","origBackSpace","backSpace","init","pick","update","origUpdateRtl","setRtl","updatePopupLocation","origUpdateRtl2","pop2","show","msg","origWarningAspectShow","document","eventLoopFlag","EventLoopFlag","skipFocusout","window","flag","get","setTimeout","setSkipFocusout","documentMouseup","event","containsAndSelf","resetLayout","target","setFocusIn","resetMouseCandidateChoice","isChoicesVisible","componentDisabledEventBinder","skipoutMousedown","resetSkipFocusout","setFocusIfNotTarget","preventDefaultClickEvent","hideChoices","getNavigateManager","showChoices","handleOnRemoveButton","setSelectedFalse","processUncheck","uncheckOption","mouseCandidateEventBinder","unbind","mouseOverToHoveredAndReset","hoverIn","hoveredWrap","getSkipFocusout","filterInputValue","processInput","_inputAspect$processI","processEmptyInput","setWidth","visibleCount","hide","panelIsVisble","resetHoveredChoice","getFilter","noResultsWarning","afterInput","onKeyUp","empty","indexOf","keyCode","preventDefault","stopPropagation","keyDownArrow","origSetDisabledComponent","which","hoveredToSelected","isComponentDisabled","clickToShowChoices","origCreatePickHandlers","pickHandlers","removeOnButton","origBuildChoice","createPickHandlers","choice","removeAndDispose","unbindChoiceElement","choiceElement","overAndLeaveEventBinder","isHoverIn","skipoutAndResetMousedown","BsMultiSelect$1","plugins","onInit","isIE11","containerClass","documentMode","hoveredChoice","css","getDisabled","options","getText","disposeAspect","triggerAspect","TriggerAspect","onChangeAspect","_trigger","trigger","OnChangeAspect","componentPropertiesAspect","onChange","ComponentPropertiesAspect","optionPropertiesAspect","getOptions","OptionPropertiesAspect","isChoiceSelectableAspect","option","text","IsChoiceSelectableAspect","createWrapAspect","isSelectable","createChoiceBaseAspect","createWrap","createChoiceBase","filteredNext","searchText","toLowerCase","trim","isFilteredIn","setVisible","setHoverIn","choiceDom","choiceElementAttach","itemPrev","itemNext","CreateChoiceBaseAspect","removePickAspect","addPick","producePick","createElementAspect","removePick","createElement","staticDomFactory","create","choicesListElement","appendChild","display","choices","choicesList","createChoiceElement","isVisible","insertBefore","beforeElement","detach","removeChild","StaticDomFactory","choicesDomFactory","createStaticDom","showError","backgroundColor","color","Error","message","removableContainerClass","containerElement","disposablePicksElement","staticDom","initialElement","ArrayFacade","countableChoicesList","splice","start","warp","choicesEnumerableAspect","countableChoicesListInsert","choiceNext","ChoicesEnumerableAspect","filteredChoicesList","filteredPrev","filterPredicate","emptyNavigateManager","filteredNavigateManager","filterPredicateAspect","filterText","showEmptyFilter","setFilter","HoveredChoiceAspect","getHoveredChoice","_navigate","setHoveredChoice","wraps","w","countableChoicesListInsertAspect","optionsAspect","addPickAspect","constructors","_constructors$i$plugS","_constructors$i3","plugStaticDom","call","buttonHTML","filterInput","setAttribute","EventBinder","eventBinder","focus","width","onFilterInputInput","_onFocusIn","_onFocusOut","onfilterInputKeyDown","onFilterInputKeyUp","SpecialPicksEventsAspect","resetFilterListAspect","visible","resetFilterAspect","forceResetFilter","ResetFilterAspect","resetFilter","pickFilterElement","picks","disableToggleStyling","toggleStyling","focusToggleStyling","picks_focus","isFocusIn","createPickElement","pickElement","getIsFocusIn","newIsFocusIn","FocusInAspect","pickButtonAspect","toggleFocusStyling","PickButtonAspect","buildPickAspect","innerHTML","getButtonHTML","pickContentElement","querySelector","pickButtonElement","pickContent","pickButton","disableToggle","pickDom","updateData","updateDisabled","textContent","updateComponentDisabled","isOptionDisabled","disabled","PickDomFactory","BuildPickAspect","producePickAspect","pickDomFactory","buildPick","_picksDom$createPickE","_pickDomFactory$creat","pickDomManagerHandlers","pickElementAttach","ProducePickAspect","fixSelectedFalse","removeFromPicksList","CreatePickHandlersAspect","OptionToggleAspect","fullMatchAspect","toggle","FullMatchAspect","fullMatch","InputAspect","choiceClickAspect","fullMatchWrap","setEmpty","ChoiceClickAspect","choiceDomFactory","choiceClick","setFocus","ChoiceDomFactory","updateHighlightedInternal","highlighter","getHighlighter","choiceDomManagerHandlers","choiceHoverToggle","choiceContentElement","choiceCheckBoxElement","choiceLabelElement","choiceContent","choiceLabel","choiceCheckBoxDisabledToggle","choiceLabelDisabledToggle","choiceLabel_disabled","choiceCursorDisabledToggle","cursor","updateDataInternal","updateHighlighted","updateHoverIn","updateSelected","choiceDisabledToggle","isOptionSelected","isCheckBoxDisabled","choiceSelectedToggle","checked","_choiceContentElement","buildAndAttachChoiceAspect","buildChoice","_choicesDom$createCho","isChoiceElementAttached","_choiceDomFactory$cre","BuildAndAttachChoiceAspect","buildAndAttachChoice","getNextElement","ResetLayoutAspect","updateDisabledComponentAspect","setDisabledComponent","disable","SetDisabledComponentAspect","UpdateDisabledComponentAspect","appearanceAspect","updateDisabledComponent","newIsComponentDisabled","AppearanceAspect","fillChoicesAspect","updateAppearance","FillChoicesAspect","loadAspect","fillChoices","fillChoicesImpl","domContentLoadedHandler","LoadAspect","updateDataAspect","load","UpdateDataAspect","_extendIfUndefined","multiSelectInlineLayout","pluginData","instance","instances","disposes","buildApi","_instances$_i","_instances$_i$buildAp","api","_i2","_i3","_instances$_i3$dispos","_instances$_i2","MultiSelectInlineLayout","component","pluginManager","old","opt","defaults","_constructors$i$plugD","_constructors$i","plugDefaultConfig","defaultSettings","console","log","buildConfiguration","_options","adjustLegacySettings","settings","cssPatch","selectedPanelFocusBorderColor","selectedPanelFocusBoxShadow","boxShadow","borderColor","transformStyles","transformClasses","inputColor","useCss","useCssPatch","getIsValid","getIsInValid","plugMergeSettings","_options2","_constructors$i$plugM","_constructors$i2","multiSelect","$","createPopper","pluginsSet","stylePlugin","isJQyery","Event","dispatchEvent","initCustomEvent","composeEventTrigger","MultiSelectBuilder","object","arr","createForUmd","constructorForJquery","charAt","createPlugin","firstCharLower","firstChar","pluginName","noConflictPrototypable","prototypableName","noConflictPrototypableForInstance","dataKey","optionsRef","$e","removeData","data","output","this","each","isMethodName","createInstance","lMethodName","methodName","result","fn","noConflict","prototypable","prototypableForInstance","removeInstanceData","label","getLabelElementAspect","createInputId","labelPluginData","selectElement","id","labelElement","backupedForAttribute","newId","forceRtlOnContainer","isBoolean","attributeBackup","AttributeBackup","getIsRtl","set","currentAtribute","removeAttribute","dirAttributeValue","updateRtl","customValidationMessage","isValueMissingObservable","valueMissingMessage","onValid","validationMessage","validity","willValidate","createValidity","valueMissing","customError","valid","visibleElement","setCustomValidity","setMessage","checkValidity","reportValidity","RtlAspect","selectElementPluginData","required","getDataGuardedWithPrefix","defValueMissingMessage","getIsValueMissing","optionsArray","selected","newValue","validationApiPluginData","validationApiObservable","validationApi","isValid","setValue","detachAll","floatingLabelAspect","getValidity","getSize","composeGetSize","getDefaultLabel","isFloatingLabel","origGetLabelElementAspect","updateSize","picks_lg","picks_sm","picks_def","picks_floating_def","updateSizeJsForAdapter","updateSizeJs","picksLgStyling","picksSmStyling","picksDefStyling","updateSizeClasses","size","updateSizeJsPicks","updateSizeForAdapter","origToggleFocusStyling","validationObservable","picks_focus_invalid","picks_focus_valid","wasUpdatedObservable","ObservableLambda","closestByClassName","getManualValidationObservable","getMessagesElements","validMessages","siblingsAsArray","invalidMessages","l","filter","siblings","_getMessagesElements","map","updateValidity","updateWasValidated","newIsOptionHidden","getIsOptionHidden","buildHiddenChoice","nextChoice","resetableFlag","placeholder","ignoreNextInputResetableFlag","setPlaceholderOrig","setPlaceholder","setEmptyInputWidth","showPlacehodler","setDisabled","origDisable","updateEmptyInputWidth","updatePlacehodlerVisibility","returnValue","origAdd","emptyToggleStyling","getContainer","getChoices","getChoicesList","getFilterInput","getPicks","picksCount","updateOptionAdded","_nextChoice","updateOptionRemoved","newIsSelected","getIsOptionSelected","newIsDisabled","getIsOptionDisabled","forEachPeak","getTailPeak","_picksList$getTail","countPeaks","isEmptyPeaks","addOptionPicked","Popper","popperConfiguration","anchorElement","preventOverflow","placement","modifiers","enabled","popper","prototype","constructor","destroy","liftToggleStyling1","liftedLabel","liftToggleStyling2","picks_floating_lifted","updateLiftedLabel","origSetChoicesVisible","choicesDynamicStyling","minimalChoicesDynamicStylingMaxHeight","documentElement","y","innerHeight","getBoundingClientRect","msHeight","Math","max","round","new_y","setProperty","isNoResultsWarningEnabled","warningElement","origAppendToContainer","nextSibling","warning","WarningAspect","highlightAspect","origProcessEmptyInput","origSetFilter","origSetVisible","customChoiceStylings","apsects","customChoiceStylingsAspect","origChoiceDomFactoryCreate","customize","handlers","customChoiceStylingsClosure","custom","customPickStylingsAspect","origPickDomFactoryCreate","customPickStylings","customPickStylingsClosure","CssPatchPlugin","createCss","configurationPluginData","extendCss","SelectElementPlugin","origCreate","origCreateStaticDom","findDirectChildByTagName","disposableContainerElement","backupedRequired","fieldsetElement","backupDisplay","PicksPlugin","origReset","_origAdd","FloatingLabelAspect","useChoicesDynamicStyling","HighlightPlugin","useHighlighting","regex","RegExp","guarded","replace","LabelPlugin","HiddenOptionPlugin","ValidationApiPlugin","isOptionHidden","origBuildAndAttachChoice","origIsSelectable","hidden","origCreateWrap","getNextNonHidden","updateOptionsHidden","updateChoiceHidden","updateOptionHidden","BsAppearancePlugin","FormResetPlugin","CreatePopperPlugin","eventBuilder","closestByTagName","WarningPlugin","RtlPlugin","PlaceholderPlugin","FloatingLabelPlugin","OptionsApiPlugin","JQueryMethodsPlugin","SelectedOptionPlugin","FormRestoreOnBackwardPlugin","setIsOptionSelected","setSelected","origFilterPredicate","composeUpdateSelected","booleanValue","trySetWrapSelected","confirmed","origAddPick","selectAll","setOptionSelected","updateOptionsSelected","updateChoiceSelected","updateOptionSelected","DisabledOptionPlugin","origLoad","readyState","PicksApiPlugin","origToggle","origBuildPick","choiceUpdateDisabledBackup","updateOptionsDisabled","updateChoiceDisabled","updateOptionDisabled","ChoicesDynamicStylingPlugin","CustomPickStylingsPlugin","CustomChoiceStylingsPlugin","setDefaults","pickButtonHTML","inputGroupElement","choice_hover","choice_selected","choice_disabled","pick_disabled","pickFilter","pickContent_disabled","choiceCheckBox_disabled","parentElement","choiceCheckBox","paddingLeft","picks_disabled","height","border","padding","outline","backgroundImage","label_floating_lifted","listStyleType","paddingRight","flexWrap","marginBottom","minHeight","margin","filterInput_empty","lineHeight","float","opacity","justifyContent","fontSize","paddingInlineEnd","verticalAlign","formGroup","utilities","transform","jQuery","defaultPlugins","Bs4Plugin","paddingBottom","Popper__default","BsPicks","picksPlugins"],"mappings":";;;;;yZACI,SAAOA,EAAUA,GACpB,OAAA,IAAAA,IAAA,IAAAA,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Cbs0B,SAAAA,GAAgBnQ,GAACtQ,IAAAA,EAAO,KAAWmI,EAAO4M,EAAAzE,EAAA,cAC1CrI,OAnCa+Z,IAAA71B,EAAA61B,EAAAld,cAAA,cAAAwL,EAAAC,GAAA,OAmCbtI,EAAyC,IAAAga,GAAA,CAEzCpzB,YAAAA,EACAoyB,YAAAA,EAAwBU,WAAS7vB,EAAOowB,cAAYpe,SAG3C,CAA8E/D,cAFnD,SAAbvI,EAAA2qB,EAAAxU,GAAyB+S,OAAAA,EAAzBlpB,EAAA2qB,EAAAxU,EAAA,gBAAAyU,GAAAC,IAAa,CAAkCC,OAAAA,EAAgB,QAAAC,EAAA,SAE7EC,QAAA,SAAAhrB,EAAA2qB,EAAAxU,GAAC+S,OAAAA,EAADlpB,EAAA2qB,EAAAxU,EAAA,UAAA8U,GAAAJ,IAAA,CAAwBlB,OAAAA,EAAxB,QAAAoB,EAAA,2BAzCbpU,mBAAAA,aCxFW8T,UAAYI,IAACxzB,IAAa8T,UAAAA","sourcesContent":["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 window.setTimeout( \r\n () => { \r\n flag = false;\r\n }, 0)\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}","import {shallowClearClone, isString} from './ToolsJs';\r\n\r\nexport function addStyling(element, styling){\r\n var backupStyling = {classes:[], styles:{}}\r\n if (styling) {\r\n var {classes, styles} = styling;\r\n classes.forEach(e => 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}","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 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}","import {composeSync} from './ToolsJs';\r\nimport {EventBinder, EventLoopFlag, 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 = EventLoopFlag(window); \r\n \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 \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 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\r\n eventLoopFlag.set(); // means disable some mouse handlers; 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 navigateAspect.hoverIn(wrap); // !\r\n showChoices(); // !\r\n }\r\n }\r\n\r\n function hoveredToSelected(){\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","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 {FillChoicesAspect} from './FillChoicesAspect'\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, LoadAspect, AppearanceAspect, ResetLayoutAspect} from './AppearanceAspect'\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 fillChoicesAspect = FillChoicesAspect(\r\n window.document, createWrapAspect, createChoiceBaseAspect, optionsAspect, wraps, buildAndAttachChoiceAspect );\r\n let loadAspect = LoadAspect(fillChoicesAspect, appearanceAspect);\r\n let updateDataAspect = UpdateDataAspect(choicesDom, wraps, picksList, fillChoicesAspect, 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 , fillChoicesAspect, \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// popupAspect.init();\r\n loadAspect.load();\r\n \r\n return api;\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 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","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}","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} 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 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}","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 PluginManager(plugins, pluginData){\r\n let instances = [];\r\n if (plugins){\r\n for(let i = 0; i buttonHTML\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","export function SpecialPicksEventsAspect(){\r\n return {\r\n backSpace(pick){ \r\n pick.setSelectedFalse(); \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 {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 {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","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}","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","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}","\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(fillChoicesAspect, appearanceAspect){\r\n return {\r\n load(){\r\n fillChoicesAspect.fillChoices();\r\n appearanceAspect.updateAppearance(); \r\n }\r\n }\r\n}","\r\nexport function FillChoicesAspect(\r\n document, createWrapAspect, createChoiceBaseAspect, optionsAspect, wraps, buildAndAttachChoiceAspect\r\n ) { \r\n return {\r\n fillChoices(){\r\n var fillChoicesImpl = () => {\r\n let options = optionsAspect.getOptions();\r\n for(let i = 0; ipick.dispose());\r\n picksList.reset();\r\n fillChoicesAspect.fillChoices();\r\n }\r\n }\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","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}","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}","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 selectElementPluginData, staticDom, filterDom, updateDataAspect} = pluginData;\r\n // TODO: required could be a function\r\n let {getIsValueMissing, valueMissingMessage, required} = configuration;\r\n if (!isBoolean(required))\r\n required = selectElementPluginData?.required; \r\n else if (!isBoolean(required))\r\n required = false;\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.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 {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 (picksList.getCount()==0) \r\n updatePlacehodlerVisibility()\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\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}","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} = 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\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 {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 {closestByTagName, findDirectChildByTagName, closestByClassName} from '../ToolsDom';\r\nimport {composeSync} from '../ToolsJs';\r\n\r\nexport function SelectElementPlugin(){\r\n}\r\n\r\nSelectElementPlugin.plugStaticDom = (aspects)=>{\r\n let {configuration, staticDomFactory, createElementAspect,\r\n componentPropertiesAspect, onChangeAspect, triggerAspect, optionsAspect, disposeAspect} = aspects;\r\n let {create: origCreate} = staticDomFactory;\r\n staticDomFactory.create = (css) => {\r\n let {choicesDom, createStaticDom: origCreateStaticDom} = origCreate(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\r\n var backupedRequired = selectElement.required;\r\n aspects.selectElementPluginData = {required: backupedRequired};\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 (!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}","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 {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}","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 origLoad = loadAspect.load;\r\n loadAspect.load = ()=>{\r\n origLoad();\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(){api.updateOptionsSelected()});\r\n }\r\n }\r\n }\r\n }\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"]}