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 image/imageinsert/ui/imageinsertformrowview
|
7 | */
|
8 | import type { Locale } from 'ckeditor5/src/utils';
|
9 | import { View, type ViewCollection, type LabelView } from 'ckeditor5/src/ui';
|
10 | import '../../../theme/imageinsertformrowview.css';
|
11 | /**
|
12 | * The class representing a single row in a complex form,
|
13 | * used by {@link module:image/imageinsert/ui/imageinsertpanelview~ImageInsertPanelView}.
|
14 | *
|
15 | * **Note**: For now this class is private. When more use cases appear (beyond `ckeditor5-table` and `ckeditor5-image`),
|
16 | * it will become a component in `ckeditor5-ui`.
|
17 | *
|
18 | * @private
|
19 | */
|
20 | export default class ImageUploadFormRowView 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 | * @private
|
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 | * @private
|
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 | }
|