diff --git a/src/select/selectview.js b/src/select/selectview.js new file mode 100644 index 00000000..742bdfed --- /dev/null +++ b/src/select/selectview.js @@ -0,0 +1,129 @@ +/** + * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. + * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license + */ + +/** + * @module ui/select/selectview + */ + +import View from '../view'; +import global from '@ckeditor/ckeditor5-utils/src/dom/global'; + +/** + * The select view class. + * + * @extends module:ui/view~View + */ +export default class SelectView extends View { + /** + * Creates an instance of the {@link module:ui/select/selectview~SelectView} class. + * + * Also see {@link #render}. + * + * @param {module:utils/locale~Locale} locale The localization services instance. + * @param {Array.} items Items to choose from. + */ + constructor( locale, items ) { + super( locale ); + + /** + * Fired when the user selects an item. Corresponds to the native + * DOM `input` event. + * + * @event input + */ + + /** + * The value of the select. + * + * @observable + * @member {String} #value + */ + this.set( 'value' ); + + /** + * The `id` attribute of the select (i.e. to pair with a `