/**
* Data handler for a acl form builder field in an Ajax form.
*
- * @author Matthias Schmidt
- * @copyright 2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLabSuite/Core/Form/Builder/Field/Acl
- * @since 5.2.3
+ * @author Matthias Schmidt
+ * @copyright 2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module WoltLabSuite/Core/Form/Builder/Field/Acl
+ * @since 5.2.3
*/
-define(['Core', './Field'], function (Core, FormBuilderField) {
+define(["require", "exports", "tslib", "./Field", "../../../Core"], function (require, exports, tslib_1, Field_1, Core) {
"use strict";
- /**
- * @constructor
- */
- function FormBuilderFieldAcl(fieldId) {
- this.init(fieldId);
- this._aclList = null;
- }
- ;
- Core.inherit(FormBuilderFieldAcl, FormBuilderField, {
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
- */
- _getData: function () {
- var data = {};
- data[this._fieldId] = this._aclList.getData();
- return data;
- },
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_readField
- */
- _readField: function () {
+ Field_1 = tslib_1.__importDefault(Field_1);
+ Core = tslib_1.__importStar(Core);
+ class Acl extends Field_1.default {
+ _getData() {
+ return {
+ [this._fieldId]: this._aclList.getData(),
+ };
+ }
+ _readField() {
// does nothing
- },
- /**
- * Sets the ACL list object used to extract the ACL values.
- *
- * @param {WCF.ACL.List} aclList
- */
- setAclList: function (aclList) {
+ }
+ setAclList(aclList) {
this._aclList = aclList;
+ return this;
}
- });
- return FormBuilderFieldAcl;
+ }
+ Core.enableLegacyInheritance(Acl);
+ return Acl;
});
+++ /dev/null
-/**
- * Data handler for a acl form builder field in an Ajax form.
- *
- * @author Matthias Schmidt
- * @copyright 2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @module WoltLabSuite/Core/Form/Builder/Field/Acl
- * @since 5.2.3
- */
-define(['Core', './Field'], function(Core, FormBuilderField) {
- "use strict";
-
- /**
- * @constructor
- */
- function FormBuilderFieldAcl(fieldId) {
- this.init(fieldId);
-
- this._aclList = null;
- };
- Core.inherit(FormBuilderFieldAcl, FormBuilderField, {
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
- */
- _getData: function() {
- var data = {};
-
- data[this._fieldId] = this._aclList.getData();
-
- return data;
- },
-
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_readField
- */
- _readField: function() {
- // does nothing
- },
-
- /**
- * Sets the ACL list object used to extract the ACL values.
- *
- * @param {WCF.ACL.List} aclList
- */
- setAclList: function(aclList) {
- this._aclList = aclList;
- }
- });
-
- return FormBuilderFieldAcl;
-});
--- /dev/null
+/**
+ * Data handler for a acl form builder field in an Ajax form.
+ *
+ * @author Matthias Schmidt
+ * @copyright 2001-2020 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @module WoltLabSuite/Core/Form/Builder/Field/Acl
+ * @since 5.2.3
+ */
+
+import Field from "./Field";
+import { FormBuilderData } from "../Data";
+import * as Core from "../../../Core";
+
+interface AclList {
+ getData: () => object;
+}
+
+class Acl extends Field {
+ protected _aclList: AclList;
+
+ protected _getData(): FormBuilderData {
+ return {
+ [this._fieldId]: this._aclList.getData(),
+ };
+ }
+
+ protected _readField(): void {
+ // does nothing
+ }
+
+ public setAclList(aclList: AclList): Acl {
+ this._aclList = aclList;
+
+ return this;
+ }
+}
+
+Core.enableLegacyInheritance(Acl);
+
+export = Acl;