Explorar o código

Docs: Improved LabeledInputView and InputTextView API docs.

Aleksander Nowodzinski %!s(int64=7) %!d(string=hai) anos
pai
achega
955d391ddb

+ 8 - 1
packages/ckeditor5-ui/src/inputtext/inputtextview.js

@@ -64,7 +64,7 @@ export default class InputTextView extends View {
 
 		/**
 		 * The `id` of the element describing this field, e.g. when it has
-		 * some error, which helps screen readers read the error text.
+		 * some error, it helps screen readers read the error text.
 		 *
 		 * @observable
 		 * @member {Boolean} #ariaDesribedById
@@ -93,6 +93,13 @@ export default class InputTextView extends View {
 				input: bind.to( 'input' )
 			}
 		} );
+
+		/**
+		 * Fired when the user types in the input. Corresponds to the native
+		 * DOM `input` event.
+		 *
+		 * @event input
+		 */
 	}
 
 	/**

+ 12 - 2
packages/ckeditor5-ui/src/labeledinput/labeledinputview.js

@@ -55,7 +55,17 @@ export default class LabeledInputView extends View {
 		this.set( 'isReadOnly', false );
 
 		/**
-		 * The error text associated with the field.
+		 * The validation error text. When set, it will be displayed
+		 * next to the {@link #inputView} as a typical validation error message.
+		 * Set it to `null` to hide the message.
+		 *
+		 * **Note:** Setting this property to anything but `null` will automatically
+		 * make the {@link module:ui/inputtext/inputtextview~InputTextView#hasError `hasError`}
+		 * of the {@link #inputView} `true`.
+		 *
+		 * **Note:** Typing in the {@link #inputView} which fires the
+		 * {@link module:ui/inputtext/inputtextview~InputTextView#event:input `input` event}
+		 * resets this property back to `null`, indicating that the input field can be re–validated.
 		 *
 		 * @observable
 		 * @member {String|null} #errorText
@@ -72,7 +82,7 @@ export default class LabeledInputView extends View {
 		/**
 		 * The input view.
 		 *
-		 * @member {module:ui/view~View} #inputView
+		 * @member {module:ui/inputtext/inputtextview~InputTextView} #inputView
 		 */
 		this.inputView = this._createInputView( InputView, inputUid, errorUid );