| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- /**
- * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
- /**
- * @module table/ui/colorinputview
- */
- import View from '../view';
- import '../../theme/components/formheader/formheader.css';
- export default class FormHeaderView extends View {
- constructor( locale, options = {} ) {
- super( locale );
- const bind = this.bindTemplate;
- /**
- * The label of the header.
- *
- * @readonly
- * @member {String} #label
- */
- this.set( 'label', options.label || '' );
- /**
- * An additional CSS class added to the {@link #element}.
- *
- * @observable
- * @member {String} #class
- */
- this.set( 'class', options.class || null );
- /**
- * A collection of header items.
- *
- * @readonly
- * @member {module:ui/viewcollection~ViewCollection}
- */
- this.children = this.createCollection();
- const label = new View( locale );
- label.setTemplate( {
- tag: 'span',
- attributes: {
- class: [
- 'ck',
- 'ck-form__header__label'
- ]
- },
- children: [
- { text: bind.to( 'label' ) }
- ]
- } );
- this.children.add( label );
- this.setTemplate( {
- tag: 'div',
- attributes: {
- class: [
- 'ck',
- 'ck-form__header',
- bind.to( 'class' )
- ]
- },
- children: this.children
- } );
- }
- }
|