-
Notifications
You must be signed in to change notification settings - Fork 133
/
easydropdown.js.map
1 lines (1 loc) · 127 KB
/
easydropdown.js.map
1
{"version":3,"sources":["webpack://easydropdown/webpack/universalModuleDefinition","webpack://easydropdown/webpack/bootstrap","webpack://easydropdown/./node_modules/helpful-merge/dist/index.js","webpack://easydropdown/./src/Shared/Util/dispatchOpen.ts","webpack://easydropdown/./src/Shared/Util/composeClassName.ts","webpack://easydropdown/./node_modules/helpful-merge/dist/Constants/ArrayStrategy.js","webpack://easydropdown/./src/Shared/Util/closestParent.ts","webpack://easydropdown/./src/Events/Constants/Selectors.ts","webpack://easydropdown/./src/Shared/Util/killSelectReaction.ts","webpack://easydropdown/./src/Easydropdown/cache.ts","webpack://easydropdown/./node_modules/helpful-merge/dist/merge.js","webpack://easydropdown/./node_modules/helpful-merge/dist/Messages.js","webpack://easydropdown/./src/Config/Config.ts","webpack://easydropdown/./src/Shared/Util/Constants/CollisionType.ts","webpack://easydropdown/./src/Shared/Util/getIsMobilePlatform.ts","webpack://easydropdown/./src/Events/Constants/KeyCodes.ts","webpack://easydropdown/./src/Events/Handlers/handleWindowClick.ts","webpack://easydropdown/./src/Renderer/Constants/AttributeChangeType.ts","webpack://easydropdown/./src/Renderer/Constants/DomChangeType.ts","webpack://easydropdown/./src/State/Constants/BodyStatus.ts","webpack://easydropdown/./src/State/Constants/ScrollStatus.ts","webpack://easydropdown/./src/State/Group.ts","webpack://easydropdown/./src/State/Option.ts","webpack://easydropdown/./src/umd.ts","webpack://easydropdown/./node_modules/custom-event-polyfill/polyfill.js","webpack://easydropdown/./src/Shared/Polyfills/Element.matches.ts","webpack://easydropdown/./src/Easydropdown/factory.ts","webpack://easydropdown/./src/Easydropdown/Easydropdown.ts","webpack://easydropdown/./node_modules/helpful-merge/dist/Config.js","webpack://easydropdown/./node_modules/helpful-merge/dist/deriveCustomTypeInstance.js","webpack://easydropdown/./node_modules/helpful-merge/dist/FluentMerge.js","webpack://easydropdown/./node_modules/helpful-merge/dist/handleMergeError.js","webpack://easydropdown/./src/Config/Behavior.ts","webpack://easydropdown/./src/Config/Callbacks.ts","webpack://easydropdown/./src/Config/ClassNames.ts","webpack://easydropdown/./src/Events/bindEvents.ts","webpack://easydropdown/./src/Shared/Util/throttle.ts","webpack://easydropdown/./src/Events/EventBinding.ts","webpack://easydropdown/./src/Events/getEventsList.ts","webpack://easydropdown/./src/Events/Handlers/handleBodyClick.ts","webpack://easydropdown/./src/Events/Handlers/handleBodyMousedown.ts","webpack://easydropdown/./src/Events/Handlers/handleBodyMouseover.ts","webpack://easydropdown/./src/Events/Handlers/handleHeadClick.ts","webpack://easydropdown/./src/Shared/Util/detectBodyCollision.ts","webpack://easydropdown/./src/Events/Handlers/handleItemsListScroll.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectBlur.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectFocus.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectInvalid.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectKeydown.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectKeydownDown.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectKeydownUp.ts","webpack://easydropdown/./src/Events/Handlers/handleSelectKeypress.ts","webpack://easydropdown/./src/Renderer/Renderer.ts","webpack://easydropdown/./src/Components/root.ts","webpack://easydropdown/./src/Components/body.ts","webpack://easydropdown/./src/Components/group.ts","webpack://easydropdown/./src/Components/option.ts","webpack://easydropdown/./src/Components/head.ts","webpack://easydropdown/./src/Components/arrow.ts","webpack://easydropdown/./src/Components/value.ts","webpack://easydropdown/./src/Shared/Util/createDomElementFromHtml.ts","webpack://easydropdown/./src/Renderer/Dom.ts","webpack://easydropdown/./src/Renderer/domDiff.ts","webpack://easydropdown/./src/Renderer/PatchCommand.ts","webpack://easydropdown/./src/Renderer/domPatch.ts","webpack://easydropdown/./src/Shared/Util/pollForSelectChange.ts","webpack://easydropdown/./src/Shared/Util/pollForSelectMutation.ts","webpack://easydropdown/./src/State/InjectedActions/closeOthers.ts","webpack://easydropdown/./src/State/InjectedActions/scrollToView.ts","webpack://easydropdown/./src/State/StateManager.ts","webpack://easydropdown/./src/State/resolveActions.ts","webpack://easydropdown/./src/State/StateMapper.ts","webpack://easydropdown/./src/State/State.ts","webpack://easydropdown/./src/Easydropdown/Timers.ts","webpack://easydropdown/./src/Easydropdown/EasydropdownFacade.ts"],"names":["root","factory","exports","module","define","amd","window","enumerable","get","getter","value","key","bind","Object","prototype","hasOwnProperty","call","object","property","defineProperty","merge_1","ArrayStrategy_1","ArrayStrategy","default","dispatchOpen","injectedDetectBodyCollision","actions","config","dom","collisionData","maxVisibleItems","maxVisibleItemsOverride","behavior","isScrollable","item","length","maxBodyHeight","sumItemsHeight","open","type","boundDispatchOpen","tokens","reduce","classNames","token","push","predicate","className","join","el","selector","includeSelf","parent","parentNode","matches","document","body","OPTION","select","timers","clearTimeout","keyingTimeoutId","keying","setTimeout","resetKeying","disabled","focus","Config_1","deriveCustomTypeInstance_1","FluentMerge_1","handleMergeError_1","Messages","merge","target","source","options","isClientSide","sourceKeys","deep","PUSH","REPLACE","indexOf","arrayStrategy","RangeError","INVALID_ARRAY_STRATEGY","TypeError","TYPE_ERROR_TARGET","TYPE_ERROR_SOURCE","Array","isArray","apply","i","toString","getOwnPropertyNames","_i","sourceKeys_1","descriptor","getOwnPropertyDescriptor","set","includeReadOnly","includeNonEmurable","Node","documentElement","useReferenceIfArray","useReferenceIfTargetUnset","err","errorMessage","preserveTypeIfTargetUnset","keys","forEach","method","_a","args","arguments","createFluent","MERGE_ERROR","offender","suggestion","strategy","callbacks","seal","this","Config","CollisionType","userAgent","isIos","test","isAndroid","isOperaMini","isWindowsPhone","UP","DOWN","SPACE","ENTER","ESC","_","state","isOpen","close","blur","AttributeChangeType","DomChangeType","BodyStatus","ScrollStatus","label","isDisabled","Group","Option","ce","CustomEvent","cancelable","preventDefault","defaultPrevented","Error","e","event","params","evt","origPrevent","bubbles","detail","undefined","createEvent","initCustomEvent","Event","Element","msMatchesSelector","selectElementOrSelector","selectElement","querySelector","HTMLSelectElement","multiple","cachedInstance","instance","factoryFn","decoratedFactory","all","selects","querySelectorAll","destroy","slice","mapFromSelect","renderer","render","proxyActions","closeOthers","scrollToView","handleStateUpdate","eventBindings","pollChangeIntervalId","liveUpdates","pollMutationIntervalId","refresh","nextValue","update","group","option","queryDomRefs","validate","isRequired","hasValue","invalidate","clear","binding","unbind","cacheIndex","splice","cb","onOpen","onClose","onSelect","onOptionClick","getOptionFromIndex","focusedIndex","Easydropdown","constructor","FluentMerge","sources","to","from","with","exec","_this","reduceBestMatch","offendingKeyLower","offendingKey","currBestMatch","currKey","totalMatching","getTotalMatching","toLowerCase","delta","Math","abs","possibleKey","longer","shorter","leftPointer","leftInnerPointer","leftTotalMatching","lastCommonIndex","rightPointer","rightInnerPointer","rightTotalMatching","longerLastIndex","shorterLastIndex","min","message","isSealed","isExtensible","reducer","primer","Infinity","bestMatch","showPlaceholderWhenOpen","openOnFocus","closeOnSelect","useNativeUiOnMobile","loop","clampMaxVisibleItems","Behavior","Callbacks","rootOpen","rootOpenAbove","rootOpenBelow","rootDisabled","rootInvalid","rootFocused","rootHasValue","rootNative","gradientTop","gradientBottom","head","arrow","bodyScrollable","bodyAtTop","bodyAtBottom","itemsList","groupDisabled","groupHasLabel","groupLabel","optionDisabled","optionFocused","optionSelected","ClassNames","bindEvent","handlerParams","eventBindingRaw","eventBinding","boundHandler","handler","throttle","addEventListener","map","delay","timerId","last","now","Date","later","difference","debounce","passive","removeEventListener","EventBinding","stopPropagation","Selectors","optionIndex","selectOption","startClickSelecting","isKeying","focusOption","handleHeadClick","injectedGetIsMobilePlatform","isUseNativeMode","isMobilePlatform","navigator","isClosed","boundHandleHeadClick","mapCollisionData","deltaTop","deltaBottom","maxHeight","itemHeight","NONE","largestDelta","max","TOP","BOTTOM","floor","bbHead","getBoundingClientRect","wh","innerHeight","top","bottom","offsetHeight","scrollHeight","scrollTop","topOut","bottomOut","scroll","isClickSelecting","keyCode","KeyCodes","isSearching","metaKey","selectedIndex","iterations","incrementAmount","round","totalOptions","focusedOption","searchResetDuration","includes","searchTimeoutId","search","resetSearch","html","rootElement","Renderer","injectSelect","nextHtml","nextRoot","diffCommand","syncSelectWithValue","classList","remove","parentElement","replaceChild","tempSelect","setAttribute","dispatchEvent","localDom","ref","elements","element","isInvalid","isFocused","isOpenAbove","isOpenBelow","isAtTop","isAtBottom","styleAttr","groups","groupState","hasLabel","optionState","isSelected","selectedOption","isPlaceholderShown","humanReadableValue","temp","createElement","innerHTML","firstElementChild","totalHeight","Dom","diffAttributeChanges","prev","next","totalAttributes","attributes","attributesMap","attributeChanges","attr1","attr2","name","sort","attr","change","ADD","REMOVE","EDIT","OUTER","domDiff","totalChildNodes","command","Text","textContent","INNER","newTextContent","HTMLElement","tagName","newNode","outerHTML","FULL","childNodes","childNode","childCommands","newInnerHtml","index","PatchCommand","patchAttributes","raf","requestAnimationFrame","patchAttribute","removeAttribute","domPatch","node","childCommand","lastValue","setInterval","getOptionIndexFromValue","handleMutation","lastOuterHtml","thisInstance","cache","getScrollTop","currentScrollTop","optionOffsetTop","optionHeight","bodyHeight","scrollOffset","remainder","scrollToMiddle","offset","offsetTop","injectedActions","onAction","stateProxy","StateManager","createStateProxy","getPropertyDescriptorsFromValue","proxy","getPrototypeOf","concat","localDescriptors","isAccessorProperty","readPropertyValue","updatePropertyValue","scrollStatus","AT_TOP","AT_BOTTOM","SCROLLED","makeScrollable","makeUnscrollable","collisionType","bodyStatus","OPEN_BELOW","OPEN_ABOVE","CLOSED","optionAtIndex","shouldScrollToView","useNative","isWithinGroup","required","child","children","getAttribute","HTMLOptionElement","StateMapper","mapGroup","lastGroup","mapOption","selected","HTMLOptGroupElement","j","groupChild","placeholder","isParentGroupDisabled","stateRaw","groupRaw","optionRaw","total","hasPlaceholder","Boolean","find","groupStartIndex","State","clearInterval","Timers","implementation","defineProperties","EasydropdownFacade"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA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GA8JA,UAAe8E,G,8ECvKf,+BASA,OAHW,YAAAnT,MAAP,sBACI7L,OAAO+F,KAAKa,MAAMZ,SAAQ,SAAAlG,GAAO,OAAAL,OAAOwf,cAAc,EAAKnf,QAEnE,EATA,GAWA,UAAeof,G,8ECTf,MA+CI,SAAYC,GACRvY,KAAKnF,KAAO0d,EAAe1d,KAAK1B,KAAKof,GACrCvY,KAAKiB,MAAQsX,EAAetX,MAAM9H,KAAKof,GACvCvY,KAAKuE,QAAUgU,EAAehU,QAAQpL,KAAKof,GAC3CvY,KAAK0D,QAAU6U,EAAe7U,QAAQvK,KAAKof,GAC3CvY,KAAK6E,SAAW0T,EAAe1T,SAAS1L,KAAKof,GAE7Cnf,OAAOof,iBAAiBxY,KAAM,CAC1B/G,MAAO,CACHF,IAAK,WAAM,OAAAwf,EAAetf,OAC1BwF,IAAK,SAAC+F,GAAsB,OAAA+T,EAAetf,MAAQuL,OAMnE,UAAeiU","file":"easydropdown.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"easydropdown\"] = factory();\n\telse\n\t\troot[\"easydropdown\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 21);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar merge_1 = require(\"./merge\");\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nexports.ArrayStrategy = ArrayStrategy_1.default;\nexports.default = merge_1.default;\n//# sourceMappingURL=index.js.map","import Config from '../../Config/Config';\nimport Dom from '../../Renderer/Dom';\nimport IActions from '../../State/Interfaces/IActions';\n\nimport detectBodyCollision from './detectBodyCollision';\nimport IDispatchOpen from './Interfaces/IDispatchOpen';\n\nfunction dispatchOpen(\n injectedDetectBodyCollision: typeof detectBodyCollision,\n actions: IActions,\n config: Config,\n dom: Dom\n): void {\n const collisionData = injectedDetectBodyCollision(dom, config);\n\n const maxVisibleItems = collisionData.maxVisibleItemsOverride > -1 ?\n collisionData.maxVisibleItemsOverride : config.behavior.maxVisibleItems;\n\n const isScrollable = dom.item.length > maxVisibleItems;\n const maxBodyHeight = dom.sumItemsHeight(maxVisibleItems);\n\n actions.open(maxBodyHeight, collisionData.type, isScrollable);\n}\n\nconst boundDispatchOpen: IDispatchOpen = dispatchOpen.bind(null, detectBodyCollision);\n\nexport {\n boundDispatchOpen as default,\n dispatchOpen\n};","function composeClassName(tokens: Array<string|[boolean, string]>): string {\n return tokens\n .reduce((classNames, token) => {\n if (typeof token === 'string') classNames.push(token);\n else {\n const [predicate, className] = token;\n\n if (predicate) classNames.push(className);\n }\n\n return classNames;\n }, [])\n .join(' ');\n}\n\nexport default composeClassName;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArrayStrategy;\n(function (ArrayStrategy) {\n ArrayStrategy[\"PUSH\"] = \"PUSH\";\n ArrayStrategy[\"REPLACE\"] = \"REPLACE\";\n})(ArrayStrategy || (ArrayStrategy = {}));\nexports.default = ArrayStrategy;\n//# sourceMappingURL=ArrayStrategy.js.map","/**\n * Returns the closest parent of a given element matching the\n * provided selector, optionally including the element itself.\n */\n\nfunction closestParent(\n el: HTMLElement,\n selector: string,\n includeSelf: boolean = false\n): HTMLElement {\n let parent = el.parentNode as HTMLElement;\n\n if (includeSelf && el.matches(selector)) {\n return el;\n }\n\n while (parent && parent !== document.body) {\n if (parent.matches && parent.matches(selector)) {\n return parent;\n } else if (parent.parentNode) {\n parent = parent.parentNode as HTMLElement;\n } else {\n return null;\n }\n }\n\n return null;\n}\n\nexport default closestParent;","export const OPTION = '[data-ref~=\"option\"]';","import IHandlerParams from '../../Events/Interfaces/IHandlerParams';\n\nconst killSelectReaction = (select: HTMLSelectElement, {actions, timers}: IHandlerParams): void => {\n const keyingResetDuration = 100;\n\n window.clearTimeout(timers.keyingTimeoutId);\n\n actions.keying();\n\n timers.keyingTimeoutId = window.setTimeout(() => actions.resetKeying(), keyingResetDuration);\n\n select.disabled = true;\n\n setTimeout(() => {\n select.disabled = false;\n select.focus();\n });\n};\n\nexport default killSelectReaction;","import Easydropdown from './Easydropdown';\n\nconst cache: Easydropdown[] = [];\n\nexport default cache;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Config_1 = require(\"./Config\");\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nvar deriveCustomTypeInstance_1 = require(\"./deriveCustomTypeInstance\");\nvar FluentMerge_1 = require(\"./FluentMerge\");\nvar handleMergeError_1 = require(\"./handleMergeError\");\nvar Messages = require(\"./Messages\");\nfunction merge(target, source, options) {\n if (options === void 0) { options = null; }\n var isClientSide = typeof window !== 'undefined';\n var sourceKeys = [];\n var config;\n if (options instanceof Config_1.default) {\n config = options;\n }\n else {\n config = new Config_1.default();\n }\n if (typeof options === 'boolean' && options === true) {\n config.deep = true;\n }\n else if (options && config !== options && typeof options === 'object') {\n merge(config, options);\n if ([ArrayStrategy_1.default.PUSH, ArrayStrategy_1.default.REPLACE].indexOf(config.arrayStrategy) < 0) {\n throw RangeError(Messages.INVALID_ARRAY_STRATEGY(config.arrayStrategy));\n }\n }\n if (!target || typeof target !== 'object') {\n throw new TypeError(Messages.TYPE_ERROR_TARGET(target));\n }\n if (!source || typeof source !== 'object') {\n throw new TypeError(Messages.TYPE_ERROR_SOURCE(source));\n }\n if (Array.isArray(source)) {\n if (config.arrayStrategy === ArrayStrategy_1.default.PUSH) {\n // Merge arrays via push()\n target.push.apply(target, source);\n return target;\n }\n for (var i = 0; i < source.length; i++) {\n sourceKeys.push(i.toString());\n }\n }\n else {\n sourceKeys = Object.getOwnPropertyNames(source);\n }\n for (var _i = 0, sourceKeys_1 = sourceKeys; _i < sourceKeys_1.length; _i++) {\n var key = sourceKeys_1[_i];\n var descriptor = Object.getOwnPropertyDescriptor(source, key);\n // Skip read-only properties\n if (typeof descriptor.get === 'function' && !descriptor.set && !config.includeReadOnly)\n continue;\n // Skip non-enumerable properties\n if (!descriptor.enumerable && !config.includeNonEmurable)\n continue;\n if (!config.deep ||\n typeof source[key] !== 'object' ||\n (isClientSide && source[key] instanceof window.Node) ||\n (isClientSide && source[key] === window.document.body) ||\n (isClientSide && source[key] === window.document.documentElement) ||\n source[key] === null ||\n (Array.isArray(source[key]) && config.useReferenceIfArray) ||\n (!target[key] && config.useReferenceIfTargetUnset)) {\n // If:\n // - Shallow merge\n // - All non-object primatives\n // - <html>, <body>, or DOM Nodes\n // - Null pointers\n // - Arrays, if `useReferenceIfArray` set\n // - Target prop null or undefined and `useRererenceIfTargetUnset` set\n try {\n target[key] = source[key];\n }\n catch (err) {\n handleMergeError_1.default(err, target, key, config.errorMessage);\n }\n }\n else {\n // Deep merge objects/arrays\n if (!Object.prototype.hasOwnProperty.call(target, key) || target[key] === null) {\n // If property does not exist on target, instantiate an empty\n // object, custom type or array to merge into\n try {\n target[key] = Array.isArray(source[key]) ?\n [] : config.preserveTypeIfTargetUnset ?\n deriveCustomTypeInstance_1.default(source[key]) : {};\n }\n catch (err) {\n handleMergeError_1.default(err, target, key, config.errorMessage);\n }\n }\n // Recursively deep copy objects or arrays\n merge(target[key], source[key], config);\n }\n }\n return target;\n}\nvar createFluent = function (method) { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = new FluentMerge_1.default())[method].apply(_a, args);\n var _a;\n}; };\nObject\n .keys(FluentMerge_1.default.prototype)\n .forEach(function (method) { return merge[method] = createFluent(method); });\nexports.default = merge;\n//# sourceMappingURL=merge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MERGE_ERROR = function (offender, suggestion) {\n if (suggestion === void 0) { suggestion = ''; }\n return \"Unknown property \\\"\" + offender + \"\\\"\" + (suggestion ? \". Did you mean \\\"\" + suggestion + \"\\\"?\" : '');\n};\nexports.TYPE_ERROR_TARGET = function (target) {\n return \"[Helpful Merge] Target \\\"\" + target + \"\\\" must be a valid object\";\n};\nexports.TYPE_ERROR_SOURCE = function (source) {\n return \"[Helpful Merge] Source \\\"\" + source + \"\\\" must be a valid object\";\n};\nexports.INVALID_ARRAY_STRATEGY = function (strategy) {\n return \"[Helpful Merge] Invalid array strategy \\\"\" + strategy + \"\\\"\";\n};\n//# sourceMappingURL=Messages.js.map","import Behavior from './Behavior';\nimport Callbacks from './Callbacks';\nimport ClassNames from './ClassNames';\nimport IConfig from './Interfaces/IConfig';\n\nclass Config implements IConfig {\n public callbacks = new Callbacks();\n public classNames = new ClassNames();\n public behavior = new Behavior();\n\n constructor() {\n Object.seal(this);\n }\n}\n\nexport default Config;","enum CollisionType {\n NONE = 'NONE',\n TOP = 'TOP',\n BOTTOM = 'BOTTOM'\n}\n\nexport default CollisionType;","function getIsMobilePlatform(userAgent: string): boolean {\n const isIos = /(ipad|iphone|ipod)/gi.test(userAgent);\n const isAndroid = /android/gi.test(userAgent);\n const isOperaMini = /opera mini/gi.test(userAgent);\n const isWindowsPhone = /windows phone/gi.test(userAgent);\n\n if (isIos || isAndroid || isOperaMini || isWindowsPhone) {\n return true;\n }\n\n return false;\n}\n\nexport default getIsMobilePlatform;","export const UP = 38;\nexport const DOWN = 40;\nexport const SPACE = 32;\nexport const ENTER = 13;\nexport const ESC = 27;","import IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleWindowClick(_, {state, actions, dom}: IHandlerParams): void {\n if (!state.isOpen) return;\n\n actions.close();\n\n dom.select.blur();\n}\n\nexport default handleWindowClick;","enum AttributeChangeType {\n ADD = 'ADD',\n EDIT = 'EDIT',\n REMOVE = 'REMOVE'\n}\n\nexport default AttributeChangeType;","export enum DomChangeType {\n NONE = 'NONE',\n FULL = 'FULL',\n REPLACE = 'REPLACE',\n INNER = 'INNER',\n OUTER = 'OUTER'\n}\n\nexport default DomChangeType;","enum BodyStatus {\n CLOSED = 'CLOSED',\n OPEN_ABOVE = 'OPEN_ABOVE',\n OPEN_BELOW = 'OPEN_BELOW'\n}\n\nexport default BodyStatus;","enum ScrollStatus {\n AT_TOP = 'AT_TOP',\n SCROLLED = 'SCROLLED',\n AT_BOTTOM = 'AT_BOTTOM'\n}\n\nexport default ScrollStatus;","import Option from './Option';\n\nclass Group {\n public label: string = '';\n public options: Option[] = [];\n public isDisabled: boolean = false;\n\n public get totalOptions(): number {\n return this.options.length;\n }\n\n public get hasLabel(): boolean {\n return this.label !== '';\n }\n}\n\nexport default Group;","class Option {\n public label: string = '';\n public value: string = '';\n public isDisabled: boolean = false;\n}\n\nexport default Option;","import 'custom-event-polyfill';\n\nimport './Shared/Polyfills/Element.matches';\n\nimport factory from './Easydropdown/factory';\n\nmodule.exports = factory;","// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\n(function() {\n if (typeof window === 'undefined') {\n return;\n }\n\n try {\n var ce = new window.CustomEvent('test', { cancelable: true });\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n } catch (e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(\n event,\n params.bubbles,\n params.cancelable,\n params.detail\n );\n origPrevent = evt.preventDefault;\n evt.preventDefault = function() {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n } catch (e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n }\n})();\n","if (!Element.prototype.matches) {\n Element.prototype.matches = (Element.prototype as any).msMatchesSelector;\n}","import IConfig from '../Config/Interfaces/IConfig';\n\nimport cache from './cache';\nimport Easydropdown from './Easydropdown';\nimport EasydropdownFacade from './EasydropdownFacade';\nimport IFactory from './Interfaces/IFactory';\n\nfunction factory(\n selectElementOrSelector: (HTMLSelectElement|string),\n options: IConfig = {}\n): EasydropdownFacade {\n let selectElement = selectElementOrSelector;\n\n if (typeof selectElementOrSelector === 'string') {\n selectElement = document.querySelector(selectElementOrSelector) as HTMLSelectElement;\n }\n\n if (!(selectElement instanceof HTMLSelectElement)) {\n throw new TypeError('[EasyDropDown] Invalid select element provided');\n }\n\n if (selectElement.multiple) {\n throw new Error(\n '[EasyDropDown] EasyDropDown does not support the `multiple`' +\n ' attribute on select elements.'\n );\n }\n\n for (const cachedInstance of cache) {\n if (cachedInstance.selectElement === selectElement) {\n return new EasydropdownFacade(cachedInstance);\n }\n }\n\n const instance = new Easydropdown(selectElement, options);\n\n // @ts-ignore\n\n cache.push(instance);\n\n return new EasydropdownFacade(instance);\n}\n\nfunction decorateFactory(factoryFn: any): IFactory {\n factoryFn.all = (options: IConfig = {}) => {\n const selects = document.querySelectorAll('select');\n\n Array.prototype.forEach.call(selects, select => {\n const instance = factory(select, options);\n\n return instance;\n });\n };\n\n factoryFn.destroy = () => {\n const cacheCopy = cache.slice();\n\n cacheCopy.forEach(instance => instance.destroy());\n };\n\n return factoryFn;\n}\n\nconst decoratedFactory = decorateFactory(factory);\n\nexport default decoratedFactory;","import merge from 'helpful-merge';\n\nimport Config from '../Config/Config';\nimport ICallback from '../Config/Interfaces/ICallback';\nimport IConfig from '../Config/Interfaces/IConfig';\nimport bindEvents from '../Events/bindEvents';\nimport EventBinding from '../Events/EventBinding';\nimport Dom from '../Renderer/Dom';\nimport Renderer from '../Renderer/Renderer';\nimport dispatchOpen from '../Shared/Util/dispatchOpen';\nimport pollForSelectChange from '../Shared/Util/pollForSelectChange';\nimport pollForSelectMutation from '../Shared/Util/pollForSelectMutation';\nimport closeOthers from '../State/InjectedActions/closeOthers';\nimport scrollToView from '../State/InjectedActions/scrollToView';\nimport IActions from '../State/Interfaces/IActions';\nimport State from '../State/State';\nimport StateManager from '../State/StateManager';\nimport StateMapper from '../State/StateMapper';\n\nimport cache from './cache';\nimport Timers from './Timers';\n\nclass Easydropdown {\n public actions: IActions;\n\n private config: Config;\n private state: State;\n private dom: Dom;\n private eventBindings: EventBinding[];\n private renderer: Renderer;\n private timers: Timers;\n\n constructor(selectElement: HTMLSelectElement, options: IConfig) {\n this.config = merge(new Config(), options, true);\n this.state = StateMapper.mapFromSelect(selectElement, this.config);\n this.renderer = new Renderer(this.config.classNames);\n this.dom = this.renderer.render(this.state, selectElement);\n this.timers = new Timers();\n\n this.actions = StateManager.proxyActions(this.state, {\n closeOthers: closeOthers.bind(null, this, cache),\n scrollToView: scrollToView.bind(null, this.dom, this.timers)\n }, this.handleStateUpdate.bind(this));\n\n this.eventBindings = bindEvents({\n actions: this.actions,\n config: this.config,\n dom: this.dom,\n state: this.state,\n timers: this.timers\n });\n\n this.timers.pollChangeIntervalId = pollForSelectChange(this.dom.select, this.state, this.actions, this.config);\n\n if (this.config.behavior.liveUpdates) {\n this.timers.pollMutationIntervalId = pollForSelectMutation(\n this.dom.select,\n this.state,\n this.refresh.bind(this)\n );\n }\n }\n\n public get selectElement(): HTMLSelectElement {\n return this.dom.select;\n }\n\n public get value(): string {\n return this.state.value;\n }\n\n public set value(nextValue: string) {\n if (typeof nextValue !== 'string') {\n throw new TypeError('[EasyDropDown] Provided value not a valid string');\n }\n\n this.dom.select.value = nextValue;\n }\n\n public open(): void {\n dispatchOpen(this.actions, this.config, this.dom);\n }\n\n public close(): void {\n this.actions.close();\n }\n\n public refresh(): void {\n this.state = merge(\n this.state,\n StateMapper.mapFromSelect(this.dom.select, this.config)\n );\n\n this.renderer.update(this.state);\n\n this.dom.group.length = this.dom.option.length = this.dom.item.length = 0;\n\n Renderer.queryDomRefs(this.dom, ['group', 'option', 'item']);\n }\n\n public validate(): boolean {\n if (!this.state.isRequired || this.state.hasValue) {\n return true;\n }\n\n this.actions.invalidate();\n\n return false;\n }\n\n public destroy(): void {\n this.timers.clear();\n this.eventBindings.forEach(binding => binding.unbind());\n this.renderer.destroy();\n\n const cacheIndex = cache.indexOf(this);\n\n cache.splice(cacheIndex, 1);\n }\n\n private handleStateUpdate(state: State, key: keyof State): void {\n const {callbacks} = this.config;\n\n this.renderer.update(state, key);\n\n switch (key) {\n case 'bodyStatus': {\n let cb: ICallback;\n\n if (state.isOpen) {\n cb = callbacks.onOpen;\n } else {\n cb = callbacks.onClose;\n }\n\n if (typeof cb === 'function') cb();\n\n break;\n }\n case 'selectedIndex': {\n const cb = callbacks.onSelect;\n\n if (typeof cb === 'function') cb(state.value);\n\n break;\n }\n case 'isClickSelecting': {\n const cb = callbacks.onOptionClick;\n\n if (state[key] === false) {\n const nextValue = state.getOptionFromIndex(state.focusedIndex).value;\n\n if (typeof cb === 'function') cb(nextValue);\n }\n }\n }\n }\n}\n\nexport default Easydropdown;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ArrayStrategy_1 = require(\"./Constants/ArrayStrategy\");\nvar Messages = require(\"./Messages\");\nvar Config = /** @class */ (function () {\n function Config() {\n this.deep = false;\n this.useReferenceIfTargetUnset = false;\n this.useReferenceIfArray = false;\n this.preserveTypeIfTargetUnset = false;\n this.includeReadOnly = false;\n this.includeNonEmurable = false;\n this.arrayStrategy = ArrayStrategy_1.default.REPLACE;\n this.errorMessage = Messages.MERGE_ERROR;\n Object.seal(this);\n }\n return Config;\n}());\nexports.default = Config;\n//# sourceMappingURL=Config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction deriveCustoTypeInstance(_a) {\n var constructor = _a.constructor;\n if (typeof constructor === 'function' && constructor !== Object) {\n return new constructor();\n }\n return {};\n}\nexports.default = deriveCustoTypeInstance;\n//# sourceMappingURL=deriveCustomTypeInstance.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar merge_1 = require(\"./merge\");\nvar FluentMerge = /** @class */ (function () {\n function FluentMerge() {\n this.target = null;\n this.sources = [];\n this.config = {};\n }\n /**\n * Supplies a fluent merge instance with a target object to merge into and return.\n */\n FluentMerge.prototype.to = function (target) {\n this.target = target;\n return this;\n };\n /**\n * Supplies a fluent merge instance with one or more source objects to merge from, in right to left order.\n */\n FluentMerge.prototype.from = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n this.sources = sources;\n return this;\n };\n /**\n * Supplies a fluent merge instance with a configuration object of one or more options.\n */\n FluentMerge.prototype.with = function (options) {\n this.config = options;\n return this;\n };\n /**\n * Executes a fluent merge instance, merging all provided sources into the\n * target, as per any provided configuration, and returning a reference to\n * the target.\n */\n FluentMerge.prototype.exec = function () {\n var _this = this;\n return this.sources.reduce(function (target, source) { return merge_1.default(target, source, _this.config); }, this.target || {});\n };\n return FluentMerge;\n}());\nexports.default = FluentMerge;\n//# sourceMappingURL=FluentMerge.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction handleMergeError(err, target, offendingKey, message) {\n // Rethrow if any of the following:\n // - offending key already exists on target\n // - object not sealed\n // - is extensible\n // - error not a TypeError\n if (Object.hasOwnProperty.call(target, offendingKey) ||\n !Object.isSealed(target) ||\n Object.isExtensible(target) ||\n !(err instanceof TypeError))\n throw err;\n var reducer = reduceBestMatch.bind(null, offendingKey, offendingKey.toLowerCase());\n var primer = { key: '', delta: Infinity, totalMatching: 0 };\n // Iterate through keys in target, for each key, compare with\n // the offending key. Greatest number of matching characters wins.\n var bestMatch = Object.keys(target).reduce(reducer, primer);\n var suggestion = bestMatch && bestMatch.totalMatching > 1 ? bestMatch.key : '';\n throw new TypeError(message(offendingKey, suggestion));\n}\n/**\n * Compares current key with current best match.\n */\nfunction reduceBestMatch(offendingKeyLower, offendingKey, currBestMatch, currKey) {\n var totalMatching = getTotalMatching(currKey.toLowerCase(), offendingKeyLower);\n var delta = Math.abs(currKey.length - offendingKey.length);\n if (totalMatching > currBestMatch.totalMatching ||\n (totalMatching === currBestMatch.totalMatching && delta < currBestMatch.delta)) {\n // If a greater number of matching characters, or the same\n // number, but a lesser delta, usurp the best match\n return { key: currKey, delta: delta, totalMatching: totalMatching };\n }\n return currBestMatch;\n}\n/**\n * Returns the number of common, consecutive characters\n * between two strings.\n */\nfunction getTotalMatching(possibleKey, offendingKey) {\n var longer = possibleKey.length > offendingKey.length ? possibleKey : offendingKey;\n var shorter = longer === possibleKey ? offendingKey : possibleKey;\n var leftPointer = 0;\n var leftInnerPointer = 0;\n var leftTotalMatching = 0;\n var lastCommonIndex = -1;\n for (; leftPointer < longer.length; leftPointer++) {\n while (leftTotalMatching === 0 &&\n longer[leftPointer] !== shorter[leftInnerPointer] &&\n leftInnerPointer < shorter.length) {\n // No match at present, move innerPointer through all possible\n // indices until a match is found\n leftInnerPointer++;\n }\n if (longer[leftPointer] === shorter[leftInnerPointer]) {\n // Match found\n if (lastCommonIndex !== leftPointer - 1) {\n // If beginning of a new match, reset total common\n leftTotalMatching = 0;\n }\n lastCommonIndex = leftPointer;\n leftTotalMatching++;\n leftInnerPointer++;\n // Whole word matched, end\n if (leftTotalMatching === shorter.length)\n break;\n }\n else if (leftTotalMatching > 1) {\n // No match, but at least two common characters found, end\n break;\n }\n else {\n // No match at this index, reset\n leftTotalMatching = leftInnerPointer = 0;\n }\n }\n lastCommonIndex = -1;\n var rightPointer = 0;\n var rightInnerPointer = 0;\n var rightTotalMatching = 0;\n var longerLastIndex = longer.length - 1;\n var shorterLastIndex = shorter.length - 1;\n // As above, but from right to left\n for (; rightPointer < longer.length - leftPointer; rightPointer++) {\n while (rightTotalMatching === 0 &&\n longer[longerLastIndex - rightPointer] !== shorter[shorterLastIndex - rightInnerPointer] &&\n rightInnerPointer < shorter.length) {\n rightInnerPointer++;\n }\n if (longer[longerLastIndex - rightPointer] === shorter[shorterLastIndex - rightInnerPointer]) {\n if (lastCommonIndex !== rightPointer - 1)\n rightTotalMatching = 0;\n lastCommonIndex = rightPointer;\n rightTotalMatching++;\n rightInnerPointer++;\n }\n else if (rightTotalMatching > 1) {\n break;\n }\n else {\n rightTotalMatching = rightInnerPointer = 0;\n }\n }\n return Math.min(shorter.length, leftTotalMatching + rightTotalMatching);\n}\nexports.getTotalMatching = getTotalMatching;\nexports.default = handleMergeError;\n//# sourceMappingURL=handleMergeError.js.map","import IBehavior from './Interfaces/IBehavior';\n\nclass Behavior implements IBehavior {\n public showPlaceholderWhenOpen: boolean = false;\n public openOnFocus: boolean = false;\n public closeOnSelect: boolean = true;\n public useNativeUiOnMobile: boolean = true;\n public loop: boolean = false;\n public clampMaxVisibleItems: boolean = true;\n public liveUpdates: boolean = false;\n public maxVisibleItems: number = 15;\n\n constructor() {\n Object.seal(this);\n }\n}\n\nexport default Behavior;","import ICallback from './Interfaces/ICallback';\nimport ISelectCallback from './Interfaces/ISelectCallback';\n\nclass Callbacks {\n public onOpen: ICallback = null;\n public onClose: ICallback = null;\n public onSelect: ISelectCallback = null;\n public onOptionClick: ISelectCallback = null;\n\n constructor() {\n Object.seal(this);\n }\n}\n\nexport default Callbacks;","import IClassNames from './Interfaces/IClassNames';\n\nclass ClassNames implements IClassNames {\n public root: string = 'edd-root';\n public rootOpen: string = 'edd-root-open';\n public rootOpenAbove: string = 'edd-root-open-above';\n public rootOpenBelow: string = 'edd-root-open-below';\n public rootDisabled: string = 'edd-root-disabled';\n public rootInvalid: string = 'edd-root-invalid';\n public rootFocused: string = 'edd-root-focused';\n public rootHasValue: string = 'edd-root-has-value';\n public rootNative: string = 'edd-root-native';\n public gradientTop: string = 'edd-gradient-top';\n public gradientBottom: string = 'edd-gradient-bottom';\n public head: string = 'edd-head';\n public value: string = 'edd-value';\n public arrow: string = 'edd-arrow';\n public select: string = 'edd-select';\n public body: string = 'edd-body';\n public bodyScrollable: string = 'edd-body-scrollable';\n public bodyAtTop: string = 'edd-body-at-top';\n public bodyAtBottom: string = 'edd-body-at-bottom';\n public itemsList: string = 'edd-items-list';\n public group: string = 'edd-group';\n public groupDisabled: string = 'edd-group-disabled';\n public groupHasLabel: string = 'edd-group-has-label';\n public groupLabel: string = 'edd-group-label';\n public option: string = 'edd-option';\n public optionDisabled: string = 'edd-option-disabled';\n public optionFocused: string = 'edd-option-focused';\n public optionSelected: string = 'edd-option-selected';\n\n constructor() {\n Object.seal(this);\n }\n}\n\nexport default ClassNames;","import throttle from '../Shared/Util/throttle';\n\nimport EventBinding from './EventBinding';\nimport getEventsList from './getEventsList';\nimport IEventBinding from './Interfaces/IEventBinding';\nimport IHandlerParams from './Interfaces/IHandlerParams';\n\nfunction bindEvent(handlerParams: IHandlerParams, eventBindingRaw: IEventBinding): EventBinding {\n const eventBinding = new EventBinding(eventBindingRaw);\n\n if (!eventBinding.target) return eventBinding;\n\n const boundHandler = (e) => eventBinding.handler(e, handlerParams);\n\n if (eventBinding.throttle > 0) {\n eventBinding.boundHandler = throttle(boundHandler, eventBinding.throttle);\n } else {\n eventBinding.boundHandler = boundHandler;\n }\n\n eventBinding.target.addEventListener(eventBinding.type, eventBinding.boundHandler);\n\n return eventBinding;\n}\n\nfunction bindEvents(handlerParams: IHandlerParams): EventBinding[] {\n return getEventsList(handlerParams.dom).map(bindEvent.bind(null, handlerParams));\n}\n\nexport {\n bindEvents as default,\n bindEvent\n};","function throttle(\n handler: (...args: any[]) => void,\n delay: number\n): (...args: any[]) => void {\n let timerId = null;\n let last: number = -Infinity;\n\n return function(...args): void {\n const now = Date.now();\n\n const later = () => {\n timerId = null;\n\n handler.apply(this, args);\n\n last = now;\n };\n\n const difference = now - last;\n\n if (difference >= delay) {\n later();\n } else {\n clearTimeout(timerId);\n\n timerId = setTimeout(later, delay - difference);\n }\n };\n}\n\nexport default throttle;","import merge from 'helpful-merge';\n\nimport IEventBinding from './Interfaces/IEventBinding';\nimport IEventHandler from './Interfaces/IEventHandler';\n\nclass EventBinding implements IEventBinding {\n public type: string = '';\n public target: HTMLElement = null;\n public debounce: number = 0;\n public throttle: number = 0;\n public handler: IEventHandler = null;\n public boundHandler: EventListener = null;\n public passive: boolean = false;\n\n constructor(eventBindingRaw: IEventBinding|string) {\n merge(this, eventBindingRaw);\n\n Object.seal(this);\n }\n\n public unbind(): void {\n if (!this.target) return;\n\n this.target.removeEventListener(this.type, this.boundHandler);\n }\n}\n\nexport default EventBinding;","import Dom from '../Renderer/Dom';\n\nimport handleBodyClick from './Handlers/handleBodyClick';\nimport handleBodyMousedown from './Handlers/handleBodyMousedown';\nimport handleBodyMouseover from './Handlers/handleBodyMouseover';\nimport handleHeadClick from './Handlers/handleHeadClick';\nimport handleItemsListScroll from './Handlers/handleItemsListScroll';\nimport handleSelectBlur from './Handlers/handleSelectBlur';\nimport handleSelectFocus from './Handlers/handleSelectFocus';\nimport handleSelectInvalid from './Handlers/handleSelectInvalid';\nimport handleSelectKeydown from './Handlers/handleSelectKeydown';\nimport handleSelectKeypress from './Handlers/handleSelectKeypress';\nimport handleWindowClick from './Handlers/handleWindowClick';\nimport handleWindowResize from './Handlers/handleWindowClick';\nimport IEventBinding from './Interfaces/IEventBinding';\n\nconst getEventsList = (dom: Dom): IEventBinding[] => [\n {\n target: dom.head,\n type: 'click',\n handler: handleHeadClick\n },\n {\n target: dom.body,\n type: 'mousedown',\n handler: handleBodyMousedown\n },\n {\n target: dom.body,\n type: 'click',\n handler: handleBodyClick\n },\n {\n target: dom.body,\n type: 'mouseover',\n handler: handleBodyMouseover\n },\n {\n target: dom.itemsList,\n type: 'scroll',\n handler: handleItemsListScroll\n },\n {\n target: dom.select,\n type: 'keydown',\n handler: handleSelectKeydown\n },\n {\n target: dom.select,\n type: 'invalid',\n handler: handleSelectInvalid\n },\n {\n target: dom.select,\n type: 'keypress',\n handler: handleSelectKeypress\n },\n {\n target: dom.select,\n type: 'focus',\n handler: handleSelectFocus\n },\n {\n target: dom.select,\n type: 'blur',\n handler: handleSelectBlur\n },\n {\n target: document.documentElement,\n type: 'click',\n handler: handleWindowClick\n },\n {\n target: window,\n type: 'resize',\n handler: handleWindowResize,\n throttle: 100\n }\n];\n\nexport default getEventsList;","import closestParent from '../../Shared/Util/closestParent';\nimport * as Selectors from '../Constants/Selectors';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleBodyClick(e: Event, {state, actions, dom, config}: IHandlerParams): void {\n e.stopPropagation();\n\n const option = closestParent(e.target as HTMLElement, Selectors.OPTION, true);\n\n if (!option) return;\n\n const optionIndex = Array.prototype.indexOf.call(dom.option, option);\n\n actions.selectOption(optionIndex, config.behavior.closeOnSelect);\n}\n\nexport default handleBodyClick;","import closestParent from '../../Shared/Util/closestParent';\nimport * as Selectors from '../Constants/Selectors';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleBodyMousedown(e: Event, {actions}: IHandlerParams): void {\n e.stopPropagation();\n\n const option = closestParent(e.target as HTMLElement, Selectors.OPTION, true);\n\n if (!option) return;\n\n actions.startClickSelecting();\n}\n\nexport default handleBodyMousedown;","import closestParent from '../../Shared/Util/closestParent';\nimport * as Selectors from '../Constants/Selectors';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleBodyMouseover(e: Event, {state, actions, dom}: IHandlerParams): void {\n e.stopPropagation();\n\n const option = closestParent(e.target as HTMLElement, Selectors.OPTION, true);\n\n if (!option || state.isKeying) return;\n\n const optionIndex = Array.prototype.indexOf.call(dom.option, option);\n\n actions.focusOption(optionIndex);\n}\n\nexport default handleBodyMouseover;","import dispatchOpen from '../../Shared/Util/dispatchOpen';\nimport getIsMobilePlatform from '../../Shared/Util/getIsMobilePlatform';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleHeadClick(\n injectedGetIsMobilePlatform: (ua: string) => boolean,\n e: MouseEvent,\n {state, actions, dom, config}: IHandlerParams\n): void {\n if (state.isUseNativeMode) return;\n\n const isMobilePlatform = injectedGetIsMobilePlatform(window.navigator.userAgent);\n\n e.stopPropagation();\n\n if (state.isClosed) {\n dispatchOpen(actions, config, dom);\n\n if (isMobilePlatform) {\n actions.focus();\n } else {\n dom.select.focus();\n }\n } else {\n actions.close();\n }\n}\n\nconst boundHandleHeadClick = handleHeadClick.bind(null, getIsMobilePlatform);\n\nexport {\n boundHandleHeadClick as default,\n handleHeadClick\n};","import Config from '../../Config/Config';\nimport Dom from '../../Renderer/Dom';\n\nimport CollisionType from './Constants/CollisionType';\nimport ICollisionData from './Interfaces/ICollisionData';\n\nconst CLEARSPACE = 10;\n\nfunction mapCollisionData(deltaTop, deltaBottom, maxHeight, itemHeight): ICollisionData {\n let type = CollisionType.NONE;\n let maxVisibleItemsOverride = -1;\n\n if (deltaTop <= maxHeight && deltaBottom <= maxHeight) {\n const largestDelta = Math.max(deltaBottom, deltaTop);\n\n type = deltaTop < deltaBottom ? CollisionType.TOP : CollisionType.BOTTOM;\n maxVisibleItemsOverride = Math.floor(largestDelta / itemHeight);\n } else if (deltaTop <= maxHeight) {\n type = CollisionType.TOP;\n } else if (deltaBottom <= maxHeight) {\n type = CollisionType.BOTTOM;\n }\n\n return {type, maxVisibleItemsOverride};\n}\n\nfunction detectBodyCollision(dom: Dom, config: Config): ICollisionData {\n const bbHead = dom.head.getBoundingClientRect();\n const wh = window.innerHeight;\n const deltaTop = bbHead.top - CLEARSPACE;\n const deltaBottom = wh - bbHead.bottom - CLEARSPACE;\n\n if (dom.option.length < 1) return {\n type: CollisionType.NONE,\n maxVisibleItemsOverride: -1\n };\n\n const maxVisibleItems = Math.min(config.behavior.maxVisibleItems, dom.item.length);\n const maxHeight = dom.sumItemsHeight(maxVisibleItems);\n const itemHeight = dom.sumItemsHeight(1);\n\n return mapCollisionData(deltaTop, deltaBottom, maxHeight, itemHeight);\n}\n\nexport {\n detectBodyCollision as default,\n mapCollisionData\n};","import IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleItemsListScroll(e: Event, {state, actions, dom}: IHandlerParams): void {\n e.stopPropagation();\n\n const {offsetHeight, scrollHeight, scrollTop} = dom.itemsList;\n\n if (scrollTop === 0) {\n actions.topOut();\n } else if (scrollTop === scrollHeight - offsetHeight) {\n actions.bottomOut();\n } else {\n actions.scroll();\n }\n}\n\nexport default handleItemsListScroll;","import IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleSelectBlur(e: Event, {actions, state, config}: IHandlerParams): void {\n if (state.isKeying) return;\n\n actions.blur();\n\n if (config.behavior.openOnFocus && !state.isClickSelecting) actions.close();\n}\n\nexport default handleSelectBlur;","import dispatchOpen from '../../Shared/Util/dispatchOpen';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleSelectFocus(e: Event, {actions, config, dom, state}: IHandlerParams): void {\n actions.focus();\n\n if (config.behavior.openOnFocus && !state.isUseNativeMode) {\n dispatchOpen(actions, config, dom);\n }\n}\n\nexport default handleSelectFocus;","import IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleSelectInvalid(e: Event, {actions, config, dom}: IHandlerParams): void {\n actions.invalidate();\n}\n\nexport default handleSelectInvalid;","import dispatchOpen from '../../Shared/Util/dispatchOpen';\nimport killSelectReaction from '../../Shared/Util/killSelectReaction';\nimport * as KeyCodes from '../Constants/KeyCodes';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nimport handleSelectKeydownDown from './handleSelectKeydownDown';\nimport handleSelectKeydownUp from './handleSelectKeydownUp';\n\nfunction handleSelectKeydown(e: KeyboardEvent, handlerParams: IHandlerParams): void {\n const {keyCode, target} = e;\n const {state, actions, dom, config} = handlerParams;\n\n if (state.isUseNativeMode || state.isDisabled) return;\n\n switch (keyCode) {\n case KeyCodes.DOWN:\n handleSelectKeydownDown(e, handlerParams);\n\n break;\n case KeyCodes.UP:\n handleSelectKeydownUp(e, handlerParams);\n\n break;\n case KeyCodes.SPACE:\n if (state.isSearching) {\n e.stopPropagation();\n\n return;\n }\n\n case KeyCodes.ENTER:\n e.stopPropagation();\n e.preventDefault();\n\n killSelectReaction(target as HTMLSelectElement, handlerParams);\n\n if (state.isOpen) {\n actions.selectOption(state.focusedIndex, config.behavior.closeOnSelect);\n } else {\n dispatchOpen(actions, config, dom);\n }\n\n break;\n case KeyCodes.ESC:\n actions.close();\n\n break;\n }\n}\n\nexport default handleSelectKeydown;","import dispatchOpen from '../../Shared/Util/dispatchOpen';\nimport killSelectReaction from '../../Shared/Util/killSelectReaction';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleSelectKeydownDown(\n e: KeyboardEvent,\n handlerParams: IHandlerParams\n): void {\n const {metaKey, target} = e;\n const {state, dom, actions, config} = handlerParams;\n\n let focusedIndex: number = state.focusedIndex > -1 ?\n state.focusedIndex : state.selectedIndex;\n\n let iterations: number = 0;\n let incrementAmount: number = 1;\n\n e.preventDefault();\n\n killSelectReaction(target as HTMLSelectElement, handlerParams);\n\n if (metaKey) {\n incrementAmount = Math.round(\n Math.max(state.totalOptions / 2, config.behavior.maxVisibleItems)\n );\n }\n\n do {\n focusedIndex += incrementAmount;\n\n incrementAmount = 1;\n\n if (focusedIndex >= state.totalOptions) {\n focusedIndex = config.behavior.loop ? 0 : state.totalOptions - 1;\n }\n\n actions.focusOption(focusedIndex, true);\n\n iterations++;\n }\n while (\n state.focusedOption &&\n state.focusedOption.isDisabled &&\n iterations <= state.totalOptions\n );\n\n if (state.isClosed) {\n dispatchOpen(actions, config, dom);\n\n return;\n }\n}\n\nexport default handleSelectKeydownDown;","import dispatchOpen from '../../Shared/Util/dispatchOpen';\nimport killSelectReaction from '../../Shared/Util/killSelectReaction';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nfunction handleSelectKeydownUp(\n e: KeyboardEvent,\n handlerParams: IHandlerParams\n): void {\n const {metaKey, target} = e;\n const {state, config, dom, actions} = handlerParams;\n\n let focusedIndex = state.focusedIndex > -1 ?\n state.focusedIndex : state.selectedIndex;\n\n let iterations = 0;\n let incrementAmount: number = 1;\n\n e.preventDefault();\n\n killSelectReaction(target as HTMLSelectElement, handlerParams);\n\n if (metaKey) {\n incrementAmount = Math.round(\n Math.max(state.totalOptions / 2, config.behavior.maxVisibleItems)\n );\n }\n\n do {\n focusedIndex -= incrementAmount;\n\n incrementAmount = 1;\n\n if (focusedIndex < 0) {\n focusedIndex = config.behavior.loop ? state.totalOptions - 1 : 0;\n }\n\n actions.focusOption(focusedIndex, true);\n\n iterations++;\n }\n while (\n state.focusedOption &&\n state.focusedOption.isDisabled &&\n iterations < state.totalOptions\n );\n\n if (state.isClosed) {\n dispatchOpen(actions, config, dom);\n }\n}\n\nexport default handleSelectKeydownUp;","import * as KeyCodes from '../Constants/KeyCodes';\nimport IHandlerParams from '../Interfaces/IHandlerParams';\n\nconst SEARCH_RESET_DURATION = 1200;\n\nfunction handleSelectKeypress(\n {keyCode}: KeyboardEvent,\n {actions, timers, state}: IHandlerParams,\n searchResetDuration = SEARCH_RESET_DURATION\n): void {\n if (state.isUseNativeMode || [KeyCodes.UP, KeyCodes.DOWN].includes(keyCode)) return;\n\n window.clearTimeout(timers.searchTimeoutId);\n\n actions.search();\n\n timers.searchTimeoutId = window.setTimeout(() => actions.resetSearch(), searchResetDuration);\n}\n\nexport default handleSelectKeypress;","import root from '../Components/root';\nimport ClassNames from '../Config/ClassNames';\nimport createDomElementFromHtml from '../Shared/Util/createDomElementFromHtml';\nimport State from '../State/State';\n\nimport Dom from './Dom';\nimport domDiff from './domDiff';\nimport domPatch from './domPatch';\n\nclass Renderer {\n public classNames: ClassNames;\n public dom: Dom;\n\n constructor(classNames: ClassNames) {\n this.dom = new Dom();\n this.classNames = classNames;\n }\n\n public render(state: State, selectElement: HTMLSelectElement): Dom {\n const html = root(state, this.classNames);\n const rootElement = createDomElementFromHtml(html) as HTMLDivElement;\n\n this.dom = new Dom();\n this.dom.root = rootElement;\n\n this.dom.option.length = this.dom.group.length = 0;\n\n Renderer.queryDomRefs(this.dom);\n\n this.injectSelect(selectElement);\n\n return this.dom;\n }\n\n public update(state: State, key?: keyof State): void {\n const nextHtml = root(state, this.classNames);\n const nextRoot = createDomElementFromHtml(nextHtml) as HTMLDivElement;\n const diffCommand = domDiff(this.dom.root, nextRoot);\n\n domPatch(this.dom.root, diffCommand);\n\n if (key === 'selectedIndex') {\n this.syncSelectWithValue(state.value);\n }\n }\n\n public destroy(): void {\n this.dom.select.classList.remove(this.classNames.select);\n\n try {\n this.dom.root.parentElement.replaceChild(this.dom.select, this.dom.root);\n } catch (err) { /**/ }\n }\n\n private injectSelect(selectElement: HTMLSelectElement): void {\n const parent = selectElement.parentElement;\n const tempSelect = this.dom.select;\n\n if (!parent) throw new Error('[EasyDropDown] The provided `<select>` element must exist within a document');\n\n parent.replaceChild(this.dom.root, selectElement);\n\n tempSelect.parentElement.replaceChild(selectElement, tempSelect);\n selectElement.className = this.classNames.select;\n selectElement.setAttribute('aria-hidden', 'true');\n\n this.dom.select = selectElement;\n }\n\n private syncSelectWithValue(value: string): void {\n if (this.dom.select.value === value) return;\n\n const event = new CustomEvent('change', {\n bubbles: true\n });\n\n this.dom.select.value = value;\n\n this.dom.select.dispatchEvent(event);\n }\n\n public static queryDomRefs(dom: Dom, keys: string[] = Object.keys(dom)): Dom {\n return keys\n .reduce((localDom: Dom, ref: string) => {\n const selector = `[data-ref~=\"${ref}\"]`;\n const elements = localDom.root.querySelectorAll(selector);\n\n if (elements.length < 1 || ref === 'root') return localDom;\n\n const element = elements[0];\n const value = localDom[ref];\n\n if (value === null) {\n localDom[ref] = element;\n } else if (Array.isArray(value)) {\n Array.prototype.push.apply(value, elements);\n }\n\n return localDom;\n }, dom);\n }\n}\n\nexport default Renderer;","import ClassNames from '../Config/ClassNames';\nimport composeClassName from '../Shared/Util/composeClassName';\nimport State from '../State/State';\n\nimport body from './body';\nimport head from './head';\n\nconst root = (state: State, classNames: ClassNames) => {\n const className = composeClassName([\n classNames.root,\n [state.isDisabled, classNames.rootDisabled],\n [state.isInvalid, classNames.rootInvalid],\n [state.isOpen, classNames.rootOpen],\n [state.isFocused, classNames.rootFocused],\n [state.hasValue, classNames.rootHasValue],\n [state.isOpenAbove, classNames.rootOpenAbove],\n [state.isOpenBelow, classNames.rootOpenBelow],\n [state.isUseNativeMode, classNames.rootNative]\n ]);\n\n return (`\n <div\n class=\"${className}\"\n role=\"widget combobox\"\n aria-haspopup=\"listbox\"\n ${state.isOpen ? 'aria-expanded=\"true\"' : ''}\n ${state.isRequired ? 'aria-required=\"true\"' : ''}\n ${state.isDisabled ? 'aria-disabled=\"true\"' : ''}\n ${state.isInvalid ? 'aria-invalid=\"true\"' : ''}\n >\n ${head(state, classNames)}\n ${state.isUseNativeMode ? '' : body(state, classNames)}\n </div>\n `);\n};\n\nexport default root;","import ClassNames from '../Config/ClassNames';\nimport composeClassName from '../Shared/Util/composeClassName';\nimport State from '../State/State';\n\nimport group from './group';\n\nfunction body(state: State, classNames: ClassNames): string {\n const className = composeClassName([\n classNames.body,\n [state.isAtTop, classNames.bodyAtTop],\n [state.isAtBottom, classNames.bodyAtBottom],\n [state.isScrollable, classNames.bodyScrollable]\n ]);\n\n const styleAttr = state.isOpen ?\n `style=\"max-height: ${state.maxBodyHeight}px;\"` : '';\n\n return (`\n <div\n class=\"${className}\"\n data-ref=\"body\"\n role=\"listbox\"\n ${state.isOpen ? '' : 'aria-hidden'}\n >\n <div class=\"${classNames.itemsList}\"\n data-ref=\"itemsList\"\n ${styleAttr}>\n ${state.groups.map(groupState => group(groupState, state, classNames)).join('')}\n </div>\n <div class=${classNames.gradientTop} role=\"presentation\"></div>\n <div class=${classNames.gradientBottom} role=\"presentation\"></div>\n </div>\n `);\n}\n\nexport default body;","import ClassNames from '../Config/ClassNames';\nimport composeClassName from '../Shared/Util/composeClassName';\nimport Group from '../State/Group';\nimport State from '../State/State';\n\nimport option from './option';\n\nconst group = (groupState: Group, state: State, classNames: ClassNames) => {\n const className = composeClassName([\n classNames.group,\n [groupState.isDisabled, classNames.groupDisabled],\n [groupState.hasLabel, classNames.groupHasLabel]\n ]);\n\n return (`\n <div class=\"${className}\" data-ref=\"group\" role=\"group\">\n ${groupState.hasLabel ?\n `<div class=\"${classNames.groupLabel}\" data-ref=\"item\">${groupState.label}</div>` : ''\n }\n ${groupState.options.map(optionState => option(optionState, state, classNames)).join('')}\n </div>\n `);\n};\n\nexport default group;","import ClassNames from '../Config/ClassNames';\nimport composeClassName from '../Shared/Util/composeClassName';\nimport Option from '../State/Option';\nimport State from '../State/State';\n\nfunction option(optionState: Option, state: State, classNames: ClassNames): string {\n const isSelected = state.selectedOption === optionState;\n\n const className = composeClassName([\n classNames.option,\n [isSelected, classNames.optionSelected],\n [optionState === state.focusedOption, classNames.optionFocused],\n [optionState.isDisabled, classNames.optionDisabled]\n ]);\n\n return (`\n <div\n class=\"${className}\"\n data-ref=\"option item\"\n role=\"option\"\n title=\"${optionState.label}\"\n ${isSelected ? 'aria-selected=\"true\"' : ''}\n ${optionState.isDisabled ? 'aria-disabled=\"true\"' : ''}\n >\n ${optionState.label}\n </div>\n `);\n}\n\nexport default option;","import ClassNames from '../Config/ClassNames';\nimport State from '../State/State';\n\nimport arrow from './arrow';\nimport value from './value';\n\nconst head = (state: State, classNames: ClassNames) => (`\n <div class=\"${classNames.head}\" data-ref=\"head\">\n ${value(state, classNames)}\n ${arrow(state, classNames)}\n <select class=\"${classNames.select}\" data-ref=\"select\"></select>\n </div>\n`);\n\nexport default head;","import ClassNames from '../Config/ClassNames';\n\nconst arrow = (_, classNames: ClassNames) => `<div class=\"${classNames.arrow}\" role=\"presentation\"></div>`;\n\nexport default arrow;","import ClassNames from '../Config/ClassNames';\nimport State from '../State/State';\n\nconst value = (state: State, classNames: ClassNames) => {\n return (`\n <div\n class=\"${classNames.value}\"\n data-ref=\"value\"\n ${state.isPlaceholderShown ? `aria-placeholder=\"${state.humanReadableValue}\"` : ''}\n >\n ${state.humanReadableValue}\n </div>\n `);\n};\n\nexport default value;","function createDomElementFromHtml(html: string): Element {\n const temp = document.createElement('div');\n\n temp.innerHTML = html;\n\n return temp.firstElementChild;\n}\n\nexport default createDomElementFromHtml;","class Dom {\n public select: HTMLSelectElement = null;\n public root: HTMLDivElement = null;\n public head: HTMLDivElement = null;\n public value: HTMLDivElement = null;\n public body: HTMLDivElement = null;\n public arrow: HTMLDivElement = null;\n public itemsList: HTMLDivElement = null;\n public item: HTMLDivElement[] = [];\n public group: HTMLDivElement[] = [];\n public option: HTMLDivElement[] = [];\n\n public sumItemsHeight(max: number = Infinity): number {\n let totalHeight = 0;\n\n for (let i = 0, item; (item = this.item[i]); i++) {\n if (i === max) break;\n\n totalHeight += item.offsetHeight;\n }\n\n return totalHeight;\n }\n}\n\nexport default Dom;","import merge from 'helpful-merge';\n\nimport AttributeChangeType from './Constants/AttributeChangeType';\nimport DomChangeType from './Constants/DomChangeType';\nimport IAttributeChange from './Interfaces/IAttributeChange';\nimport IPatchCommand from './Interfaces/IPatchCommand';\nimport PatchCommand from './PatchCommand';\n\nfunction domDiff(prev: Node, next: Node): PatchCommand {\n let totalChildNodes = -1;\n\n const command = new PatchCommand();\n\n if (prev instanceof HTMLSelectElement) {\n command.type = DomChangeType.NONE;\n\n return command;\n }\n\n if (prev instanceof Text && next instanceof Text) {\n if (prev.textContent === next.textContent) {\n command.type = DomChangeType.NONE;\n } else {\n command.type = DomChangeType.INNER;\n command.newTextContent = next.textContent;\n }\n } else if (prev instanceof HTMLElement && next instanceof HTMLElement) {\n if (prev.tagName !== next.tagName) {\n command.type = DomChangeType.REPLACE;\n command.newNode = next;\n } else if (prev.outerHTML === next.outerHTML) {\n command.type = DomChangeType.NONE;\n } else if (prev.innerHTML === next.innerHTML) {\n merge(command, diffAttributeChanges(prev, next));\n } else {\n merge(command, diffAttributeChanges(prev, next));\n\n if (command.attributeChanges.length > 0) {\n command.type = DomChangeType.FULL;\n } else {\n command.type = DomChangeType.INNER;\n }\n\n if ((totalChildNodes = prev.childNodes.length) > 0 && totalChildNodes === next.childNodes.length) {\n for (let i = 0, childNode; (childNode = prev.childNodes[i]); i++) {\n command.childCommands.push(domDiff(childNode, next.childNodes[i]));\n }\n } else {\n command.newInnerHtml = next.innerHTML;\n }\n }\n } else {\n command.type = DomChangeType.REPLACE;\n command.newNode = next;\n }\n\n return command;\n}\n\nfunction diffAttributeChanges(prev: HTMLElement, next: HTMLElement): IPatchCommand {\n const totalAttributes = Math.max(prev.attributes.length, next.attributes.length);\n const attributesMap = {};\n const undef = void(0);\n const attributeChanges: IAttributeChange[] = [];\n\n for (let i = 0; i < totalAttributes; i++) {\n const attr1 = prev.attributes[i];\n const attr2 = next.attributes[i];\n\n if (attr1 && attributesMap[attr1.name] === undef) {\n attributesMap[attr1.name] = [];\n }\n\n if (attr2 && attributesMap[attr2.name] === undef) {\n attributesMap[attr2.name] = [];\n }\n\n if (attr1) attributesMap[attr1.name][0] = attr1.value;\n if (attr2) attributesMap[attr2.name][1] = attr2.value;\n }\n\n const keys = Object.keys(attributesMap);\n\n if (keys.length > 1) {\n keys.sort();\n }\n\n for (let i = 0, key; (key = keys[i]); i++) {\n const attr = attributesMap[key];\n\n const change: IAttributeChange = {\n type: null,\n name: key,\n value: null\n };\n\n if (attr[0] === attr[1]) continue;\n\n if (attr[0] === undef) {\n change.type = AttributeChangeType.ADD;\n change.value = attr[1];\n } else if (attr[1] === undef) {\n change.type = AttributeChangeType.REMOVE,\n change.value = '';\n } else {\n change.type = AttributeChangeType.EDIT,\n change.value = attr[1];\n }\n\n attributeChanges.push(change);\n }\n\n return {\n type: DomChangeType.OUTER,\n attributeChanges\n };\n}\n\nexport default domDiff;","import DomChangeType from './Constants/DomChangeType';\nimport IAttributeChange from './Interfaces/IAttributeChange';\n\nclass PatchCommand {\n public type: DomChangeType;\n public newNode: Node = null;\n public newInnerHtml: string = '';\n public newTextContent: string = '';\n public attributeChanges: IAttributeChange[] = [];\n public childCommands: PatchCommand[] = [];\n public index: number = null;\n}\n\nexport default PatchCommand;","import AttributeChangeType from './Constants/AttributeChangeType';\nimport DomChangeType from './Constants/DomChangeType';\nimport IAttributeChange from './Interfaces/IAttributeChange';\nimport PatchCommand from './PatchCommand';\n\nfunction domPatch(node: Node, command: PatchCommand): Node {\n switch (command.type) {\n case DomChangeType.NONE:\n return node;\n case DomChangeType.REPLACE:\n node.parentElement.replaceChild(command.newNode, node);\n\n return command.newNode;\n case DomChangeType.INNER:\n if (node instanceof Text) {\n node.textContent = command.newTextContent;\n } else if (command.childCommands.length > 0) {\n command.childCommands.forEach((childCommand, i) => domPatch(node.childNodes[i], childCommand));\n } else {\n (node as HTMLElement).innerHTML = command.newInnerHtml;\n }\n\n return node;\n case DomChangeType.OUTER:\n patchAttributes(node as HTMLElement, command.attributeChanges);\n\n return node;\n case DomChangeType.FULL:\n if (command.childCommands.length > 0) {\n command.childCommands.forEach((childCommand, i) => domPatch(node.childNodes[i], childCommand));\n } else {\n (node as HTMLElement).innerHTML = command.newInnerHtml;\n }\n\n patchAttributes(node as HTMLElement, command.attributeChanges);\n\n return node;\n }\n}\n\nfunction patchAttributes(el: HTMLElement, attributeChanges: IAttributeChange[]): void {\n const raf = window.requestAnimationFrame;\n\n attributeChanges.forEach(change => {\n if (raf && ['class', 'style'].indexOf(change.name) > -1) {\n raf(() => patchAttribute(el, change));\n } else {\n patchAttribute(el, change);\n }\n });\n}\n\nfunction patchAttribute(el: HTMLElement, change: IAttributeChange): void {\n switch (change.type) {\n case AttributeChangeType.ADD:\n case AttributeChangeType.EDIT:\n el.setAttribute(change.name, change.value);\n\n break;\n case AttributeChangeType.REMOVE:\n el.removeAttribute(change.name);\n\n break;\n }\n}\n\nexport default domPatch;","import Config from '../../Config/Config';\nimport IActions from '../../State/Interfaces/IActions';\nimport State from '../../State/State';\n\nconst POLL_INTERVAL_DURATION = 100;\n\nfunction pollForSelectChange(\n selectElement: HTMLSelectElement,\n state: State,\n actions: IActions,\n config: Config\n): number {\n let lastValue: string = selectElement.value;\n\n const pollIntervalId = window.setInterval(() => {\n if (selectElement.value !== lastValue) {\n const selectedIndex = state.getOptionIndexFromValue(selectElement.value);\n\n actions.selectOption(selectedIndex, config.behavior.closeOnSelect);\n actions.focusOption(selectedIndex, true);\n }\n\n lastValue = selectElement.value;\n }, POLL_INTERVAL_DURATION);\n\n return pollIntervalId;\n}\n\nexport default pollForSelectChange;","import State from '../../State/State';\n\nconst POLL_INTERVAL_DURATION = 300;\n\nfunction pollForSelectMutation(selectElement: HTMLSelectElement, state: State, handleMutation: () => void): number {\n let lastOuterHtml: string = selectElement.outerHTML;\n\n const pollIntervalId = window.setInterval(() => {\n const {outerHTML} = selectElement;\n\n if (outerHTML !== lastOuterHtml && !state.isKeying) {\n handleMutation();\n }\n\n lastOuterHtml = outerHTML;\n }, POLL_INTERVAL_DURATION);\n\n return pollIntervalId;\n}\n\nexport default pollForSelectMutation;","import Easydropdown from '../../Easydropdown/Easydropdown';\n\nfunction closeOthers(thisInstance: Easydropdown, cache: Easydropdown[]): void {\n for (const instance of cache) {\n if (instance !== thisInstance) instance.actions.close();\n }\n}\n\nexport default closeOthers;","import Timers from '../../Easydropdown/Timers';\nimport Dom from '../../Renderer/Dom';\nimport State from '../../State/State';\n\nfunction getScrollTop(\n currentScrollTop: number,\n optionOffsetTop: number,\n optionHeight: number,\n bodyHeight: number,\n scrollOffset: number\n): number {\n const max = currentScrollTop + bodyHeight;\n\n let remainder: number;\n\n if (optionOffsetTop < currentScrollTop) {\n return optionOffsetTop - scrollOffset;\n } else if ((remainder = (optionOffsetTop + optionHeight) - max) > 0) {\n return currentScrollTop + remainder + scrollOffset;\n }\n\n return currentScrollTop;\n}\n\nfunction scrollToView(dom: Dom, timers: Timers, state: State, scrollToMiddle: boolean = false): void {\n const index = Math.max(0, state.focusedIndex > -1 ? state.focusedIndex : state.selectedIndex);\n const option = dom.option[index];\n\n if (!option) return;\n\n const offset = scrollToMiddle ? (state.maxBodyHeight / 2) - (option.offsetHeight / 2) : 0;\n\n const scrollTop = getScrollTop(\n dom.itemsList.scrollTop,\n option.offsetTop,\n option.offsetHeight,\n state.maxBodyHeight,\n offset\n );\n\n if (scrollTop === dom.itemsList.scrollTop) return;\n\n dom.itemsList.scrollTop = scrollTop;\n}\n\nexport {\n getScrollTop,\n scrollToView as default\n};","import merge from 'helpful-merge';\n\nimport IActions from './Interfaces/IActions';\nimport IOnAction from './Interfaces/IOnAction';\nimport IPropertyDescriptor from './Interfaces/IPropertyDescriptor';\nimport resolveActions from './resolveActions';\nimport State from './State';\n\nclass StateManager {\n public static proxyActions(state: State, injectedActions: any, onAction: IOnAction): IActions {\n const stateProxy = StateManager.createStateProxy(state, onAction);\n const actions = resolveActions(stateProxy);\n\n merge(actions, injectedActions);\n\n return actions;\n }\n\n private static createStateProxy(state: State, onAction: IOnAction): State {\n return Object.seal(\n StateManager\n .getPropertyDescriptorsFromValue(state, onAction)\n .reduce((proxy, {key, get, set}) => Object.defineProperty(\n proxy,\n key,\n {\n enumerable: true,\n get,\n set\n }\n ), {})\n );\n }\n\n private static getPropertyDescriptorsFromValue(state: State, onAction: IOnAction): IPropertyDescriptor[] {\n const prototype = Object.getPrototypeOf(state);\n const allKeys = Object.keys(state).concat(Object.keys(prototype));\n\n return allKeys\n .reduce((localDescriptors, key) => {\n const propertyDescriptor =\n Object.getOwnPropertyDescriptor(state, key) ||\n Object.getOwnPropertyDescriptor(prototype, key);\n\n const isAccessorProperty = typeof propertyDescriptor.get === 'function';\n\n localDescriptors.push({\n get: StateManager.readPropertyValue.bind(null, state, key),\n set: isAccessorProperty ?\n void 0 : StateManager.updatePropertyValue.bind(null, state, key, onAction),\n key\n });\n\n return localDescriptors;\n }, []);\n }\n\n private static readPropertyValue(state: State, key: string): any {\n return state[key];\n }\n\n private static updatePropertyValue(state: State, key: string, onAction: IOnAction, value: any): void {\n if (state[key] === value) return;\n\n state[key] = value;\n\n onAction(state, key);\n }\n}\n\nexport default StateManager;","import CollisionType from '../Shared/Util/Constants/CollisionType';\n\nimport BodyStatus from './Constants/BodyStatus';\nimport ScrollStatus from './Constants/ScrollStatus';\nimport IActions from './Interfaces/IActions';\nimport State from './State';\n\nconst resolveActions = (state: State): IActions => ({\n focus(): void {\n state.isFocused = true;\n },\n\n blur(): void {\n state.isFocused = false;\n },\n\n invalidate(): void {\n state.isInvalid = true;\n },\n\n validate(): void {\n state.isInvalid = false;\n },\n\n topOut(): void {\n state.scrollStatus = ScrollStatus.AT_TOP;\n },\n\n bottomOut(): void {\n state.scrollStatus = ScrollStatus.AT_BOTTOM;\n },\n\n scroll(): void {\n state.scrollStatus = ScrollStatus.SCROLLED;\n },\n\n makeScrollable(): void {\n state.isScrollable = true;\n },\n\n makeUnscrollable(): void {\n state.isScrollable = false;\n },\n\n open(\n this: IActions,\n maxBodyHeight: number,\n collisionType: CollisionType,\n isScrollable: boolean\n ): void {\n if (state.isDisabled) return;\n\n this.closeOthers();\n\n switch (collisionType) {\n case CollisionType.NONE:\n case CollisionType.TOP:\n state.bodyStatus = BodyStatus.OPEN_BELOW;\n\n break;\n case CollisionType.BOTTOM:\n state.bodyStatus = BodyStatus.OPEN_ABOVE;\n\n break;\n }\n\n state.isScrollable = isScrollable;\n state.maxBodyHeight = maxBodyHeight;\n\n this.scrollToView(state, true);\n },\n\n close(): void {\n state.bodyStatus = BodyStatus.CLOSED;\n state.focusedIndex = -1;\n\n this.blur();\n },\n\n startClickSelecting(): void {\n state.isClickSelecting = true;\n },\n\n selectOption(this: IActions, index: number, close = true): void {\n const optionAtIndex = state.getOptionFromIndex(index);\n\n state.isClickSelecting = false;\n\n if (index > -1 && (!optionAtIndex || optionAtIndex.isDisabled)) return;\n\n state.selectedIndex = index;\n\n if (state.isInvalid && state.hasValue) {\n this.validate();\n }\n\n if (state.isSearching) {\n this.scrollToView(state);\n } else if (close) {\n this.close();\n }\n },\n\n focusOption(this: IActions, index: number, shouldScrollToView: boolean = false): void {\n const scrollToMiddle = Math.abs(index - state.focusedIndex) > 1;\n\n state.focusedIndex = index;\n\n if (shouldScrollToView) {\n this.scrollToView(state, scrollToMiddle);\n }\n },\n\n search(): void {\n state.isSearching = true;\n },\n\n resetSearch(): void {\n state.isSearching = false;\n },\n\n keying(): void {\n state.isKeying = true;\n },\n\n resetKeying(): void {\n state.isKeying = false;\n },\n\n useNative(): void {\n state.isUseNativeMode = true;\n }\n});\n\nexport default resolveActions;","import merge from 'helpful-merge';\n\nimport Config from '../Config/Config';\nimport getIsMobilePlatform from '../Shared/Util/getIsMobilePlatform';\n\nimport Group from './Group';\nimport Option from './Option';\nimport State from './State';\n\nclass StateMapper {\n public static mapFromSelect(selectElement: HTMLSelectElement, config: Config): State {\n const state = new State(null, config);\n\n let isWithinGroup = false;\n\n state.name = selectElement.name;\n state.isDisabled = selectElement.disabled;\n state.isRequired = selectElement.required;\n\n state.isUseNativeMode = (\n config.behavior.useNativeUiOnMobile &&\n getIsMobilePlatform(window.navigator.userAgent)\n );\n\n for (let i = 0, child: Element; (child = selectElement.children[i]); i++) {\n if (i === 0 && child.getAttribute('data-placeholder') !== null) {\n state.placeholder = child.textContent;\n (child as HTMLOptionElement).value = '';\n\n continue;\n }\n\n if (child instanceof HTMLOptionElement) {\n if (isWithinGroup === false) {\n state.groups.push(StateMapper.mapGroup());\n\n isWithinGroup = true;\n }\n\n state.lastGroup.options.push(StateMapper.mapOption(child));\n\n if (child.selected) state.selectedIndex = state.totalOptions - 1;\n } else if (child instanceof HTMLOptGroupElement) {\n isWithinGroup = true;\n\n state.groups.push(StateMapper.mapGroup(child));\n\n for (let j = 0, groupChild: Element; (groupChild = child.children[j]); j++) {\n state.lastGroup.options.push(\n StateMapper.mapOption(\n groupChild as HTMLOptionElement,\n child as HTMLOptGroupElement\n )\n );\n\n if ((groupChild as HTMLOptionElement).selected) state.selectedIndex = state.totalOptions - 1;\n }\n\n isWithinGroup = false;\n } else {\n throw new TypeError(\n `[EasyDropDown] Invalid child tag \"${child.tagName}\" found in provided \\`<select>\\` element`\n );\n }\n }\n\n return Object.seal(state);\n }\n\n private static mapGroup(group: HTMLOptGroupElement = null): Group {\n return merge(new Group(), {\n label: group ? group.label : '',\n isDisabled: group ? group.disabled : false\n });\n }\n\n private static mapOption(option: HTMLOptionElement, group: HTMLOptGroupElement = null): Option {\n if (!(option instanceof HTMLOptionElement)) throw new TypeError('[EasyDropDown] Invalid markup structure');\n\n const isParentGroupDisabled = group !== null && group.disabled;\n\n return merge(new Option(), {\n label: option.textContent,\n value: option.value,\n isDisabled: option.disabled || isParentGroupDisabled\n });\n }\n}\n\nexport default StateMapper;","import merge from 'helpful-merge';\n\nimport Config from '../Config/Config';\n\nimport BodyStatus from './Constants/BodyStatus';\nimport ScrollStatus from './Constants/ScrollStatus';\nimport Group from './Group';\nimport Option from './Option';\n\nclass State {\n public groups: Group[] = [];\n public focusedIndex: number = -1;\n public selectedIndex: number = -1;\n public maxVisibleItemsOverride: number = -1;\n public maxBodyHeight: number = -1;\n public name: string = '';\n public placeholder: string = '';\n public scrollStatus: ScrollStatus = ScrollStatus.AT_TOP;\n public bodyStatus: BodyStatus = BodyStatus.CLOSED;\n public isDisabled: boolean = false;\n public isRequired: boolean = false;\n public isInvalid: boolean = false;\n public isFocused: boolean = false;\n public isUseNativeMode: boolean = false;\n public isScrollable: boolean = false;\n public isClickSelecting: boolean = false;\n public isSearching: boolean = false;\n public isKeying: boolean = false;\n\n private config: Config;\n\n constructor(stateRaw: any = null, config = new Config()) {\n this.config = config;\n\n if (!stateRaw) return;\n\n merge(this, stateRaw);\n\n this.groups = this.groups.map((groupRaw) => {\n const group = merge(new Group(), groupRaw);\n\n group.options = group.options.map(optionRaw => merge(new Option(), optionRaw));\n\n return group;\n });\n }\n\n public get totalGroups(): number {\n return this.groups.length;\n }\n\n public get lastGroup(): Group {\n return this.groups[this.groups.length - 1];\n }\n\n public get totalOptions(): number {\n return this.groups.reduce((total: number, group: Group) => total + group.totalOptions, 0);\n }\n\n public get selectedOption(): Option {\n return this.getOptionFromIndex(this.selectedIndex);\n }\n\n public get focusedOption(): Option {\n return this.getOptionFromIndex(this.focusedIndex);\n }\n\n public get value(): string {\n return this.selectedOption ? this.selectedOption.value : '';\n }\n\n public get humanReadableValue(): string {\n if (\n (!this.hasValue && this.hasPlaceholder) ||\n (\n this.config.behavior.showPlaceholderWhenOpen &&\n this.hasPlaceholder &&\n this.isOpen\n )\n ) {\n return this.placeholder;\n }\n\n return this.label;\n }\n\n public get label(): string {\n return this.selectedOption ? this.selectedOption.label : '';\n }\n\n public get hasPlaceholder(): boolean {\n return this.placeholder !== '';\n }\n\n public get isPlaceholderShown(): boolean {\n return this.hasPlaceholder && !this.hasValue;\n }\n\n public get hasValue(): boolean {\n return this.value !== '';\n }\n\n public get isGrouped(): boolean {\n return Boolean(this.groups.find(group => group.hasLabel));\n }\n\n public get isOpen(): boolean {\n return this.bodyStatus !== BodyStatus.CLOSED;\n }\n\n public get isClosed(): boolean {\n return this.bodyStatus === BodyStatus.CLOSED;\n }\n\n public get isOpenAbove(): boolean {\n return this.bodyStatus === BodyStatus.OPEN_ABOVE;\n }\n\n public get isOpenBelow(): boolean {\n return this.bodyStatus === BodyStatus.OPEN_BELOW;\n }\n\n public get isAtTop(): boolean {\n return this.scrollStatus === ScrollStatus.AT_TOP;\n }\n\n public get isAtBottom(): boolean {\n return this.scrollStatus === ScrollStatus.AT_BOTTOM;\n }\n\n public getOptionFromIndex(index: number): Option {\n let groupStartIndex = 0;\n\n for (const group of this.groups) {\n if (index < 0 ) break;\n\n const groupEndIndex = Math.max(0, groupStartIndex + group.totalOptions - 1);\n\n if (index <= groupEndIndex) {\n const option = group.options[index - groupStartIndex];\n\n return option;\n }\n\n groupStartIndex += group.totalOptions;\n }\n\n return null;\n }\n\n public getOptionIndexFromValue(value: string): number {\n let index: number = -1;\n\n for (const group of this.groups) {\n for (const option of group.options) {\n index++;\n\n if (option.value === value) {\n return index;\n }\n }\n }\n\n return -1;\n }\n}\n\nexport default State;","class Timers {\n public pollChangeIntervalId: number;\n public pollMutationIntervalId: number;\n public searchTimeoutId: number;\n public keyingTimeoutId: number;\n\n public clear(): void {\n Object.keys(this).forEach(key => window.clearInterval(this[key]));\n }\n}\n\nexport default Timers;","import Easydropdown from './Easydropdown';\n\nclass EasydropdownFacade {\n /**\n * Programmatically opens the dropdown, closing any\n * other open instances.\n */\n\n public open: () => void;\n\n /**\n * Programmatically closes the dropdown.\n */\n\n public close: () => void;\n\n /**\n * Refreshes the instance and updates the DOM in\n * response to a change in the underlying `<select>`\n * element (for example, adding or removing an option).\n */\n\n public refresh: () => void;\n\n /**\n * Validates the instance by checking\n * the current state whether dropown is required\n * and a selection was made\n *\n * @returns boolean whether the dropdown is valid\n */\n\n public validate: () => boolean;\n\n /**\n * Destroys the instance by removing all EasyDropDown-generated\n * elements from the DOM, and unbinding all event handlers.\n * The underlying select is returned to the root position.\n */\n\n public destroy: () => void;\n\n /**\n * An accessor property allowing writing to and reading\n * from the dropdown's value.\n */\n\n public value: string;\n\n constructor(implementation: Easydropdown) {\n this.open = implementation.open.bind(implementation);\n this.close = implementation.close.bind(implementation);\n this.refresh = implementation.refresh.bind(implementation);\n this.destroy = implementation.destroy.bind(implementation);\n this.validate = implementation.validate.bind(implementation);\n\n Object.defineProperties(this, {\n value: {\n get: () => implementation.value,\n set: (nextValue: string) => implementation.value = nextValue\n }\n });\n }\n}\n\nexport default EasydropdownFacade;"],"sourceRoot":""}