From: Alexander Ebert Date: Sun, 25 Oct 2020 14:13:44 +0000 (+0100) Subject: Convert `Ui/ItemList` to TypeScript X-Git-Tag: 5.4.0_Alpha_1~704^2~19 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c43d86c6ebade9094ba660a822e3dcb920a99874;p=GitHub%2FWoltLab%2FWCF.git Convert `Ui/ItemList` to TypeScript --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js index 6cf2104ed4..a0e6926e51 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/ItemList.js @@ -1,514 +1,468 @@ /** * Flexible UI element featuring both a list of items and an input field with suggestion support. * - * @author Alexander Ebert - * @copyright 2001-2019 WoltLab GmbH - * @license GNU Lesser General Public License - * @module WoltLabSuite/Core/Ui/ItemList + * @author Alexander Ebert + * @copyright 2001-2019 WoltLab GmbH + * @license GNU Lesser General Public License + * @module WoltLabSuite/Core/Ui/ItemList */ -define(['Core', 'Dictionary', 'Language', 'Dom/Traverse', 'EventKey', 'WoltLabSuite/Core/Ui/Suggestion', 'Ui/SimpleDropdown'], function (Core, Dictionary, Language, DomTraverse, EventKey, UiSuggestion, UiSimpleDropdown) { +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +define(["require", "exports", "../Core", "../Dom/Traverse", "../Language", "./Suggestion", "./Dropdown/Simple", "../Dom/Util"], function (require, exports, Core, DomTraverse, Language, Suggestion_1, Simple_1, Util_1) { "use strict"; - var _activeId = ''; - var _data = new Dictionary(); - var _didInit = false; - var _callbackKeyDown = null; - var _callbackKeyPress = null; - var _callbackKeyUp = null; - var _callbackPaste = null; - var _callbackRemoveItem = null; - var _callbackBlur = null; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.setValues = exports.getValues = exports.init = void 0; + Core = __importStar(Core); + DomTraverse = __importStar(DomTraverse); + Language = __importStar(Language); + Suggestion_1 = __importDefault(Suggestion_1); + Simple_1 = __importDefault(Simple_1); + Util_1 = __importDefault(Util_1); + let _activeId = ''; + const _data = new Map(); /** - * @exports WoltLabSuite/Core/Ui/ItemList + * Creates the DOM structure for target element. If `element` is a `