Issue #23853: More widget refactoring.
[xtuple] / lib / enyo-x / source / widgets / checkbox.js
index e242680..a74f200 100644 (file)
@@ -4,52 +4,6 @@ regexp:true, undef:true, trailing:true, white:true */
 
 (function () {
 
-  /**
-    @name XV.Checkbox
-    @class An input control that shows or hides a checkmark when clicked.</br >
-    To implement a checkbox, see {@link XV.CheckboxWidget}.<br />
-    Derived from <a href="http://enyojs.com/api/#onyx.Checkbox">onyx.Checkbox</a>.
-    @extends onyx.Checkbox
-   */
-  enyo.kind(
-    /** @lends XV.Checkbox# */{
-    name: "XV.Checkbox",
-    kind: "onyx.Checkbox",
-    published: {
-      attr: null
-    },
-    events: {
-      onValueChange: ""
-    },
-    handlers: {
-      onchange: "changed"
-    },
-    /**
-    @todo Document the clear method.
-    */
-    clear: function (options) {
-      this.setValue(false, options);
-    },
-    /**
-    @todo Document the setValue method.
-    */
-    setValue: function (value, options) {
-      options = options || {};
-      this._silent = options.silent;
-      this.inherited(arguments);
-      this._silent = false;
-    },
-    /**
-    @todo Document the changed method.
-    */
-    changed: function (inSender, inEvent) {
-      if (!this._silent) {
-        inEvent.value = this.getValue();
-        this.doValueChange(inEvent);
-      }
-    }
-  });
-
   /**
     @name XV.CheckboxWidget
     @class An input control consisting of fittable columns:
@@ -58,15 +12,14 @@ regexp:true, undef:true, trailing:true, white:true */
       which is made up of a checkbox input control and its label.
     @extends XV.Input
    */
-  enyo.kind(/** @lends XV.CheckboxWidget# */{
+  enyo.kind({
     name: "XV.CheckboxWidget",
     kind: "XV.InputWidget",
     classes: "xv-checkboxwidget",
     components: [
-      {kind: "FittableColumns", components: [
-        {name: "label", content: "", classes: "xv-label"},
-        {kind: "onyx.InputDecorator", classes: "xv-input-decorator",
-          components: [
+      {controlClasses: 'enyo-inline', components: [
+        {name: "label", classes: "xv-label"},
+        {kind: "onyx.InputDecorator", components: [
           {name: "input", kind: "onyx.Checkbox", onchange: "inputChanged"}
         ]}
       ]}
@@ -135,10 +88,9 @@ regexp:true, undef:true, trailing:true, white:true */
       onValueChange: ""
     },
     components: [
-      {kind: "FittableColumns", components: [
-        {name: "label", content: "", classes: "xv-label"},
-        {kind: "onyx.InputDecorator", classes: "xv-input-decorator",
-          components: [
+      {controlClasses: 'enyo-inline', components: [
+        {name: "label", classes: "xv-label"},
+        {kind: "onyx.InputDecorator", components: [
           {name: "input", kind: "onyx.Checkbox", onchange: "inputChanged"}
         ]}
       ]}