@ckeditor/ckeditor5-ui
Version:
The UI framework and standard UI library of CKEditor 5.
60 lines (59 loc) • 1.57 kB
JavaScript
/**
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
*/
import View from '../view.js';
/**
* A view displaying an information text related to different states of {@link module:ui/search/text/searchtextview~SearchTextView}.
*
* @internal
*/
export default class SearchInfoView extends View {
/**
* @inheritDoc
*/
constructor() {
super();
const bind = this.bindTemplate;
this.set({
isVisible: false,
primaryText: '',
secondaryText: ''
});
this.setTemplate({
tag: 'div',
attributes: {
class: [
'ck',
'ck-search__info',
bind.if('isVisible', 'ck-hidden', value => !value)
],
tabindex: -1
},
children: [
{
tag: 'span',
children: [
{
text: [bind.to('primaryText')]
}
]
},
{
tag: 'span',
children: [
{
text: [bind.to('secondaryText')]
}
]
}
]
});
}
/**
* Focuses the view
*/
focus() {
this.element.focus();
}
}