blob: 31771903227ac399d5778a6476053702f4868ff7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
import { computed, makeObservable } from 'mobx';
import { observer } from 'mobx-react';
import * as React from 'react';
import { returnFalse } from '../../../../ClientUtils';
import { Doc } from '../../../../fields/Doc';
import { ViewBoxBaseComponent } from '../../DocComponent';
import { DocumentView } from '../DocumentView';
import { FieldView, FieldViewProps } from '../FieldView';
@observer
export class ImportElementBox extends ViewBoxBaseComponent<FieldViewProps>() {
public static LayoutString(fieldKey: string) {
return FieldView.LayoutString(ImportElementBox, fieldKey);
}
constructor(props: FieldViewProps) {
super(props);
makeObservable(this);
}
screenToLocalXf = () => this.ScreenToLocalBoxXf().scale(1 * (this._props.NativeDimScaling?.() || 1));
@computed get mainItem() {
return (
<div style={{ backgroundColor: 'pink' }}>
<DocumentView
// eslint-disable-next-line react/jsx-props-no-spreading
{...this._props} //
LayoutTemplateString={undefined}
Document={this.Document}
isContentActive={returnFalse}
addDocument={returnFalse}
ScreenToLocalTransform={this.screenToLocalXf}
hideResizeHandles
/>
</div>
);
}
render() {
return !(this.Document instanceof Doc) ? null : this.mainItem;
}
}
|