Current Path : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/select/dist/ |
Current File : /var/www/www-root/data/www/www.monolith-realty.ru/bitrix/js/ui/select/dist/select.bundle.js.map |
{"version":3,"file":"select.bundle.js","sources":["../src/select.js"],"sourcesContent":["import { Type, Dom, Tag, Loc, bind } from 'main.core';\nimport { EventEmitter } from 'main.core.events';\nimport { Menu, Popup, MenuItemOptions, PopupOptions } from 'main.popup';\nimport './select.css';\nimport 'ui.';\n\nexport type SelectOption = {\n\tlabel: string;\n\tvalue: string;\n}\n\nexport type SelectOptions = {\n\toptions: SelectOption[];\n\tvalue: string;\n\tplaceholder: string;\n\tisSearchable: boolean;\n\tcontainerClassname: string;\n\tpopupParams: PopupOptions;\n}\n\nconst ScrollDirection = Object.freeze({\n\tTOP: -1,\n\tBOTTOM: 1,\n\tNONE: 0,\n});\n\nexport class Select extends EventEmitter\n{\n\t#placeholder: string = '';\n\t#isSearchable: boolean = false;\n\t#isSearching: boolean = false;\n\t#searchValue: string = '';\n\t#selectedOption: SelectOption | null = null;\n\t#options: SelectOption[] = [];\n\t#container: HTMLElement | null = null;\n\t#containerClassname: string = '';\n\t#menu: Menu | null = null;\n\t#emptySearchPopup: Popup | null = null;\n\t#highlightedOptionIndex: number = 0;\n\t#popupParams: PopupOptions = {};\n\n\tconstructor(options: SelectOptions)\n\t{\n\t\tsuper();\n\t\tthis.setEventNamespace('BX.UI.Select');\n\t\tthis.#placeholder = Type.isString(options.placeholder) ? options.placeholder : '';\n\t\tthis.#isSearchable = options.isSearchable === true || false;\n\t\tthis.#options = Array.isArray(options.options) ? options.options : [];\n\t\tthis.#popupParams = Type.isPlainObject(options.popupParams) ? options.popupParams : {};\n\t\tthis.#selectedOption = this.#findOptionByValue(options.value) || null;\n\t\tthis.#containerClassname = Type.isString(options?.containerClassname) ? options.containerClassname : '';\n\t\tthis.#highlightedOptionIndex = this.#getOptionIndex(this.#selectedOption?.value) || 0;\n\t\tthis.#renderContainer();\n\t}\n\n\trenderTo(targetContainer: HTMLElement): HTMLElement | null\n\t{\n\t\tif (Type.isDomNode(targetContainer))\n\t\t{\n\t\t\tDom.clean(targetContainer);\n\t\t\tthis.#renderContainer();\n\t\t\tDom.append(this.#container, targetContainer);\n\n\t\t\treturn targetContainer;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t#renderContainer(): HTMLElement\n\t{\n\t\tthis.#container = Tag.render`\n\t\t\t<div class=\"${this.#getContainerClassname()}\">\n\t\t\t\t<div class=\"ui-ctl-after ui-ctl-icon-angle\"></div>\n\t\t\t\t<input\n\t\t\t\t\tref=\"input\"\n\t\t\t\t\tclass=\"ui-ctl-element\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\tplaceholder=\"${this.#placeholder}\"\n\t\t\t\t\t${this.#isInputReadonly() ? 'readonly' : ''}\n\t\t\t\t\tvalue=\"${this.#selectedOption?.label || ''}\"\n\t\t\t\t>\n\t\t\t</div>\n\t\t`;\n\n\t\tbind(this.#container.input, 'input', this.#handleInput.bind(this));\n\t\tbind(this.#container.input, 'focus', this.#handleFocus.bind(this));\n\t\tbind(this.#container.input, 'blur', this.#handleBlur.bind(this));\n\t\tbind(this.#container.input, 'mouseup', this.#handleInputClick.bind(this));\n\t\tbind(this.#container.input, 'keydown', this.#handleKeyDown.bind(this));\n\n\t\tthis.#container = this.#container.root;\n\n\t\treturn this.#container;\n\t}\n\n\t#isInputReadonly(): boolean\n\t{\n\t\treturn !this.#isSearchable || (!this.isMenuShown() && !this.#emptySearchPopup);\n\t}\n\n\t#handleInputClick(): void\n\t{\n\t\tif (this.getInput() === document.activeElement)\n\t\t{\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.showMenu();\n\t\t\t}, 100);\n\t\t}\n\t}\n\n\tshowMenu(): void\n\t{\n\t\tif (!this.#menu)\n\t\t{\n\t\t\tthis.#createMenu();\n\t\t}\n\n\t\tthis.#menu.show();\n\t\tthis.#updateMenu();\n\t}\n\n\t#createMenu(): Menu\n\t{\n\t\tconst { width } = Dom.getPosition(this.#container);\n\t\tconst events = this.#popupParams?.events ?? {};\n\t\tthis.#menu = new Menu({\n\t\t\twidth,\n\t\t\tbindElement: this.#container,\n\t\t\titems: this.#getMenuItems(),\n\t\t\tcloseByEsc: true,\n\t\t\tautoHide: false,\n\t\t\tclassName: 'select-menu-popup',\n\t\t\t...this.#popupParams,\n\t\t\tevents: {\n\t\t\t\t...events,\n\t\t\t\tonAfterClose: () => {\n\t\t\t\t\tif (!this.#emptySearchPopup)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.#searchValue = '';\n\t\t\t\t\t\tthis.#setSelectedOption(this.#selectedOption);\n\t\t\t\t\t\tthis.#updateSelect();\n\t\t\t\t\t\tif (events.onAfterClose)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tevents.onAfterClose();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\treturn this.#menu;\n\t}\n\n\thideMenu(): void\n\t{\n\t\tif (this.#menu)\n\t\t{\n\t\t\tthis.#menu.close();\n\t\t}\n\t}\n\n\t#getMenuItems(): MenuItemOptions[]\n\t{\n\t\tif (this.#isSearching)\n\t\t{\n\t\t\treturn this.#getFilteredOptions()\n\t\t\t\t.map((option, index) => {\n\t\t\t\t\treturn this.#getMenuItemFromOption(option, index === this.#highlightedOptionIndex);\n\t\t\t\t});\n\t\t}\n\n\t\treturn this.#options.map((option, index) => {\n\t\t\treturn this.#getMenuItemFromOption(option, index === this.#highlightedOptionIndex);\n\t\t});\n\t}\n\n\t#handleInput(e): void\n\t{\n\t\te.preventDefault();\n\t\tthis.#highlightedOptionIndex = 0;\n\t\tthis.#isSearching = true;\n\t\tthis.#searchValue = e.target.value;\n\t\tthis.#updateMenu();\n\t}\n\n\t#handleKeyDown(e): void\n\t{\n\t\tconst { keyCode } = e;\n\t\tconst arrowUpKeyCode = 38;\n\t\tconst arrowDownKeyCode = 40;\n\t\tconst enterKeyCode = 13;\n\t\tconst spaceKeyCode = 32;\n\n\t\t// eslint-disable-next-line default-case\n\t\tswitch (keyCode)\n\t\t{\n\t\t\tcase enterKeyCode: this.#handleEnterKey(e); break;\n\t\t\tcase spaceKeyCode: this.#handleSpaceKey(e); break;\n\t\t\tcase arrowUpKeyCode: this.#handleArrowUpKey(e); break;\n\t\t\tcase arrowDownKeyCode: this.#handleArrowDownKey(e); break;\n\t\t}\n\t}\n\n\t#handleSpaceKey(e): void\n\t{\n\t\tif (!this.isMenuShown() && !this.#emptySearchPopup)\n\t\t{\n\t\t\te.preventDefault();\n\t\t\tthis.showMenu();\n\t\t\tthis.#updateSelect();\n\t\t}\n\t}\n\n\t#handleArrowUpKey(e): void\n\t{\n\t\te.preventDefault();\n\t\tif (!this.isMenuShown() || this.#highlightedOptionIndex === 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#highlightedOptionIndex--;\n\n\t\tthis.#scrollToHighlightedItem();\n\t\tthis.#highlightOption(this.#highlightedOptionIndex);\n\t}\n\n\t#handleArrowDownKey(e): void\n\t{\n\t\te.preventDefault();\n\t\tif (!this.isMenuShown() || this.#highlightedOptionIndex === this.#getMenuItems().length - 1)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#highlightedOptionIndex++;\n\t\tthis.#scrollToHighlightedItem();\n\t\tthis.#highlightOption(this.#highlightedOptionIndex);\n\t}\n\n\t#handleEnterKey(e): void\n\t{\n\t\te.preventDefault();\n\t\tconst options = this.#getFilteredOptions();\n\t\tthis.#selectedOption = options[this.#highlightedOptionIndex];\n\t\tthis.hideMenu();\n\t}\n\n\t#updateMenu(): void\n\t{\n\t\tif (!this.#menu)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#options.forEach(({ value }) => {\n\t\t\tthis.#menu.removeMenuItem(value, {\n\t\t\t\tdestroyEmptyPopup: false,\n\t\t\t});\n\t\t});\n\n\t\tconst filteredOptions = this.#getFilteredOptions(this.#searchValue);\n\n\t\tif (filteredOptions.length > 0)\n\t\t{\n\t\t\tif (!this.isMenuShown())\n\t\t\t{\n\t\t\t\tthis.showMenu();\n\t\t\t}\n\t\t\tthis.#hideEmptySearchPopup();\n\t\t\tfilteredOptions.forEach((option, index) => {\n\t\t\t\tthis.#menu.addMenuItem(this.#getMenuItemFromOption(option, index === this.#highlightedOptionIndex), null);\n\t\t\t});\n\n\t\t\tthis.#scrollToHighlightedItem();\n\t\t\tthis.#highlightOption(this.#highlightedOptionIndex);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.#showEmptySearchPopup();\n\t\t\tthis.hideMenu();\n\t\t}\n\t}\n\n\t#getMenuItemFromOption(option, isHoverOption: boolean = false): MenuItemOptions\n\t{\n\t\tconst isHover = isHoverOption === true;\n\t\tconst className = `ui-select__menu-item menu-popup-no-icon ${isHover ? 'menu-popup-item-open' : ''}`;\n\n\t\treturn ({\n\t\t\tid: option.value,\n\t\t\ttext: option.label,\n\t\t\tonclick: () => {\n\t\t\t\tthis.#selectedOption = option;\n\t\t\t},\n\t\t\tclassName,\n\t\t});\n\t}\n\n\t#getFilteredOptions(): SelectOption[]\n\t{\n\t\treturn this.#options.filter(this.#getOptionFilter(this.#searchValue));\n\t}\n\n\t#getOptionFilter(searchStr): (option: SelectOption) => boolean\n\t{\n\t\tconst lowerCaseSearchStr = Type.isString(searchStr) ? searchStr.toLowerCase() : '';\n\n\t\treturn (option) => {\n\t\t\tconst lowerCaseOptionLabel = option.label.toLowerCase();\n\n\t\t\treturn lowerCaseOptionLabel.indexOf(lowerCaseSearchStr) === 0;\n\t\t};\n\t}\n\n\t#showEmptySearchPopup(): void\n\t{\n\t\tif (!this.#emptySearchPopup || !this.#emptySearchPopup?.isShown())\n\t\t{\n\t\t\tconst { width } = Dom.getPosition(this.#container);\n\t\t\tconst events = this.#popupParams?.events ?? {};\n\n\t\t\tthis.#emptySearchPopup = new Popup({\n\t\t\t\twidth,\n\t\t\t\tbindElement: this.#container,\n\t\t\t\tcontent: Loc.getMessage('UI_SELECT_NOTHING_FOUND'),\n\t\t\t\tcloseByEsc: true,\n\t\t\t\t...this.#popupParams,\n\t\t\t\tevents: {\n\t\t\t\t\t...events,\n\t\t\t\t\tonAfterClose: () => {\n\t\t\t\t\t\tthis.#emptySearchPopup = null;\n\t\t\t\t\t\tthis.#setSelectedOption(this.#selectedOption);\n\t\t\t\t\t\tif (!this.isMenuShown())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthis.#searchValue = '';\n\t\t\t\t\t\t\tthis.#updateSelect();\n\t\t\t\t\t\t\tif (events.onAfterClose)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tevents.onAfterClose();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tthis.#emptySearchPopup.show();\n\t\t}\n\t}\n\n\t#hideEmptySearchPopup(): void\n\t{\n\t\tif (this.#emptySearchPopup)\n\t\t{\n\t\t\tthis.#emptySearchPopup.destroy();\n\t\t\tthis.#emptySearchPopup = null;\n\t\t}\n\t}\n\n\t#setSelectedOption(option: SelectOption): void\n\t{\n\t\tif (!option)\n\t\t{\n\t\t\tthis.#selectedOption = null;\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.emit('update', option.value);\n\t\tthis.#searchValue = '';\n\t\tconst input = this.getInput();\n\t\tinput.value = option.label;\n\t\tthis.#highlightedOptionIndex = this.#getOptionIndex(option.value);\n\t\tthis.#selectedOption = option;\n\t}\n\n\tgetInput(): HTMLElement | null\n\t{\n\t\treturn this.#container.querySelector('input');\n\t}\n\n\tgetValue(): string\n\t{\n\t\treturn this.#selectedOption?.value || '';\n\t}\n\n\tsetValue(value: string): void\n\t{\n\t\tconst option = this.#findOptionByValue(value);\n\t\tthis.#setSelectedOption(option);\n\t}\n\n\t#findOptionByValue(value: string): SelectOption | null\n\t{\n\t\treturn this.#options.find((option) => {\n\t\t\treturn option.value === value;\n\t\t});\n\t}\n\n\t#highlightOption(optionIndex: number): void\n\t{\n\t\tif (!this.#menu)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tconst menuItems = this.#menu.itemsContainer.children;\n\n\t\tfor (let i = 0; i < menuItems.length; i++)\n\t\t{\n\t\t\tconst item = menuItems.item(i);\n\t\t\tDom.removeClass(item, 'menu-popup-item-open');\n\t\t\tif (i === optionIndex)\n\t\t\t{\n\t\t\t\tDom.addClass(item, 'menu-popup-item-open');\n\t\t\t}\n\t\t}\n\t}\n\n\t#scrollToHighlightedItem(): void\n\t{\n\t\tconst popupContent: HTMLElement = this.#menu.getPopupWindow().getContentContainer();\n\t\tconst menuItems: HTMLCollection = this.#menu.itemsContainer.children;\n\t\tconst highlightedItem = menuItems.item(this.#highlightedOptionIndex);\n\n\t\tconst {\n\t\t\theight: popupContentHeight,\n\t\t} = Dom.getPosition(popupContent);\n\n\t\tconst {\n\t\t\theight: highlightedItemHeight,\n\t\t} = Dom.getPosition(highlightedItem);\n\n\t\tconst direction = this.#getScrollDirectionToHighlightedItem(popupContent, highlightedItem);\n\n\t\tif (direction !== ScrollDirection.NONE)\n\t\t{\n\t\t\tpopupContent.scroll({\n\t\t\t\tleft: 0,\n\t\t\t\ttop: (highlightedItemHeight * (this.#highlightedOptionIndex) + direction * popupContentHeight),\n\t\t\t\tbehavior: 'smooth',\n\t\t\t});\n\t\t}\n\t}\n\n\t#getScrollDirectionToHighlightedItem(popupContent: HTMLElement, highlightedItem: HTMLElement): number\n\t{\n\t\tconst {\n\t\t\tbottom: popupContentBottom,\n\t\t\ttop: popupContentTop,\n\t\t} = Dom.getPosition(popupContent);\n\n\t\tconst {\n\t\t\tbottom: highlightedItemBottom,\n\t\t\ttop: highlightedItemTop,\n\t\t} = Dom.getPosition(highlightedItem);\n\n\t\tif (popupContentTop > highlightedItemTop)\n\t\t{\n\t\t\treturn ScrollDirection.TOP;\n\t\t}\n\n\t\tif (popupContentBottom < highlightedItemBottom)\n\t\t{\n\t\t\treturn ScrollDirection.BOTTOM;\n\t\t}\n\n\t\treturn ScrollDirection.NONE;\n\t}\n\n\t#getOptionIndex(optionValue: string): number\n\t{\n\t\treturn this.#options.findIndex((option) => {\n\t\t\treturn option.value === optionValue;\n\t\t});\n\t}\n\n\tisMenuShown(): boolean\n\t{\n\t\treturn this.#menu && this.#menu.getPopupWindow().isShown();\n\t}\n\n\t#handleBlur(): void\n\t{\n\t\tthis.hideMenu();\n\t\tthis.#hideEmptySearchPopup();\n\t}\n\n\t#handleFocus(e): void\n\t{\n\t\tsetTimeout(() => {\n\t\t\tthis.showMenu();\n\t\t\tthis.#updateSelect();\n\t\t}, 100);\n\t\te.preventDefault();\n\t}\n\n\t#updateSelect(): void\n\t{\n\t\tthis.#updateInput();\n\t\tthis.#updateContainerClassname();\n\t}\n\n\t#updateInput(): void\n\t{\n\t\tconst input = this.getInput();\n\n\t\tif (this.#isInputReadonly())\n\t\t{\n\t\t\tinput.setAttribute('readonly', 'readonly');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tinput.removeAttribute('readonly');\n\t\t}\n\t}\n\n\t#updateContainerClassname(): void\n\t{\n\t\tthis.#container.className = this.#getContainerClassname();\n\t}\n\n\t#getContainerClassname(): string\n\t{\n\t\tconst openMenuClassnameModifier = this.isMenuShown() || this.#emptySearchPopup ? '--open' : '';\n\n\t\treturn `ui-select ui-ctl ui-ctl-after-icon ui-ctl-dropdown ${this.#containerClassname} ${openMenuClassnameModifier}`;\n\t}\n}\n"],"names":["ScrollDirection","Object","freeze","TOP","BOTTOM","NONE","Select","EventEmitter","constructor","options","setEventNamespace","Type","isString","placeholder","isSearchable","Array","isArray","isPlainObject","popupParams","value","containerClassname","renderTo","targetContainer","isDomNode","Dom","clean","append","showMenu","show","hideMenu","close","getInput","querySelector","getValue","setValue","option","isMenuShown","getPopupWindow","isShown","Tag","render","label","bind","input","root","document","activeElement","setTimeout","width","getPosition","events","Menu","bindElement","items","closeByEsc","autoHide","className","onAfterClose","map","index","e","preventDefault","target","keyCode","arrowUpKeyCode","arrowDownKeyCode","enterKeyCode","spaceKeyCode","length","forEach","removeMenuItem","destroyEmptyPopup","filteredOptions","addMenuItem","isHoverOption","isHover","id","text","onclick","filter","searchStr","lowerCaseSearchStr","toLowerCase","lowerCaseOptionLabel","indexOf","Popup","content","Loc","getMessage","destroy","emit","find","optionIndex","menuItems","itemsContainer","children","i","item","removeClass","addClass","popupContent","getContentContainer","highlightedItem","height","popupContentHeight","highlightedItemHeight","direction","scroll","left","top","behavior","bottom","popupContentBottom","popupContentTop","highlightedItemBottom","highlightedItemTop","optionValue","findIndex","setAttribute","removeAttribute","openMenuClassnameModifier"],"mappings":";;;;;;;AAAA,CAoBA,MAAMA,eAAe,GAAGC,MAAM,CAACC,MAAM,CAAC;GACrCC,GAAG,EAAE,CAAC,CAAC;GACPC,MAAM,EAAE,CAAC;GACTC,IAAI,EAAE;CACP,CAAC,CAAC;CAAC;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;CAAA;AAEH,CAAO,MAAMC,MAAM,SAASC,6BAAY,CACxC;GAcCC,WAAW,CAACC,SAAsB,EAClC;KAAA;KACC,KAAK,EAAE;KAAC;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;OAAA;;KAAA;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