UNPKG

1.96 kBTypeScriptView Raw
1/**
2 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5/**
6 * @module table/ui/formrowview
7 */
8import { View, type LabelView, type ViewCollection } from 'ckeditor5/src/ui';
9import type { Locale } from 'ckeditor5/src/utils';
10import '../../theme/formrow.css';
11/**
12 * The class representing a single row in a complex form,
13 * used by {@link module:table/tablecellproperties/ui/tablecellpropertiesview~TableCellPropertiesView}.
14 *
15 * **Note**: For now this class is private. When more use cases arrive (beyond ckeditor5-table),
16 * it will become a component in ckeditor5-ui.
17 *
18 * @internal
19 */
20export default class FormRowView extends View {
21 /**
22 * An additional CSS class added to the {@link #element}.
23 *
24 * @observable
25 */
26 class: string | null;
27 /**
28 * A collection of row items (buttons, dropdowns, etc.).
29 */
30 readonly children: ViewCollection;
31 /**
32 * The role property reflected by the `role` DOM attribute of the {@link #element}.
33 *
34 * **Note**: Used only when a `labelView` is passed to constructor `options`.
35 *
36 * @observable
37 * @internal
38 */
39 _role: string | null;
40 /**
41 * The ARIA property reflected by the `aria-labelledby` DOM attribute of the {@link #element}.
42 *
43 * **Note**: Used only when a `labelView` is passed to constructor `options`.
44 *
45 * @observable
46 * @internal
47 */
48 _ariaLabelledBy: string | null;
49 /**
50 * Creates an instance of the form row class.
51 *
52 * @param locale The locale instance.
53 * @param options.labelView When passed, the row gets the `group` and `aria-labelledby`
54 * DOM attributes and gets described by the label.
55 */
56 constructor(locale: Locale, options?: {
57 children?: Array<View>;
58 class?: string;
59 labelView?: LabelView;
60 });
61}