/**
* Data handler for a button 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/Value
- * @since 5.4
+ * @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/Value
+ * @since 5.4
*/
-define(['Core', './Field'], function (Core, FormBuilderField) {
+define(["require", "exports", "tslib", "./Field"], function (require, exports, tslib_1, Field_1) {
"use strict";
- /**
- * @constructor
- */
- function FormBuilderFieldButton(fieldId) {
- this.init(fieldId);
- }
- ;
- Core.inherit(FormBuilderFieldButton, FormBuilderField, {
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
- */
- _getData: function () {
- var data = {};
+ Object.defineProperty(exports, "__esModule", { value: true });
+ Field_1 = tslib_1.__importDefault(Field_1);
+ class Button extends Field_1.default {
+ _getData() {
+ const data = {};
if (this._field.dataset.isClicked === "1") {
data[this._fieldId] = this._field.value;
}
return data;
}
- });
- return FormBuilderFieldButton;
+ }
+ exports.default = Button;
});
+++ /dev/null
-/**
- * Data handler for a button 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/Value
- * @since 5.4
- */
-define(['Core', './Field'], function(Core, FormBuilderField) {
- "use strict";
-
- /**
- * @constructor
- */
- function FormBuilderFieldButton(fieldId) {
- this.init(fieldId);
- };
- Core.inherit(FormBuilderFieldButton, FormBuilderField, {
- /**
- * @see WoltLabSuite/Core/Form/Builder/Field/Field#_getData
- */
- _getData: function() {
- var data = {};
-
- if (this._field.dataset.isClicked === "1") {
- data[this._fieldId] = this._field.value;
- }
-
- return data;
- }
- });
-
- return FormBuilderFieldButton;
-});
--- /dev/null
+/**
+ * Data handler for a button 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/Value
+ * @since 5.4
+ */
+
+import Field from "./Field";
+import { FormBuilderData } from "../Data";
+
+export default class Button extends Field {
+ protected _getData(): FormBuilderData {
+ const data = {};
+
+ if (this._field!.dataset.isClicked === "1") {
+ data[this._fieldId] = (this._field! as HTMLInputElement).value;
+ }
+
+ return data;
+ }
+}