@effindomv2/fui-as 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +7 -0
- package/browser/src/common-harness/host-imports.ts +430 -0
- package/browser/src/common-harness/interop.ts +39 -0
- package/browser/src/common-harness/managed-harness-bitmap-host.ts +92 -0
- package/browser/src/common-harness/managed-harness-fetch-host.ts +201 -0
- package/browser/src/common-harness/managed-harness-file-host.ts +1101 -0
- package/browser/src/common-harness/managed-harness-file-payloads.ts +143 -0
- package/browser/src/common-harness/managed-harness-file-types.ts +106 -0
- package/browser/src/common-harness/managed-harness-session.ts +15 -0
- package/browser/src/common-harness/managed-harness.ts +1323 -0
- package/browser/src/common-harness/managed-history.ts +168 -0
- package/browser/src/common-harness/persisted-restore-policy.ts +50 -0
- package/browser/src/common-harness/persisted-ui-state-controller.ts +309 -0
- package/browser/src/common-harness/text-session-bridge.ts +452 -0
- package/browser/src/common-harness/types.ts +205 -0
- package/browser/src/common-harness/ui-chrome.ts +191 -0
- package/browser/src/common-harness/ui-imports.ts +529 -0
- package/browser/src/common-harness/wasm-module-cache.ts +47 -0
- package/browser/src/common-harness.ts +27 -0
- package/browser/src/file-processing-worker.ts +89 -0
- package/browser/src/host-events.ts +97 -0
- package/browser/src/host-services.ts +203 -0
- package/browser/src/index.ts +62 -0
- package/browser/src/persisted-ui-state.ts +206 -0
- package/browser/src/routed-harness.ts +198 -0
- package/browser/src/worker-bootstrap.ts +483 -0
- package/browser/src/worker-manager.ts +230 -0
- package/browser/src/worker-types.ts +50 -0
- package/package.json +89 -0
- package/scripts/build-demo-as.sh +91 -0
- package/scripts/build.sh +325 -0
- package/scripts/generate-host-events.ts +175 -0
- package/scripts/generate-host-services.ts +157 -0
- package/src/Fui.ts +205 -0
- package/src/FuiExports.ts +55 -0
- package/src/FuiPrimitives.ts +15 -0
- package/src/FuiWorker.ts +3 -0
- package/src/FuiWorkerExports.ts +6 -0
- package/src/bindings/ui.ts +531 -0
- package/src/color.ts +86 -0
- package/src/controls/AntiSelectionArea.ts +23 -0
- package/src/controls/Button.ts +750 -0
- package/src/controls/Checkbox.ts +181 -0
- package/src/controls/ContextMenu.ts +885 -0
- package/src/controls/ControlTemplateSet.ts +37 -0
- package/src/controls/Dialog.ts +355 -0
- package/src/controls/Dropdown.ts +856 -0
- package/src/controls/Form.ts +110 -0
- package/src/controls/NavLink.ts +211 -0
- package/src/controls/Popup.ts +129 -0
- package/src/controls/ProgressBar.ts +180 -0
- package/src/controls/RadioButton.ts +135 -0
- package/src/controls/RadioGroup.ts +244 -0
- package/src/controls/SelectionArea.ts +75 -0
- package/src/controls/Slider.ts +471 -0
- package/src/controls/Switch.ts +132 -0
- package/src/controls/TextArea.ts +20 -0
- package/src/controls/TextInput.ts +7 -0
- package/src/controls/index.ts +18 -0
- package/src/controls/internal/ButtonPresenter.ts +95 -0
- package/src/controls/internal/CheckboxIndicatorPresenter.ts +93 -0
- package/src/controls/internal/DropdownChevronPresenter.ts +67 -0
- package/src/controls/internal/DropdownFieldPresenter.ts +110 -0
- package/src/controls/internal/DropdownOptionRowPresenter.ts +82 -0
- package/src/controls/internal/PopupPresenter.ts +198 -0
- package/src/controls/internal/PressableIndicatorPresenter.ts +32 -0
- package/src/controls/internal/PressableLabeledControl.ts +221 -0
- package/src/controls/internal/RadioIndicatorPresenter.ts +73 -0
- package/src/controls/internal/SliderPresenter.ts +157 -0
- package/src/controls/internal/SwitchIndicatorPresenter.ts +72 -0
- package/src/controls/internal/TextInputCore.ts +695 -0
- package/src/controls/internal/TextInputPresenter.ts +72 -0
- package/src/controls/templating.ts +54 -0
- package/src/core/Action.ts +94 -0
- package/src/core/Actions.ts +37 -0
- package/src/core/Animation.ts +412 -0
- package/src/core/Application.ts +328 -0
- package/src/core/Assets.ts +264 -0
- package/src/core/AttachedProperties.ts +32 -0
- package/src/core/Bitmap.ts +70 -0
- package/src/core/BoundCallback.ts +104 -0
- package/src/core/Callbacks.ts +17 -0
- package/src/core/ContextMenuManager.ts +466 -0
- package/src/core/DebugApi.ts +30 -0
- package/src/core/Disposable.ts +10 -0
- package/src/core/DragDropManager.ts +179 -0
- package/src/core/DragGesture.ts +184 -0
- package/src/core/DynamicAssetIds.ts +24 -0
- package/src/core/Errors.ts +48 -0
- package/src/core/EventRouter.ts +408 -0
- package/src/core/ExternalDropManager.ts +122 -0
- package/src/core/Fetch.ts +264 -0
- package/src/core/FetchFfi.ts +15 -0
- package/src/core/File.ts +1002 -0
- package/src/core/FocusAdornerManager.ts +263 -0
- package/src/core/FocusVisibility.ts +36 -0
- package/src/core/FrameScheduler.ts +28 -0
- package/src/core/KeyboardScroll.ts +161 -0
- package/src/core/KeyboardScrollTracker.ts +386 -0
- package/src/core/Logger.ts +80 -0
- package/src/core/Navigation.ts +13 -0
- package/src/core/Node.ts +1708 -0
- package/src/core/PersistedState.ts +102 -0
- package/src/core/PersistedUiState.ts +142 -0
- package/src/core/Platform.ts +219 -0
- package/src/core/Signal.ts +89 -0
- package/src/core/Theme.ts +365 -0
- package/src/core/Timers.ts +129 -0
- package/src/core/ToolTip.ts +122 -0
- package/src/core/ToolTipManager.ts +459 -0
- package/src/core/Transitions.ts +34 -0
- package/src/core/Typography.ts +204 -0
- package/src/core/Worker.ts +196 -0
- package/src/core/bind.ts +37 -0
- package/src/core/event_exports.ts +596 -0
- package/src/core/ffi.ts +728 -0
- package/src/host-services/runtime.ts +25 -0
- package/src/nodes/FlexBox.ts +789 -0
- package/src/nodes/GradientStop.ts +9 -0
- package/src/nodes/Grid.ts +183 -0
- package/src/nodes/Image.ts +189 -0
- package/src/nodes/Portal.ts +14 -0
- package/src/nodes/RichText.ts +312 -0
- package/src/nodes/ScrollBar.ts +570 -0
- package/src/nodes/ScrollBox.ts +415 -0
- package/src/nodes/ScrollState.ts +10 -0
- package/src/nodes/ScrollView.ts +511 -0
- package/src/nodes/Svg.ts +142 -0
- package/src/nodes/Text.ts +145 -0
- package/src/nodes/TextCore.ts +558 -0
- package/src/nodes/VirtualList.ts +431 -0
- package/src/nodes/helpers.ts +25 -0
- package/src/nodes/index.ts +14 -0
- package/src/tsconfig.json +7 -0
- package/src/worker/Worker.ts +169 -0
- package/src/worker/WorkerJob.ts +65 -0
- package/src/worker/ffi.ts +23 -0
package/src/core/Node.ts
ADDED
|
@@ -0,0 +1,1708 @@
|
|
|
1
|
+
import * as ui from "../bindings/ui";
|
|
2
|
+
import { allocateAttachedPropertyKey, applyAttachedProperties } from "./AttachedProperties";
|
|
3
|
+
import {
|
|
4
|
+
Callback0,
|
|
5
|
+
Callback1,
|
|
6
|
+
Callback2,
|
|
7
|
+
Handler0,
|
|
8
|
+
Handler1,
|
|
9
|
+
Handler2,
|
|
10
|
+
ResultCallback0,
|
|
11
|
+
ResultCallback1,
|
|
12
|
+
ResultHandler0,
|
|
13
|
+
ResultHandler1,
|
|
14
|
+
} from "./BoundCallback";
|
|
15
|
+
import { DragCompletedEvent, DragGesture, DragGestureHost, DragStartedEvent } from "./DragGesture";
|
|
16
|
+
import { EventRouter } from "./EventRouter";
|
|
17
|
+
import { BrowserFile } from "./File";
|
|
18
|
+
import { FocusAdornerManager } from "./FocusAdornerManager";
|
|
19
|
+
import { markNeedsCommit } from "./FrameScheduler";
|
|
20
|
+
import { Disposable } from "./Disposable";
|
|
21
|
+
import { PersistedStateAdapter } from "./PersistedState";
|
|
22
|
+
import { storePersistedTextState, tryLoadPersistedTextState } from "./PersistedUiState";
|
|
23
|
+
import { ToolTip } from "./ToolTip";
|
|
24
|
+
import { ToolTipManager } from "./ToolTipManager";
|
|
25
|
+
import { throwNullArgument } from "./Errors";
|
|
26
|
+
import { bind0, bind1, bind2, bindResult0, bindResult1 } from "./bind";
|
|
27
|
+
import {
|
|
28
|
+
CursorStyle,
|
|
29
|
+
fui_release_pointer_capture,
|
|
30
|
+
fui_set_pointer_capture,
|
|
31
|
+
HandleValue,
|
|
32
|
+
KeyEventType,
|
|
33
|
+
Orientation,
|
|
34
|
+
PointerEventType,
|
|
35
|
+
SemanticCheckedState,
|
|
36
|
+
SemanticRole,
|
|
37
|
+
Visibility,
|
|
38
|
+
} from "./ffi";
|
|
39
|
+
|
|
40
|
+
export enum DragDropEffects {
|
|
41
|
+
None = 0,
|
|
42
|
+
Copy = 1,
|
|
43
|
+
Move = 2,
|
|
44
|
+
Link = 4,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const DRAG_DROP_TEXT_FORMAT = "text/plain";
|
|
48
|
+
|
|
49
|
+
export class DragDataObject {
|
|
50
|
+
private readonly formats: Map<string, string> = new Map<string, string>();
|
|
51
|
+
|
|
52
|
+
setText(value: string): DragDataObject {
|
|
53
|
+
this.formats.set(DRAG_DROP_TEXT_FORMAT, value);
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
setFormat(format: string, value: string): DragDataObject {
|
|
58
|
+
this.formats.set(format, value);
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
hasFormat(format: string): bool {
|
|
63
|
+
return this.formats.has(format);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
getText(): string | null {
|
|
67
|
+
return this.getFormat(DRAG_DROP_TEXT_FORMAT);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getFormat(format: string): string | null {
|
|
71
|
+
if (!this.formats.has(format)) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return this.formats.get(format);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export class DropProposal {
|
|
80
|
+
readonly effect: DragDropEffects;
|
|
81
|
+
readonly showInsertionMarker: bool;
|
|
82
|
+
|
|
83
|
+
constructor(effect: DragDropEffects = DragDropEffects.None, showInsertionMarker: bool = false) {
|
|
84
|
+
this.effect = effect;
|
|
85
|
+
this.showInsertionMarker = showInsertionMarker;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
static none(): DropProposal {
|
|
89
|
+
return new DropProposal();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export class DragSession {
|
|
94
|
+
readonly source: Node;
|
|
95
|
+
readonly data: DragDataObject;
|
|
96
|
+
readonly allowedEffects: DragDropEffects;
|
|
97
|
+
private currentEffectValue: DragDropEffects = DragDropEffects.None;
|
|
98
|
+
private activeValue: bool = true;
|
|
99
|
+
private completedCallback: ((effect: DragDropEffects) => void) | null = null;
|
|
100
|
+
private completedBinding: Callback1<DragDropEffects> | null = null;
|
|
101
|
+
|
|
102
|
+
constructor(source: Node, data: DragDataObject, allowedEffects: DragDropEffects) {
|
|
103
|
+
this.source = source;
|
|
104
|
+
this.data = data;
|
|
105
|
+
this.allowedEffects = allowedEffects;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
get currentEffect(): DragDropEffects {
|
|
109
|
+
return this.currentEffectValue;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
get isActive(): bool {
|
|
113
|
+
return this.activeValue;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
onCompleted(cb: ((effect: DragDropEffects) => void) | null): DragSession {
|
|
117
|
+
this.completedCallback = cb;
|
|
118
|
+
this.completedBinding = null;
|
|
119
|
+
return this;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
onCompletedWith<Owner>(owner: Owner, handler: Handler1<Owner, DragDropEffects>): DragSession {
|
|
123
|
+
this.completedCallback = null;
|
|
124
|
+
this.completedBinding = bind1<Owner, DragDropEffects>(owner, handler);
|
|
125
|
+
return this;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
cancel(): void {
|
|
129
|
+
if (!this.activeValue) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
EventRouter.cancelDragSession(this);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
_setCurrentEffect(effect: DragDropEffects): void {
|
|
136
|
+
this.currentEffectValue = effect;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
_complete(effect: DragDropEffects): void {
|
|
140
|
+
if (!this.activeValue) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.activeValue = false;
|
|
144
|
+
this.currentEffectValue = effect;
|
|
145
|
+
const callback = this.completedCallback;
|
|
146
|
+
if (callback !== null) {
|
|
147
|
+
callback(effect);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const binding = this.completedBinding;
|
|
151
|
+
if (binding !== null) {
|
|
152
|
+
binding.invoke(effect);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export class DragEventArgs {
|
|
158
|
+
readonly session: DragSession;
|
|
159
|
+
readonly x: f32;
|
|
160
|
+
readonly y: f32;
|
|
161
|
+
readonly modifiers: u32;
|
|
162
|
+
|
|
163
|
+
constructor(session: DragSession, x: f32, y: f32, modifiers: u32) {
|
|
164
|
+
this.session = session;
|
|
165
|
+
this.x = x;
|
|
166
|
+
this.y = y;
|
|
167
|
+
this.modifiers = modifiers;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export enum ExternalDropItemKind {
|
|
172
|
+
File = 1,
|
|
173
|
+
Text = 2,
|
|
174
|
+
Uri = 3,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export class ExternalDropItemInfo {
|
|
178
|
+
readonly id: string;
|
|
179
|
+
readonly kind: ExternalDropItemKind;
|
|
180
|
+
readonly name: string;
|
|
181
|
+
readonly mimeType: string | null;
|
|
182
|
+
readonly sizeBytes: f64;
|
|
183
|
+
readonly file: BrowserFile | null;
|
|
184
|
+
|
|
185
|
+
constructor(
|
|
186
|
+
id: string,
|
|
187
|
+
kind: ExternalDropItemKind,
|
|
188
|
+
name: string,
|
|
189
|
+
mimeType: string | null = null,
|
|
190
|
+
sizeBytes: f64 = 0.0,
|
|
191
|
+
file: BrowserFile | null = null,
|
|
192
|
+
) {
|
|
193
|
+
this.id = id;
|
|
194
|
+
this.kind = kind;
|
|
195
|
+
this.name = name;
|
|
196
|
+
this.mimeType = mimeType;
|
|
197
|
+
this.sizeBytes = sizeBytes;
|
|
198
|
+
this.file = file;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export class ExternalDropEventArgs {
|
|
203
|
+
readonly x: f32;
|
|
204
|
+
readonly y: f32;
|
|
205
|
+
readonly modifiers: u32;
|
|
206
|
+
readonly items: Array<ExternalDropItemInfo>;
|
|
207
|
+
|
|
208
|
+
constructor(x: f32, y: f32, modifiers: u32, items: Array<ExternalDropItemInfo>) {
|
|
209
|
+
this.x = x;
|
|
210
|
+
this.y = y;
|
|
211
|
+
this.modifiers = modifiers;
|
|
212
|
+
this.items = items;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export abstract class Node implements DragGestureHost, Disposable {
|
|
217
|
+
protected handle: u64 = <u64>HandleValue.Invalid;
|
|
218
|
+
protected childNodes: Array<Node> = new Array<Node>();
|
|
219
|
+
protected retainedParent: Node | null = null;
|
|
220
|
+
private readonly attachedPropertyKey: u32 = allocateAttachedPropertyKey();
|
|
221
|
+
private disposedValue: bool = false;
|
|
222
|
+
|
|
223
|
+
private nodeIdValue: string | null = null;
|
|
224
|
+
private semanticRoleValue: SemanticRole = SemanticRole.None;
|
|
225
|
+
private hasSemanticRole: bool = false;
|
|
226
|
+
private defaultSemanticRoleValue: SemanticRole = SemanticRole.None;
|
|
227
|
+
private hasDefaultSemanticRole: bool = false;
|
|
228
|
+
private semanticLabelValue: string | null = null;
|
|
229
|
+
private hasSemanticLabel: bool = false;
|
|
230
|
+
private defaultSemanticLabelValue: string | null = null;
|
|
231
|
+
private hasDefaultSemanticLabel: bool = false;
|
|
232
|
+
private semanticCheckedStateValue: SemanticCheckedState = SemanticCheckedState.None;
|
|
233
|
+
private hasSemanticSelected: bool = false;
|
|
234
|
+
private semanticSelectedValue: bool = false;
|
|
235
|
+
private hasSemanticExpanded: bool = false;
|
|
236
|
+
private semanticExpandedValue: bool = false;
|
|
237
|
+
private hasSemanticDisabled: bool = false;
|
|
238
|
+
private semanticDisabledValue: bool = false;
|
|
239
|
+
private trackSemanticDisabledFromEnabled: bool = false;
|
|
240
|
+
private hasSemanticValueRange: bool = false;
|
|
241
|
+
private semanticValueNow: f32 = 0.0;
|
|
242
|
+
private semanticValueMin: f32 = 0.0;
|
|
243
|
+
private semanticValueMax: f32 = 0.0;
|
|
244
|
+
private semanticOrientationValue: Orientation = Orientation.None;
|
|
245
|
+
private portalFlag: bool = false;
|
|
246
|
+
private clickCallback: (() => void) | null = null;
|
|
247
|
+
private clickBinding: Callback0 | null = null;
|
|
248
|
+
private pointerDownCallback: ((x: f32, y: f32) => void) | null = null;
|
|
249
|
+
private pointerMoveCallback: ((x: f32, y: f32) => void) | null = null;
|
|
250
|
+
private pointerUpCallback: ((x: f32, y: f32) => void) | null = null;
|
|
251
|
+
private pointerEnterCallback: (() => void) | null = null;
|
|
252
|
+
private pointerLeaveCallback: (() => void) | null = null;
|
|
253
|
+
private dragDataCallback: (() => DragDataObject | null) | null = null;
|
|
254
|
+
private dragDataBinding: ResultCallback0<DragDataObject | null> | null = null;
|
|
255
|
+
private dragAllowedEffectsValue: DragDropEffects = DragDropEffects.Copy;
|
|
256
|
+
private dragCompletedCallback: ((effect: DragDropEffects) => void) | null = null;
|
|
257
|
+
private dragCompletedBinding: Callback1<DragDropEffects> | null = null;
|
|
258
|
+
private dropAllowedValue: bool = false;
|
|
259
|
+
private dragEnterCallback: ((args: DragEventArgs) => DropProposal) | null = null;
|
|
260
|
+
private dragEnterBinding: ResultCallback1<DragEventArgs, DropProposal> | null = null;
|
|
261
|
+
private dragOverCallback: ((args: DragEventArgs) => DropProposal) | null = null;
|
|
262
|
+
private dragOverBinding: ResultCallback1<DragEventArgs, DropProposal> | null = null;
|
|
263
|
+
private dragLeaveCallback: ((args: DragEventArgs) => void) | null = null;
|
|
264
|
+
private dragLeaveBinding: Callback1<DragEventArgs> | null = null;
|
|
265
|
+
private dropCallback: ((args: DragEventArgs) => void) | null = null;
|
|
266
|
+
private dropBinding: Callback1<DragEventArgs> | null = null;
|
|
267
|
+
private externalDropAllowedValue: bool = false;
|
|
268
|
+
private externalDragEnterCallback: ((args: ExternalDropEventArgs) => DropProposal) | null = null;
|
|
269
|
+
private externalDragEnterBinding: ResultCallback1<ExternalDropEventArgs, DropProposal> | null = null;
|
|
270
|
+
private externalDragOverCallback: ((args: ExternalDropEventArgs) => DropProposal) | null = null;
|
|
271
|
+
private externalDragOverBinding: ResultCallback1<ExternalDropEventArgs, DropProposal> | null = null;
|
|
272
|
+
private externalDragLeaveCallback: ((args: ExternalDropEventArgs) => void) | null = null;
|
|
273
|
+
private externalDragLeaveBinding: Callback1<ExternalDropEventArgs> | null = null;
|
|
274
|
+
private externalDropCallback: ((args: ExternalDropEventArgs) => void) | null = null;
|
|
275
|
+
private externalDropBinding: Callback1<ExternalDropEventArgs> | null = null;
|
|
276
|
+
private dragGestureValue: DragGesture | null = null;
|
|
277
|
+
private dragClickPending: bool = false;
|
|
278
|
+
private contextMenuCallback: ((target: Node | null, x: f32, y: f32) => void) | null = null;
|
|
279
|
+
private contextMenuDisabledValue: bool = false;
|
|
280
|
+
private focusableFlag: bool = false;
|
|
281
|
+
private focusableTabIndex: i32 = 0;
|
|
282
|
+
private focusChangedCb: ((focused: bool) => void) | null = null;
|
|
283
|
+
private focusChangedBinding: Callback1<bool> | null = null;
|
|
284
|
+
private keyDownCb: ((key: string, mods: u32) => void) | null = null;
|
|
285
|
+
private keyDownBinding: Callback2<string, u32> | null = null;
|
|
286
|
+
private keyUpCb: ((key: string, mods: u32) => void) | null = null;
|
|
287
|
+
private hasPointerCallbacks: bool = false;
|
|
288
|
+
private cursorValue: CursorStyle = CursorStyle.Default;
|
|
289
|
+
private ownEnabled: bool = true;
|
|
290
|
+
private inheritedEnabled: bool = true;
|
|
291
|
+
private lastEffectiveEnabled: bool = true;
|
|
292
|
+
private ownVisibility: Visibility = Visibility.Normal;
|
|
293
|
+
private inheritedVisibility: Visibility = Visibility.Normal;
|
|
294
|
+
private lastEffectiveVisibility: Visibility = Visibility.Normal;
|
|
295
|
+
private scrollProxyTargetHandle: u64 = <u64>HandleValue.Invalid;
|
|
296
|
+
private toolTipValue: ToolTip | null = null;
|
|
297
|
+
private persistedStateAdapters: Array<PersistedStateAdapter> = new Array<PersistedStateAdapter>();
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
get builtHandle(): u64 {
|
|
301
|
+
return this.handle;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
get childCount(): i32 {
|
|
305
|
+
return this.childNodes.length;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
get parentNode(): Node | null {
|
|
309
|
+
return this.retainedParent;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
get attachedToolTip(): ToolTip | null {
|
|
313
|
+
return this.toolTipValue;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
get isDisposed(): bool {
|
|
317
|
+
return this.disposedValue;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
getBounds(): Float32Array {
|
|
321
|
+
if (!this.hasBuiltHandle()) {
|
|
322
|
+
return new Float32Array(4);
|
|
323
|
+
}
|
|
324
|
+
const bounds = ui.tryGetBounds(this.handle);
|
|
325
|
+
if (bounds !== null) {
|
|
326
|
+
return bounds;
|
|
327
|
+
}
|
|
328
|
+
return new Float32Array(4);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
absoluteToLocalPosition(absoluteX: f32, absoluteY: f32): Float32Array {
|
|
332
|
+
const bounds = this.getBounds();
|
|
333
|
+
const point = new Float32Array(2);
|
|
334
|
+
unchecked(point[0] = absoluteX - unchecked(bounds[0]));
|
|
335
|
+
unchecked(point[1] = absoluteY - unchecked(bounds[1]));
|
|
336
|
+
return point;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
localToAbsolutePosition(localX: f32, localY: f32): Float32Array {
|
|
340
|
+
const bounds = this.getBounds();
|
|
341
|
+
const point = new Float32Array(2);
|
|
342
|
+
unchecked(point[0] = localX + unchecked(bounds[0]));
|
|
343
|
+
unchecked(point[1] = localY + unchecked(bounds[1]));
|
|
344
|
+
return point;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
get cursorStyle(): CursorStyle {
|
|
348
|
+
return this.cursorValue;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
get isEnabled(): bool {
|
|
352
|
+
return this.ownEnabled && this.inheritedEnabled;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
get isVisible(): bool {
|
|
356
|
+
return this.effectiveVisibility() == Visibility.Normal;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
get isSelectionBarrier(): bool {
|
|
360
|
+
return false;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
get isContextMenuDisabled(): bool {
|
|
364
|
+
return this.contextMenuDisabledValue;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
get contextMenuHandler(): ((target: Node | null, x: f32, y: f32) => void) | null {
|
|
368
|
+
return this.contextMenuCallback;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
getChildAt(index: i32): Node | null {
|
|
372
|
+
if (index < 0 || index >= this.childNodes.length) {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
return unchecked(this.childNodes[index]);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
cursor(style: CursorStyle): this {
|
|
379
|
+
this.cursorValue = style;
|
|
380
|
+
EventRouter.handleCursorStyleChanged(this);
|
|
381
|
+
return this;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
nodeId(id: string): this {
|
|
385
|
+
this.nodeIdValue = id;
|
|
386
|
+
if (this.hasBuiltHandle()) {
|
|
387
|
+
ui.setNodeId(this.handle, id);
|
|
388
|
+
this.notifyRetainedMutation();
|
|
389
|
+
}
|
|
390
|
+
return this;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
persistState(adapter: PersistedStateAdapter): this {
|
|
394
|
+
if (adapter == null) {
|
|
395
|
+
throwNullArgument("Node.persistState", "adapter");
|
|
396
|
+
}
|
|
397
|
+
for (let index = 0; index < this.persistedStateAdapters.length; ++index) {
|
|
398
|
+
if (unchecked(this.persistedStateAdapters[index]).kind == adapter.kind) {
|
|
399
|
+
unchecked(this.persistedStateAdapters[index] = adapter);
|
|
400
|
+
return this;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
this.persistedStateAdapters.push(adapter);
|
|
404
|
+
return this;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
protected getNodeId(): string | null {
|
|
408
|
+
return this.nodeIdValue;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
semanticRole(role: SemanticRole): this {
|
|
412
|
+
this.semanticRoleValue = role;
|
|
413
|
+
this.hasSemanticRole = true;
|
|
414
|
+
if (this.hasBuiltHandle()) {
|
|
415
|
+
this.applyResolvedSemanticRole();
|
|
416
|
+
this.notifyRetainedMutation();
|
|
417
|
+
}
|
|
418
|
+
return this;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
semanticLabel(label: string): this {
|
|
422
|
+
this.semanticLabelValue = label;
|
|
423
|
+
this.hasSemanticLabel = true;
|
|
424
|
+
if (this.hasBuiltHandle()) {
|
|
425
|
+
this.applyResolvedSemanticLabel();
|
|
426
|
+
this.notifyRetainedMutation();
|
|
427
|
+
}
|
|
428
|
+
return this;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
protected hasExplicitSemanticRole(): bool {
|
|
432
|
+
return this.hasSemanticRole;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
protected hasExplicitSemanticLabel(): bool {
|
|
436
|
+
return this.hasSemanticLabel;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
protected setDefaultSemanticRole(role: SemanticRole): void {
|
|
440
|
+
if (this.hasDefaultSemanticRole == (role != SemanticRole.None) && this.defaultSemanticRoleValue == role) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this.defaultSemanticRoleValue = role;
|
|
444
|
+
this.hasDefaultSemanticRole = role != SemanticRole.None;
|
|
445
|
+
if (this.hasBuiltHandle() && !this.hasSemanticRole) {
|
|
446
|
+
this.applyResolvedSemanticRole();
|
|
447
|
+
this.notifyRetainedMutation();
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
protected setDefaultSemanticLabel(label: string): void {
|
|
452
|
+
if (this.hasDefaultSemanticLabel && this.defaultSemanticLabelValue !== null && changetype<string>(this.defaultSemanticLabelValue) == label) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
this.defaultSemanticLabelValue = label;
|
|
456
|
+
this.hasDefaultSemanticLabel = true;
|
|
457
|
+
if (this.hasBuiltHandle() && !this.hasSemanticLabel) {
|
|
458
|
+
this.applyResolvedSemanticLabel();
|
|
459
|
+
this.notifyRetainedMutation();
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
protected clearDefaultSemanticRole(): void {
|
|
464
|
+
if (!this.hasDefaultSemanticRole && this.defaultSemanticRoleValue == SemanticRole.None) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.defaultSemanticRoleValue = SemanticRole.None;
|
|
468
|
+
this.hasDefaultSemanticRole = false;
|
|
469
|
+
if (this.hasBuiltHandle() && !this.hasSemanticRole) {
|
|
470
|
+
this.applyResolvedSemanticRole();
|
|
471
|
+
this.notifyRetainedMutation();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
protected clearDefaultSemanticLabel(): void {
|
|
476
|
+
if (!this.hasDefaultSemanticLabel && this.defaultSemanticLabelValue === null) {
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
this.defaultSemanticLabelValue = null;
|
|
480
|
+
this.hasDefaultSemanticLabel = false;
|
|
481
|
+
if (this.hasBuiltHandle() && !this.hasSemanticLabel) {
|
|
482
|
+
this.applyResolvedSemanticLabel();
|
|
483
|
+
this.notifyRetainedMutation();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
semanticChecked(state: SemanticCheckedState): this {
|
|
488
|
+
this.semanticCheckedStateValue = state;
|
|
489
|
+
if (this.hasBuiltHandle()) {
|
|
490
|
+
ui.setSemanticChecked(this.handle, <u32>state);
|
|
491
|
+
this.notifyRetainedMutation();
|
|
492
|
+
}
|
|
493
|
+
return this;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
semanticDisabled(flag: bool): this {
|
|
497
|
+
this.trackSemanticDisabledFromEnabled = false;
|
|
498
|
+
this.hasSemanticDisabled = true;
|
|
499
|
+
this.semanticDisabledValue = flag;
|
|
500
|
+
if (this.hasBuiltHandle()) {
|
|
501
|
+
ui.setSemanticDisabled(this.handle, true, flag);
|
|
502
|
+
this.notifyRetainedMutation();
|
|
503
|
+
}
|
|
504
|
+
return this;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
clearSemanticDisabled(): this {
|
|
508
|
+
this.trackSemanticDisabledFromEnabled = false;
|
|
509
|
+
this.hasSemanticDisabled = false;
|
|
510
|
+
this.semanticDisabledValue = false;
|
|
511
|
+
if (this.hasBuiltHandle()) {
|
|
512
|
+
ui.setSemanticDisabled(this.handle, false, false);
|
|
513
|
+
this.notifyRetainedMutation();
|
|
514
|
+
}
|
|
515
|
+
return this;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
semanticSelected(flag: bool): this {
|
|
519
|
+
this.hasSemanticSelected = true;
|
|
520
|
+
this.semanticSelectedValue = flag;
|
|
521
|
+
if (this.hasBuiltHandle()) {
|
|
522
|
+
ui.setSemanticSelected(this.handle, true, flag);
|
|
523
|
+
this.notifyRetainedMutation();
|
|
524
|
+
}
|
|
525
|
+
return this;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
clearSemanticSelected(): this {
|
|
529
|
+
this.hasSemanticSelected = false;
|
|
530
|
+
this.semanticSelectedValue = false;
|
|
531
|
+
if (this.hasBuiltHandle()) {
|
|
532
|
+
ui.setSemanticSelected(this.handle, false, false);
|
|
533
|
+
this.notifyRetainedMutation();
|
|
534
|
+
}
|
|
535
|
+
return this;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
semanticExpanded(flag: bool): this {
|
|
539
|
+
this.hasSemanticExpanded = true;
|
|
540
|
+
this.semanticExpandedValue = flag;
|
|
541
|
+
if (this.hasBuiltHandle()) {
|
|
542
|
+
ui.setSemanticExpanded(this.handle, true, flag);
|
|
543
|
+
this.notifyRetainedMutation();
|
|
544
|
+
}
|
|
545
|
+
return this;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
clearSemanticExpanded(): this {
|
|
549
|
+
this.hasSemanticExpanded = false;
|
|
550
|
+
this.semanticExpandedValue = false;
|
|
551
|
+
if (this.hasBuiltHandle()) {
|
|
552
|
+
ui.setSemanticExpanded(this.handle, false, false);
|
|
553
|
+
this.notifyRetainedMutation();
|
|
554
|
+
}
|
|
555
|
+
return this;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
semanticValueRange(valueNow: f32, valueMin: f32, valueMax: f32): this {
|
|
559
|
+
this.hasSemanticValueRange = true;
|
|
560
|
+
this.semanticValueNow = valueNow;
|
|
561
|
+
this.semanticValueMin = valueMin;
|
|
562
|
+
this.semanticValueMax = valueMax;
|
|
563
|
+
if (this.hasBuiltHandle()) {
|
|
564
|
+
ui.setSemanticValueRange(this.handle, true, valueNow, valueMin, valueMax);
|
|
565
|
+
this.notifyRetainedMutation();
|
|
566
|
+
}
|
|
567
|
+
return this;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
clearSemanticValueRange(): this {
|
|
571
|
+
this.hasSemanticValueRange = false;
|
|
572
|
+
this.semanticValueNow = 0.0;
|
|
573
|
+
this.semanticValueMin = 0.0;
|
|
574
|
+
this.semanticValueMax = 0.0;
|
|
575
|
+
if (this.hasBuiltHandle()) {
|
|
576
|
+
ui.setSemanticValueRange(this.handle, false, 0.0, 0.0, 0.0);
|
|
577
|
+
this.notifyRetainedMutation();
|
|
578
|
+
}
|
|
579
|
+
return this;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
semanticOrientation(orientation: Orientation): this {
|
|
583
|
+
this.semanticOrientationValue = orientation;
|
|
584
|
+
if (this.hasBuiltHandle()) {
|
|
585
|
+
ui.setSemanticOrientation(this.handle, <u32>orientation);
|
|
586
|
+
this.notifyRetainedMutation();
|
|
587
|
+
}
|
|
588
|
+
return this;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
requestSemanticAnnouncement(): this {
|
|
592
|
+
if (this.hasBuiltHandle()) {
|
|
593
|
+
ui.requestSemanticAnnouncement(this.handle);
|
|
594
|
+
}
|
|
595
|
+
return this;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
onClick(cb: () => void): this {
|
|
599
|
+
this.clickCallback = cb;
|
|
600
|
+
this.clickBinding = null;
|
|
601
|
+
this.requireInteractive();
|
|
602
|
+
return this;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
bindClick<Owner>(owner: Owner, handler: Handler0<Owner>): this {
|
|
606
|
+
this.clickCallback = null;
|
|
607
|
+
this.clickBinding = bind0<Owner>(owner, handler);
|
|
608
|
+
this.requireInteractive();
|
|
609
|
+
return this;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
onClickWith<Owner>(owner: Owner, handler: Handler0<Owner>): this {
|
|
613
|
+
this.bindClick(owner, handler);
|
|
614
|
+
return this;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
onPointerDown(cb: (x: f32, y: f32) => void): this {
|
|
618
|
+
this.pointerDownCallback = cb;
|
|
619
|
+
this.requireInteractive();
|
|
620
|
+
return this;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
onPointerMove(cb: (x: f32, y: f32) => void): this {
|
|
624
|
+
this.pointerMoveCallback = cb;
|
|
625
|
+
this.requireInteractive();
|
|
626
|
+
return this;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
onPointerUp(cb: (x: f32, y: f32) => void): this {
|
|
630
|
+
this.pointerUpCallback = cb;
|
|
631
|
+
this.requireInteractive();
|
|
632
|
+
return this;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
onPointerEnter(cb: () => void): this {
|
|
636
|
+
this.pointerEnterCallback = cb;
|
|
637
|
+
this.requireInteractive();
|
|
638
|
+
return this;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
onPointerLeave(cb: () => void): this {
|
|
642
|
+
this.pointerLeaveCallback = cb;
|
|
643
|
+
this.requireInteractive();
|
|
644
|
+
return this;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
dragAllowedEffects(effects: DragDropEffects): this {
|
|
648
|
+
this.dragAllowedEffectsValue = effects;
|
|
649
|
+
return this;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
dragData(cb: (() => DragDataObject | null) | null): this {
|
|
653
|
+
this.dragDataCallback = cb;
|
|
654
|
+
this.dragDataBinding = null;
|
|
655
|
+
if (cb !== null) {
|
|
656
|
+
this.requireInteractive();
|
|
657
|
+
this.ensureDragGesture();
|
|
658
|
+
}
|
|
659
|
+
return this;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
bindDragData<Owner>(owner: Owner, handler: ResultHandler0<Owner, DragDataObject | null>): this {
|
|
663
|
+
this.dragDataCallback = null;
|
|
664
|
+
this.dragDataBinding = bindResult0<Owner, DragDataObject | null>(owner, handler);
|
|
665
|
+
this.requireInteractive();
|
|
666
|
+
this.ensureDragGesture();
|
|
667
|
+
return this;
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
allowDrop(flag: bool = true): this {
|
|
671
|
+
this.dropAllowedValue = flag;
|
|
672
|
+
if (flag) {
|
|
673
|
+
this.requireInteractive();
|
|
674
|
+
}
|
|
675
|
+
return this;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
onDragCompleted(cb: ((effect: DragDropEffects) => void) | null): this {
|
|
679
|
+
this.dragCompletedCallback = cb;
|
|
680
|
+
this.dragCompletedBinding = null;
|
|
681
|
+
return this;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
onDragCompletedWith<Owner>(owner: Owner, handler: Handler1<Owner, DragDropEffects>): this {
|
|
685
|
+
this.dragCompletedCallback = null;
|
|
686
|
+
this.dragCompletedBinding = bind1<Owner, DragDropEffects>(owner, handler);
|
|
687
|
+
return this;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
onDragEnter(cb: ((args: DragEventArgs) => DropProposal) | null): this {
|
|
691
|
+
this.dragEnterCallback = cb;
|
|
692
|
+
this.dragEnterBinding = null;
|
|
693
|
+
if (cb !== null) {
|
|
694
|
+
this.allowDrop(true);
|
|
695
|
+
}
|
|
696
|
+
return this;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
onDragEnterWith<Owner>(owner: Owner, handler: ResultHandler1<Owner, DragEventArgs, DropProposal>): this {
|
|
700
|
+
this.dragEnterCallback = null;
|
|
701
|
+
this.dragEnterBinding = bindResult1<Owner, DragEventArgs, DropProposal>(owner, handler);
|
|
702
|
+
this.allowDrop(true);
|
|
703
|
+
return this;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
onDragOver(cb: ((args: DragEventArgs) => DropProposal) | null): this {
|
|
707
|
+
this.dragOverCallback = cb;
|
|
708
|
+
this.dragOverBinding = null;
|
|
709
|
+
if (cb !== null) {
|
|
710
|
+
this.allowDrop(true);
|
|
711
|
+
}
|
|
712
|
+
return this;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
onDragOverWith<Owner>(owner: Owner, handler: ResultHandler1<Owner, DragEventArgs, DropProposal>): this {
|
|
716
|
+
this.dragOverCallback = null;
|
|
717
|
+
this.dragOverBinding = bindResult1<Owner, DragEventArgs, DropProposal>(owner, handler);
|
|
718
|
+
this.allowDrop(true);
|
|
719
|
+
return this;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
onDragLeave(cb: ((args: DragEventArgs) => void) | null): this {
|
|
723
|
+
this.dragLeaveCallback = cb;
|
|
724
|
+
this.dragLeaveBinding = null;
|
|
725
|
+
if (cb !== null) {
|
|
726
|
+
this.allowDrop(true);
|
|
727
|
+
}
|
|
728
|
+
return this;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
onDragLeaveWith<Owner>(owner: Owner, handler: Handler1<Owner, DragEventArgs>): this {
|
|
732
|
+
this.dragLeaveCallback = null;
|
|
733
|
+
this.dragLeaveBinding = bind1<Owner, DragEventArgs>(owner, handler);
|
|
734
|
+
this.allowDrop(true);
|
|
735
|
+
return this;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
onDrop(cb: ((args: DragEventArgs) => void) | null): this {
|
|
739
|
+
this.dropCallback = cb;
|
|
740
|
+
this.dropBinding = null;
|
|
741
|
+
if (cb !== null) {
|
|
742
|
+
this.allowDrop(true);
|
|
743
|
+
}
|
|
744
|
+
return this;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
onDropWith<Owner>(owner: Owner, handler: Handler1<Owner, DragEventArgs>): this {
|
|
748
|
+
this.dropCallback = null;
|
|
749
|
+
this.dropBinding = bind1<Owner, DragEventArgs>(owner, handler);
|
|
750
|
+
this.allowDrop(true);
|
|
751
|
+
return this;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
allowExternalDrop(flag: bool = true): this {
|
|
755
|
+
this.externalDropAllowedValue = flag;
|
|
756
|
+
if (flag) {
|
|
757
|
+
this.requireInteractive();
|
|
758
|
+
}
|
|
759
|
+
return this;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
onExternalDragEnter(cb: ((args: ExternalDropEventArgs) => DropProposal) | null): this {
|
|
763
|
+
this.externalDragEnterCallback = cb;
|
|
764
|
+
this.externalDragEnterBinding = null;
|
|
765
|
+
if (cb !== null) {
|
|
766
|
+
this.allowExternalDrop(true);
|
|
767
|
+
}
|
|
768
|
+
return this;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
onExternalDragEnterWith<Owner>(owner: Owner, handler: ResultHandler1<Owner, ExternalDropEventArgs, DropProposal>): this {
|
|
772
|
+
this.externalDragEnterCallback = null;
|
|
773
|
+
this.externalDragEnterBinding = bindResult1<Owner, ExternalDropEventArgs, DropProposal>(owner, handler);
|
|
774
|
+
this.allowExternalDrop(true);
|
|
775
|
+
return this;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
onExternalDragOver(cb: ((args: ExternalDropEventArgs) => DropProposal) | null): this {
|
|
779
|
+
this.externalDragOverCallback = cb;
|
|
780
|
+
this.externalDragOverBinding = null;
|
|
781
|
+
if (cb !== null) {
|
|
782
|
+
this.allowExternalDrop(true);
|
|
783
|
+
}
|
|
784
|
+
return this;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
onExternalDragOverWith<Owner>(owner: Owner, handler: ResultHandler1<Owner, ExternalDropEventArgs, DropProposal>): this {
|
|
788
|
+
this.externalDragOverCallback = null;
|
|
789
|
+
this.externalDragOverBinding = bindResult1<Owner, ExternalDropEventArgs, DropProposal>(owner, handler);
|
|
790
|
+
this.allowExternalDrop(true);
|
|
791
|
+
return this;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
onExternalDragLeave(cb: ((args: ExternalDropEventArgs) => void) | null): this {
|
|
795
|
+
this.externalDragLeaveCallback = cb;
|
|
796
|
+
this.externalDragLeaveBinding = null;
|
|
797
|
+
if (cb !== null) {
|
|
798
|
+
this.allowExternalDrop(true);
|
|
799
|
+
}
|
|
800
|
+
return this;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
onExternalDragLeaveWith<Owner>(owner: Owner, handler: Handler1<Owner, ExternalDropEventArgs>): this {
|
|
804
|
+
this.externalDragLeaveCallback = null;
|
|
805
|
+
this.externalDragLeaveBinding = bind1<Owner, ExternalDropEventArgs>(owner, handler);
|
|
806
|
+
this.allowExternalDrop(true);
|
|
807
|
+
return this;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
onExternalDrop(cb: ((args: ExternalDropEventArgs) => void) | null): this {
|
|
811
|
+
this.externalDropCallback = cb;
|
|
812
|
+
this.externalDropBinding = null;
|
|
813
|
+
if (cb !== null) {
|
|
814
|
+
this.allowExternalDrop(true);
|
|
815
|
+
}
|
|
816
|
+
return this;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
onExternalDropWith<Owner>(owner: Owner, handler: Handler1<Owner, ExternalDropEventArgs>): this {
|
|
820
|
+
this.externalDropCallback = null;
|
|
821
|
+
this.externalDropBinding = bind1<Owner, ExternalDropEventArgs>(owner, handler);
|
|
822
|
+
this.allowExternalDrop(true);
|
|
823
|
+
return this;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
toolTip(toolTip: ToolTip | null): this {
|
|
827
|
+
this.toolTipValue = toolTip;
|
|
828
|
+
if (toolTip !== null) {
|
|
829
|
+
this.requireInteractive();
|
|
830
|
+
if (this.hasBuiltHandle() && this.isEnabled && this.isVisible) {
|
|
831
|
+
ui.setInteractive(this.handle, true);
|
|
832
|
+
this.notifyRetainedMutation();
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
ToolTipManager.handleToolTipChanged(this, toolTip);
|
|
836
|
+
return this;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
toolTipText(text: string): this {
|
|
840
|
+
this.toolTip(ToolTip.text(text));
|
|
841
|
+
return this;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
clearToolTip(): this {
|
|
845
|
+
this.toolTip(null);
|
|
846
|
+
return this;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
onContextMenu(cb: ((target: Node | null, x: f32, y: f32) => void) | null): this {
|
|
850
|
+
this.contextMenuCallback = cb;
|
|
851
|
+
return this;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
disableContextMenu(flag: bool = true): this {
|
|
855
|
+
this.contextMenuDisabledValue = flag;
|
|
856
|
+
return this;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
focusable(flag: bool, tabIndex: i32 = 0): this {
|
|
860
|
+
this.focusableFlag = flag;
|
|
861
|
+
this.focusableTabIndex = tabIndex;
|
|
862
|
+
if (flag) {
|
|
863
|
+
this.requireInteractive();
|
|
864
|
+
}
|
|
865
|
+
if (this.hasBuiltHandle()) {
|
|
866
|
+
ui.setFocusable(this.handle, this.isEnabled && this.isVisible && flag, tabIndex);
|
|
867
|
+
if (this.hasPointerCallbacks) {
|
|
868
|
+
ui.setInteractive(this.handle, this.isEnabled && this.isVisible);
|
|
869
|
+
}
|
|
870
|
+
this.notifyRetainedMutation();
|
|
871
|
+
}
|
|
872
|
+
return this;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
enabled(flag: bool): this {
|
|
876
|
+
if (this.ownEnabled == flag) {
|
|
877
|
+
return this;
|
|
878
|
+
}
|
|
879
|
+
this.ownEnabled = flag;
|
|
880
|
+
if (!flag) {
|
|
881
|
+
this.cancelDragState();
|
|
882
|
+
}
|
|
883
|
+
this.applyEnabledChanged();
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
visibility(value: Visibility): this {
|
|
888
|
+
if (this.ownVisibility == value) {
|
|
889
|
+
return this;
|
|
890
|
+
}
|
|
891
|
+
this.ownVisibility = value;
|
|
892
|
+
if (value != Visibility.Normal) {
|
|
893
|
+
this.cancelDragState();
|
|
894
|
+
}
|
|
895
|
+
this.applyVisibilityChanged();
|
|
896
|
+
return this;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
onFocusChanged(cb: (focused: bool) => void): this {
|
|
900
|
+
this.focusChangedCb = cb;
|
|
901
|
+
this.focusChangedBinding = null;
|
|
902
|
+
return this;
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
bindFocusChanged<Owner>(owner: Owner, handler: Handler1<Owner, bool>): this {
|
|
906
|
+
this.focusChangedCb = null;
|
|
907
|
+
this.focusChangedBinding = bind1<Owner, bool>(owner, handler);
|
|
908
|
+
return this;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
onFocusChangedWith<Owner>(owner: Owner, handler: Handler1<Owner, bool>): this {
|
|
912
|
+
this.bindFocusChanged(owner, handler);
|
|
913
|
+
return this;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
onKeyDown(cb: (key: string, mods: u32) => void): this {
|
|
917
|
+
this.keyDownCb = cb;
|
|
918
|
+
this.keyDownBinding = null;
|
|
919
|
+
return this;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
bindKeyDown<Owner>(owner: Owner, handler: Handler2<Owner, string, u32>): this {
|
|
923
|
+
this.keyDownCb = null;
|
|
924
|
+
this.keyDownBinding = bind2<Owner, string, u32>(owner, handler);
|
|
925
|
+
return this;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
onKeyDownWith<Owner>(owner: Owner, handler: Handler2<Owner, string, u32>): this {
|
|
929
|
+
this.bindKeyDown(owner, handler);
|
|
930
|
+
return this;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
onKeyUp(cb: (key: string, mods: u32) => void): this {
|
|
934
|
+
this.keyUpCb = cb;
|
|
935
|
+
return this;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
focusNow(): this {
|
|
939
|
+
if (this.hasBuiltHandle()) {
|
|
940
|
+
ui.requestFocus(this.handle);
|
|
941
|
+
}
|
|
942
|
+
return this;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
abstract build(): u64;
|
|
946
|
+
|
|
947
|
+
dispose(): void {
|
|
948
|
+
this.disposeTree();
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
protected setPortalFlag(flag: bool): void {
|
|
952
|
+
this.portalFlag = flag;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
protected appendChild(node: Node): void {
|
|
956
|
+
this.addChildNode(node);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
protected replaceChildren(nodes: Array<Node>): void {
|
|
960
|
+
while (this.childNodes.length > 0) {
|
|
961
|
+
const child = unchecked(this.childNodes[this.childNodes.length - 1]);
|
|
962
|
+
this.removeChildNode(child);
|
|
963
|
+
}
|
|
964
|
+
for (let i = 0; i < nodes.length; ++i) {
|
|
965
|
+
const node = unchecked(nodes[i]);
|
|
966
|
+
if (node == null) {
|
|
967
|
+
throwNullArgument("Node.replaceChildren", "nodes[" + i.toString() + "]");
|
|
968
|
+
}
|
|
969
|
+
this.addChildNode(node);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
addChildNode(node: Node): this {
|
|
974
|
+
if (node === this || this.indexOfChild(node) >= 0) {
|
|
975
|
+
return this;
|
|
976
|
+
}
|
|
977
|
+
const previousParent = node.retainedParent;
|
|
978
|
+
if (previousParent !== null) {
|
|
979
|
+
previousParent.removeChildNode(node);
|
|
980
|
+
}
|
|
981
|
+
node.retainedParent = this;
|
|
982
|
+
node.onRetainedParentChanged();
|
|
983
|
+
this.childNodes.push(node);
|
|
984
|
+
node._setInheritedEnabled(this.isEnabled);
|
|
985
|
+
node._setInheritedVisibility(this.effectiveVisibility());
|
|
986
|
+
if (this.hasBuiltHandle()) {
|
|
987
|
+
ui.addChild(this.handle, node.build());
|
|
988
|
+
this.notifyRetainedMutation();
|
|
989
|
+
this.onRetainedChildLayoutChanged();
|
|
990
|
+
}
|
|
991
|
+
return this;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
removeChildNode(node: Node): this {
|
|
995
|
+
const index = this.indexOfChild(node);
|
|
996
|
+
if (index < 0) {
|
|
997
|
+
return this;
|
|
998
|
+
}
|
|
999
|
+
if (this.hasBuiltHandle() && node.hasBuiltHandle()) {
|
|
1000
|
+
ui.removeChild(this.handle, node.handle);
|
|
1001
|
+
}
|
|
1002
|
+
for (let cursor = index; cursor < this.childNodes.length - 1; ++cursor) {
|
|
1003
|
+
unchecked(this.childNodes[cursor] = unchecked(this.childNodes[cursor + 1]));
|
|
1004
|
+
}
|
|
1005
|
+
this.childNodes.length = this.childNodes.length - 1;
|
|
1006
|
+
node.retainedParent = null;
|
|
1007
|
+
node.onRetainedParentChanged();
|
|
1008
|
+
node._setInheritedEnabled(true);
|
|
1009
|
+
node._setInheritedVisibility(Visibility.Normal);
|
|
1010
|
+
if (this.hasBuiltHandle()) {
|
|
1011
|
+
this.notifyRetainedMutation();
|
|
1012
|
+
this.onRetainedChildLayoutChanged();
|
|
1013
|
+
}
|
|
1014
|
+
return this;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
protected applyNodeMetadata(): void {
|
|
1018
|
+
if (this.nodeIdValue !== null) {
|
|
1019
|
+
ui.setNodeId(this.handle, changetype<string>(this.nodeIdValue));
|
|
1020
|
+
}
|
|
1021
|
+
if (this.hasSemanticRole || this.hasDefaultSemanticRole) {
|
|
1022
|
+
this.applyResolvedSemanticRole();
|
|
1023
|
+
}
|
|
1024
|
+
if (this.hasSemanticLabel || this.hasDefaultSemanticLabel) {
|
|
1025
|
+
this.applyResolvedSemanticLabel();
|
|
1026
|
+
}
|
|
1027
|
+
ui.setSemanticChecked(this.handle, <u32>this.semanticCheckedStateValue);
|
|
1028
|
+
ui.setSemanticSelected(this.handle, this.hasSemanticSelected, this.semanticSelectedValue);
|
|
1029
|
+
ui.setSemanticExpanded(this.handle, this.hasSemanticExpanded, this.semanticExpandedValue);
|
|
1030
|
+
ui.setSemanticDisabled(this.handle, this.hasSemanticDisabled, this.semanticDisabledValue);
|
|
1031
|
+
ui.setSemanticValueRange(
|
|
1032
|
+
this.handle,
|
|
1033
|
+
this.hasSemanticValueRange,
|
|
1034
|
+
this.semanticValueNow,
|
|
1035
|
+
this.semanticValueMin,
|
|
1036
|
+
this.semanticValueMax,
|
|
1037
|
+
);
|
|
1038
|
+
ui.setSemanticOrientation(this.handle, <u32>this.semanticOrientationValue);
|
|
1039
|
+
if (this.portalFlag) {
|
|
1040
|
+
ui.setIsPortal(this.handle, true);
|
|
1041
|
+
}
|
|
1042
|
+
ui.setVisibility(this.handle, <u32>this.effectiveVisibility());
|
|
1043
|
+
applyAttachedProperties(this.attachedPropertyKey, this.handle);
|
|
1044
|
+
if (Node.isBuiltHandle(this.scrollProxyTargetHandle)) {
|
|
1045
|
+
ui.setScrollProxyTarget(this.handle, this.scrollProxyTargetHandle);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
private resolvedSemanticRole(): SemanticRole {
|
|
1050
|
+
if (this.hasSemanticRole) {
|
|
1051
|
+
return this.semanticRoleValue;
|
|
1052
|
+
}
|
|
1053
|
+
if (this.hasDefaultSemanticRole) {
|
|
1054
|
+
return this.defaultSemanticRoleValue;
|
|
1055
|
+
}
|
|
1056
|
+
return SemanticRole.None;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
private resolvedSemanticLabel(): string | null {
|
|
1060
|
+
if (this.hasSemanticLabel) {
|
|
1061
|
+
return this.semanticLabelValue;
|
|
1062
|
+
}
|
|
1063
|
+
if (this.hasDefaultSemanticLabel) {
|
|
1064
|
+
return this.defaultSemanticLabelValue;
|
|
1065
|
+
}
|
|
1066
|
+
return null;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
private applyResolvedSemanticRole(): void {
|
|
1070
|
+
ui.setSemanticRole(this.handle, <u32>this.resolvedSemanticRole());
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
private applyResolvedSemanticLabel(): void {
|
|
1074
|
+
const label = this.resolvedSemanticLabel();
|
|
1075
|
+
if (label === null) {
|
|
1076
|
+
ui.setSemanticLabel(this.handle, "");
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
ui.setSemanticLabel(this.handle, changetype<string>(label));
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
protected finishBuild(): void {
|
|
1083
|
+
this.disposedValue = false;
|
|
1084
|
+
EventRouter.register(this.handle, this);
|
|
1085
|
+
if (this.focusableFlag && this.isEnabled && this.isVisible) {
|
|
1086
|
+
ui.setFocusable(this.handle, this.focusableFlag, this.focusableTabIndex);
|
|
1087
|
+
}
|
|
1088
|
+
if (this.hasPointerCallbacks && this.isEnabled && this.isVisible) {
|
|
1089
|
+
ui.setInteractive(this.handle, true);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
protected buildChildren(): void {
|
|
1094
|
+
for (let i = 0; i < this.childNodes.length; ++i) {
|
|
1095
|
+
const child = unchecked(this.childNodes[i]);
|
|
1096
|
+
ui.addChild(this.handle, child.build());
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
protected disposeTree(): void {
|
|
1101
|
+
if (this.disposedValue) {
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
this.disposedValue = true;
|
|
1105
|
+
const destroyedHandle = this.handle;
|
|
1106
|
+
this.cancelDragState();
|
|
1107
|
+
FocusAdornerManager.handleOwnerDestroyed(this);
|
|
1108
|
+
ToolTipManager.handleOwnerDestroyed(this);
|
|
1109
|
+
for (let i = this.childNodes.length - 1; i >= 0; --i) {
|
|
1110
|
+
unchecked(this.childNodes[i]).dispose();
|
|
1111
|
+
}
|
|
1112
|
+
this.childNodes.length = 0;
|
|
1113
|
+
if (this.hasBuiltHandle()) {
|
|
1114
|
+
EventRouter.unregister(this.handle);
|
|
1115
|
+
ui.deleteNode(this.handle);
|
|
1116
|
+
this.handle = <u64>HandleValue.Invalid;
|
|
1117
|
+
if (Node.isBuiltHandle(destroyedHandle)) {
|
|
1118
|
+
markNeedsCommit();
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
protected notifyRetainedMutation(): void {
|
|
1124
|
+
if (!this.hasBuiltHandle()) {
|
|
1125
|
+
return;
|
|
1126
|
+
}
|
|
1127
|
+
markNeedsCommit();
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
protected notifyRetainedLayoutMutation(): void {
|
|
1131
|
+
this.notifyRetainedMutation();
|
|
1132
|
+
const parent = this.retainedParent;
|
|
1133
|
+
if (parent !== null && parent.hasBuiltHandle()) {
|
|
1134
|
+
parent.onRetainedChildLayoutChanged();
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
protected onRetainedParentChanged(): void {}
|
|
1139
|
+
|
|
1140
|
+
protected onRetainedChildLayoutChanged(): void {}
|
|
1141
|
+
|
|
1142
|
+
protected static isBuiltHandle(handle: u64): bool {
|
|
1143
|
+
return handle != <u64>HandleValue.Invalid;
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
protected hasBuiltHandle(): bool {
|
|
1147
|
+
return Node.isBuiltHandle(this.handle);
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
protected capturePersistedState(): void {
|
|
1151
|
+
if (this.persistedStateAdapters.length == 0) {
|
|
1152
|
+
return;
|
|
1153
|
+
}
|
|
1154
|
+
const nodeId = this.getNodeId();
|
|
1155
|
+
if (nodeId === null || nodeId.length == 0) {
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
for (let index = 0; index < this.persistedStateAdapters.length; ++index) {
|
|
1159
|
+
const adapter = unchecked(this.persistedStateAdapters[index]);
|
|
1160
|
+
const payload = adapter.capture(this);
|
|
1161
|
+
if (payload === null) {
|
|
1162
|
+
continue;
|
|
1163
|
+
}
|
|
1164
|
+
storePersistedTextState(nodeId, adapter.kind, adapter.version, payload);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
protected restorePersistedState(): void {
|
|
1169
|
+
if (this.persistedStateAdapters.length == 0) {
|
|
1170
|
+
return;
|
|
1171
|
+
}
|
|
1172
|
+
const nodeId = this.getNodeId();
|
|
1173
|
+
if (nodeId === null || nodeId.length == 0) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
for (let index = 0; index < this.persistedStateAdapters.length; ++index) {
|
|
1177
|
+
const adapter = unchecked(this.persistedStateAdapters[index]);
|
|
1178
|
+
const persisted = tryLoadPersistedTextState(nodeId, adapter.kind);
|
|
1179
|
+
if (persisted === null) {
|
|
1180
|
+
continue;
|
|
1181
|
+
}
|
|
1182
|
+
adapter.restore(this, persisted.payload, persisted.version);
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
_hasDragSource(): bool {
|
|
1187
|
+
return this.dragDataCallback !== null || this.dragDataBinding !== null;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
_createDragDataObject(): DragDataObject | null {
|
|
1191
|
+
const callback = this.dragDataCallback;
|
|
1192
|
+
if (callback !== null) {
|
|
1193
|
+
return callback();
|
|
1194
|
+
}
|
|
1195
|
+
const binding = this.dragDataBinding;
|
|
1196
|
+
if (binding !== null) {
|
|
1197
|
+
return binding.invoke();
|
|
1198
|
+
}
|
|
1199
|
+
return null;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
_getDragAllowedEffects(): DragDropEffects {
|
|
1203
|
+
return this.dragAllowedEffectsValue;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
_notifyDragCompleted(effect: DragDropEffects): void {
|
|
1207
|
+
const callback = this.dragCompletedCallback;
|
|
1208
|
+
if (callback !== null) {
|
|
1209
|
+
callback(effect);
|
|
1210
|
+
} else {
|
|
1211
|
+
const binding = this.dragCompletedBinding;
|
|
1212
|
+
if (binding !== null) {
|
|
1213
|
+
binding.invoke(effect);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
_allowsDrop(): bool {
|
|
1219
|
+
return this.dropAllowedValue;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
_hasDragEnterHandler(): bool {
|
|
1223
|
+
return this.dragEnterCallback !== null || this.dragEnterBinding !== null;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
_hasDragOverHandler(): bool {
|
|
1227
|
+
return this.dragOverCallback !== null || this.dragOverBinding !== null;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
_handleDragEnter(args: DragEventArgs): DropProposal {
|
|
1231
|
+
const callback = this.dragEnterCallback;
|
|
1232
|
+
if (callback !== null) {
|
|
1233
|
+
return callback(args);
|
|
1234
|
+
}
|
|
1235
|
+
const binding = this.dragEnterBinding;
|
|
1236
|
+
if (binding !== null) {
|
|
1237
|
+
return binding.invoke(args);
|
|
1238
|
+
}
|
|
1239
|
+
return DropProposal.none();
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
_handleDragOver(args: DragEventArgs): DropProposal {
|
|
1243
|
+
const callback = this.dragOverCallback;
|
|
1244
|
+
if (callback !== null) {
|
|
1245
|
+
return callback(args);
|
|
1246
|
+
}
|
|
1247
|
+
const binding = this.dragOverBinding;
|
|
1248
|
+
if (binding !== null) {
|
|
1249
|
+
return binding.invoke(args);
|
|
1250
|
+
}
|
|
1251
|
+
return DropProposal.none();
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
_handleDragLeave(args: DragEventArgs): void {
|
|
1255
|
+
const callback = this.dragLeaveCallback;
|
|
1256
|
+
if (callback !== null) {
|
|
1257
|
+
callback(args);
|
|
1258
|
+
} else {
|
|
1259
|
+
const binding = this.dragLeaveBinding;
|
|
1260
|
+
if (binding !== null) {
|
|
1261
|
+
binding.invoke(args);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
_handleDropEvent(args: DragEventArgs): void {
|
|
1267
|
+
const callback = this.dropCallback;
|
|
1268
|
+
if (callback !== null) {
|
|
1269
|
+
callback(args);
|
|
1270
|
+
} else {
|
|
1271
|
+
const binding = this.dropBinding;
|
|
1272
|
+
if (binding !== null) {
|
|
1273
|
+
binding.invoke(args);
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
_allowsExternalDrop(): bool {
|
|
1279
|
+
return this.externalDropAllowedValue;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
_hasExternalDragEnterHandler(): bool {
|
|
1283
|
+
return this.externalDragEnterCallback !== null || this.externalDragEnterBinding !== null;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
_hasExternalDragOverHandler(): bool {
|
|
1287
|
+
return this.externalDragOverCallback !== null || this.externalDragOverBinding !== null;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
_handleExternalDragEnter(args: ExternalDropEventArgs): DropProposal {
|
|
1291
|
+
const callback = this.externalDragEnterCallback;
|
|
1292
|
+
if (callback !== null) {
|
|
1293
|
+
return callback(args);
|
|
1294
|
+
}
|
|
1295
|
+
const binding = this.externalDragEnterBinding;
|
|
1296
|
+
if (binding !== null) {
|
|
1297
|
+
return binding.invoke(args);
|
|
1298
|
+
}
|
|
1299
|
+
return DropProposal.none();
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
_handleExternalDragOver(args: ExternalDropEventArgs): DropProposal {
|
|
1303
|
+
const callback = this.externalDragOverCallback;
|
|
1304
|
+
if (callback !== null) {
|
|
1305
|
+
return callback(args);
|
|
1306
|
+
}
|
|
1307
|
+
const binding = this.externalDragOverBinding;
|
|
1308
|
+
if (binding !== null) {
|
|
1309
|
+
return binding.invoke(args);
|
|
1310
|
+
}
|
|
1311
|
+
return DropProposal.none();
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
_handleExternalDragLeave(args: ExternalDropEventArgs): void {
|
|
1315
|
+
const callback = this.externalDragLeaveCallback;
|
|
1316
|
+
if (callback !== null) {
|
|
1317
|
+
callback(args);
|
|
1318
|
+
} else {
|
|
1319
|
+
const binding = this.externalDragLeaveBinding;
|
|
1320
|
+
if (binding !== null) {
|
|
1321
|
+
binding.invoke(args);
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
_handleExternalDropEvent(args: ExternalDropEventArgs): void {
|
|
1327
|
+
const callback = this.externalDropCallback;
|
|
1328
|
+
if (callback !== null) {
|
|
1329
|
+
callback(args);
|
|
1330
|
+
} else {
|
|
1331
|
+
const binding = this.externalDropBinding;
|
|
1332
|
+
if (binding !== null) {
|
|
1333
|
+
binding.invoke(args);
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
_debugMainAxisPercentValue(_isHorizontal: bool): f32 {
|
|
1339
|
+
return -1.0;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
_debugIsAbsolutelyPositioned(): bool {
|
|
1343
|
+
return false;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
protected capturePointer(): void {
|
|
1347
|
+
if (!this.hasBuiltHandle()) {
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
const handle = this.handle;
|
|
1351
|
+
EventRouter.capturePointer(handle);
|
|
1352
|
+
fui_set_pointer_capture(handle);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
protected releasePointer(): void {
|
|
1356
|
+
if (!this.hasBuiltHandle()) {
|
|
1357
|
+
return;
|
|
1358
|
+
}
|
|
1359
|
+
const handle = this.handle;
|
|
1360
|
+
EventRouter.releasePointer(handle);
|
|
1361
|
+
fui_release_pointer_capture();
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
_captureDragPointer(): void {
|
|
1365
|
+
this.capturePointer();
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
_releaseDragPointer(): void {
|
|
1369
|
+
this.releasePointer();
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
_bindRegisteredHandle(handle: u64): void {
|
|
1373
|
+
this.handle = handle;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
_resolvedSemanticRole(): SemanticRole {
|
|
1377
|
+
return this.resolvedSemanticRole();
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
_attachedPropertyKey(): u32 {
|
|
1381
|
+
return this.attachedPropertyKey;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
_capturePersistedStateTree(): void {
|
|
1385
|
+
this.capturePersistedState();
|
|
1386
|
+
for (let index = 0; index < this.childNodes.length; ++index) {
|
|
1387
|
+
unchecked(this.childNodes[index])._capturePersistedStateTree();
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
_restorePersistedStateTree(): void {
|
|
1392
|
+
for (let index = 0; index < this.childNodes.length; ++index) {
|
|
1393
|
+
unchecked(this.childNodes[index])._restorePersistedStateTree();
|
|
1394
|
+
}
|
|
1395
|
+
this.restorePersistedState();
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
private indexOfChild(target: Node): i32 {
|
|
1399
|
+
for (let index = 0; index < this.childNodes.length; ++index) {
|
|
1400
|
+
if (unchecked(this.childNodes[index]) === target) {
|
|
1401
|
+
return index;
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
return -1;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
private ensureDragGesture(): DragGesture {
|
|
1408
|
+
let gesture = this.dragGestureValue;
|
|
1409
|
+
if (gesture !== null) {
|
|
1410
|
+
return gesture;
|
|
1411
|
+
}
|
|
1412
|
+
gesture = new DragGesture(this).threshold(4.0);
|
|
1413
|
+
gesture.started.bind(this, (owner: Node, event: DragStartedEvent): void => {
|
|
1414
|
+
owner.handleDragGestureStarted(event);
|
|
1415
|
+
});
|
|
1416
|
+
gesture.completed.bind(this, (owner: Node, event: DragCompletedEvent): void => {
|
|
1417
|
+
owner.handleDragGestureCompleted(event);
|
|
1418
|
+
});
|
|
1419
|
+
this.dragGestureValue = gesture;
|
|
1420
|
+
return gesture;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
private handleDragGestureStarted(_event: DragStartedEvent): void {
|
|
1424
|
+
if (!EventRouter.beginDragSession(this)) {
|
|
1425
|
+
const gesture = this.dragGestureValue;
|
|
1426
|
+
if (gesture !== null) {
|
|
1427
|
+
gesture.cancel();
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
private handleDragGestureCompleted(event: DragCompletedEvent): void {
|
|
1433
|
+
this.dragClickPending = false;
|
|
1434
|
+
if (event.cancelled) {
|
|
1435
|
+
EventRouter.cancelDragSessionForSource(this);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
private fireClick(): void {
|
|
1440
|
+
const callback = this.clickCallback;
|
|
1441
|
+
if (callback !== null) {
|
|
1442
|
+
callback();
|
|
1443
|
+
return;
|
|
1444
|
+
}
|
|
1445
|
+
const binding = this.clickBinding;
|
|
1446
|
+
if (binding !== null) {
|
|
1447
|
+
binding.invoke();
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
private cancelDragState(): void {
|
|
1452
|
+
this.dragClickPending = false;
|
|
1453
|
+
const gesture = this.dragGestureValue;
|
|
1454
|
+
if (gesture !== null) {
|
|
1455
|
+
gesture.cancel();
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
_handlePointerEvent(eventType: PointerEventType, _x: f32, _y: f32, _modifiers: u32 = 0): void {
|
|
1460
|
+
if (!this.isEnabled || !this.isVisible) {
|
|
1461
|
+
return;
|
|
1462
|
+
}
|
|
1463
|
+
if (eventType == PointerEventType.Down) {
|
|
1464
|
+
ToolTipManager.handlePointerDown(this);
|
|
1465
|
+
const dragGesture = this._hasDragSource() ? this.dragGestureValue : null;
|
|
1466
|
+
if (dragGesture !== null) {
|
|
1467
|
+
dragGesture.handlePointerDown(_x, _y, _modifiers);
|
|
1468
|
+
this.dragClickPending = this.clickCallback !== null || this.clickBinding !== null;
|
|
1469
|
+
} else {
|
|
1470
|
+
this.dragClickPending = false;
|
|
1471
|
+
}
|
|
1472
|
+
const pointerDown = this.pointerDownCallback;
|
|
1473
|
+
if (pointerDown !== null) {
|
|
1474
|
+
pointerDown(_x, _y);
|
|
1475
|
+
}
|
|
1476
|
+
if (dragGesture === null) {
|
|
1477
|
+
this.fireClick();
|
|
1478
|
+
}
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
if (eventType == PointerEventType.Move) {
|
|
1482
|
+
ToolTipManager.handlePointerMove(this, _x, _y);
|
|
1483
|
+
const dragGesture = this.dragGestureValue;
|
|
1484
|
+
if (dragGesture !== null && (this._hasDragSource() || dragGesture.isDragging)) {
|
|
1485
|
+
dragGesture.handlePointerMove(_x, _y, _modifiers);
|
|
1486
|
+
}
|
|
1487
|
+
const callback = this.pointerMoveCallback;
|
|
1488
|
+
if (callback !== null) {
|
|
1489
|
+
callback(_x, _y);
|
|
1490
|
+
}
|
|
1491
|
+
return;
|
|
1492
|
+
}
|
|
1493
|
+
if (eventType == PointerEventType.Up) {
|
|
1494
|
+
const dragGesture = this.dragGestureValue;
|
|
1495
|
+
const dragGestureActive = dragGesture !== null && (this._hasDragSource() || dragGesture.isDragging);
|
|
1496
|
+
const canFirePendingClick = this.dragClickPending && (!dragGestureActive || !changetype<DragGesture>(dragGesture).isDragging);
|
|
1497
|
+
if (dragGestureActive) {
|
|
1498
|
+
changetype<DragGesture>(dragGesture).handlePointerUp(_x, _y, _modifiers);
|
|
1499
|
+
}
|
|
1500
|
+
const callback = this.pointerUpCallback;
|
|
1501
|
+
if (callback !== null) {
|
|
1502
|
+
callback(_x, _y);
|
|
1503
|
+
}
|
|
1504
|
+
if (canFirePendingClick) {
|
|
1505
|
+
this.fireClick();
|
|
1506
|
+
}
|
|
1507
|
+
this.dragClickPending = false;
|
|
1508
|
+
return;
|
|
1509
|
+
}
|
|
1510
|
+
if (eventType == PointerEventType.Enter) {
|
|
1511
|
+
const callback = this.pointerEnterCallback;
|
|
1512
|
+
if (callback !== null) {
|
|
1513
|
+
callback();
|
|
1514
|
+
}
|
|
1515
|
+
ToolTipManager.handlePointerEnter(this, this.toolTipValue, _x, _y);
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
if (eventType == PointerEventType.Leave) {
|
|
1519
|
+
const callback = this.pointerLeaveCallback;
|
|
1520
|
+
if (callback !== null) {
|
|
1521
|
+
callback();
|
|
1522
|
+
}
|
|
1523
|
+
this.dragClickPending = false;
|
|
1524
|
+
ToolTipManager.handlePointerLeave(this);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
_handleFocusChanged(focused: bool): void {
|
|
1529
|
+
const callback = this.focusChangedCb;
|
|
1530
|
+
if (callback !== null) {
|
|
1531
|
+
callback(focused);
|
|
1532
|
+
}
|
|
1533
|
+
const binding = this.focusChangedBinding;
|
|
1534
|
+
if (binding !== null) {
|
|
1535
|
+
binding.invoke(focused);
|
|
1536
|
+
}
|
|
1537
|
+
ToolTipManager.handleFocusChanged(this, this.toolTipValue, focused);
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
_handleKeyEvent(eventType: KeyEventType, key: string, modifiers: u32): bool {
|
|
1541
|
+
if (!this.isEnabled || !this.isVisible) {
|
|
1542
|
+
return false;
|
|
1543
|
+
}
|
|
1544
|
+
if (eventType == KeyEventType.Down) {
|
|
1545
|
+
const callback = this.keyDownCb;
|
|
1546
|
+
if (callback !== null) {
|
|
1547
|
+
callback(key, modifiers);
|
|
1548
|
+
return true;
|
|
1549
|
+
}
|
|
1550
|
+
const binding = this.keyDownBinding;
|
|
1551
|
+
if (binding !== null) {
|
|
1552
|
+
binding.invoke(key, modifiers);
|
|
1553
|
+
return true;
|
|
1554
|
+
}
|
|
1555
|
+
return false;
|
|
1556
|
+
}
|
|
1557
|
+
if (eventType == KeyEventType.Up) {
|
|
1558
|
+
const callback = this.keyUpCb;
|
|
1559
|
+
if (callback !== null) {
|
|
1560
|
+
callback(key, modifiers);
|
|
1561
|
+
return true;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return false;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
_handleScroll(
|
|
1568
|
+
_offsetX: f32,
|
|
1569
|
+
_offsetY: f32,
|
|
1570
|
+
_contentWidth: f32,
|
|
1571
|
+
_contentHeight: f32,
|
|
1572
|
+
_viewportWidth: f32,
|
|
1573
|
+
_viewportHeight: f32,
|
|
1574
|
+
): void {}
|
|
1575
|
+
|
|
1576
|
+
_handleTextChanged(_text: string): void {}
|
|
1577
|
+
|
|
1578
|
+
_handleTextReplaced(_start: u32, _end: u32, _text: string): void {}
|
|
1579
|
+
|
|
1580
|
+
_handleSelectionChanged(_start: u32, _end: u32): void {}
|
|
1581
|
+
|
|
1582
|
+
_handleCrossSelectionChanged(_text: string): void {}
|
|
1583
|
+
|
|
1584
|
+
protected requireInteractive(): void {
|
|
1585
|
+
if (!this.hasPointerCallbacks) {
|
|
1586
|
+
this.hasPointerCallbacks = true;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
_bindScrollProxyTarget(handle: u64): void {
|
|
1591
|
+
this.scrollProxyTargetHandle = handle;
|
|
1592
|
+
if (this.hasBuiltHandle()) {
|
|
1593
|
+
ui.setScrollProxyTarget(this.handle, handle);
|
|
1594
|
+
this.notifyRetainedMutation();
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
_notifyRetainedLayoutMutation(): void {
|
|
1599
|
+
this.notifyRetainedLayoutMutation();
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
protected reflectSemanticDisabledFromEnabled(): void {
|
|
1603
|
+
this.trackSemanticDisabledFromEnabled = true;
|
|
1604
|
+
this.hasSemanticDisabled = true;
|
|
1605
|
+
this.semanticDisabledValue = !this.isEnabled;
|
|
1606
|
+
if (this.hasBuiltHandle()) {
|
|
1607
|
+
ui.setSemanticDisabled(this.handle, true, this.semanticDisabledValue);
|
|
1608
|
+
this.notifyRetainedMutation();
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
|
|
1612
|
+
protected _onEffectiveEnabledChanged(_isEnabled: bool): void {}
|
|
1613
|
+
|
|
1614
|
+
protected _onEffectiveVisibilityChanged(_visibility: Visibility): void {}
|
|
1615
|
+
|
|
1616
|
+
private _setInheritedEnabled(flag: bool): void {
|
|
1617
|
+
if (this.inheritedEnabled == flag) {
|
|
1618
|
+
return;
|
|
1619
|
+
}
|
|
1620
|
+
this.inheritedEnabled = flag;
|
|
1621
|
+
this.applyEnabledChanged();
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
private _setInheritedVisibility(value: Visibility): void {
|
|
1625
|
+
if (this.inheritedVisibility == value) {
|
|
1626
|
+
return;
|
|
1627
|
+
}
|
|
1628
|
+
this.inheritedVisibility = value;
|
|
1629
|
+
this.applyVisibilityChanged();
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
private effectiveVisibility(): Visibility {
|
|
1633
|
+
if (this.inheritedVisibility != Visibility.Normal) {
|
|
1634
|
+
return this.inheritedVisibility;
|
|
1635
|
+
}
|
|
1636
|
+
return this.ownVisibility;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
private applyEnabledChanged(): void {
|
|
1640
|
+
const effective = this.isEnabled;
|
|
1641
|
+
if (this.lastEffectiveEnabled == effective) {
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
this.lastEffectiveEnabled = effective;
|
|
1645
|
+
|
|
1646
|
+
let updatedHandle = false;
|
|
1647
|
+
if (this.hasBuiltHandle()) {
|
|
1648
|
+
const interactiveEffective = effective && this.isVisible;
|
|
1649
|
+
if (this.hasPointerCallbacks) {
|
|
1650
|
+
ui.setInteractive(this.handle, interactiveEffective);
|
|
1651
|
+
updatedHandle = true;
|
|
1652
|
+
}
|
|
1653
|
+
if (this.focusableFlag) {
|
|
1654
|
+
ui.setFocusable(this.handle, interactiveEffective && this.focusableFlag, this.focusableTabIndex);
|
|
1655
|
+
updatedHandle = true;
|
|
1656
|
+
}
|
|
1657
|
+
if (this.trackSemanticDisabledFromEnabled) {
|
|
1658
|
+
this.semanticDisabledValue = !effective;
|
|
1659
|
+
ui.setSemanticDisabled(this.handle, true, this.semanticDisabledValue);
|
|
1660
|
+
updatedHandle = true;
|
|
1661
|
+
}
|
|
1662
|
+
if (updatedHandle) {
|
|
1663
|
+
this.notifyRetainedMutation();
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
this._onEffectiveEnabledChanged(effective);
|
|
1668
|
+
if (!effective) {
|
|
1669
|
+
this.cancelDragState();
|
|
1670
|
+
}
|
|
1671
|
+
for (let i = 0; i < this.childNodes.length; ++i) {
|
|
1672
|
+
unchecked(this.childNodes[i])._setInheritedEnabled(effective);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
private applyVisibilityChanged(): void {
|
|
1677
|
+
const effective = this.effectiveVisibility();
|
|
1678
|
+
if (this.lastEffectiveVisibility == effective) {
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
this.lastEffectiveVisibility = effective;
|
|
1682
|
+
|
|
1683
|
+
let updatedHandle = false;
|
|
1684
|
+
if (this.hasBuiltHandle()) {
|
|
1685
|
+
ui.setVisibility(this.handle, <u32>effective);
|
|
1686
|
+
updatedHandle = true;
|
|
1687
|
+
const interactiveEffective = this.isEnabled && this.isVisible;
|
|
1688
|
+
if (this.hasPointerCallbacks) {
|
|
1689
|
+
ui.setInteractive(this.handle, interactiveEffective);
|
|
1690
|
+
}
|
|
1691
|
+
if (this.focusableFlag) {
|
|
1692
|
+
ui.setFocusable(this.handle, interactiveEffective && this.focusableFlag, this.focusableTabIndex);
|
|
1693
|
+
}
|
|
1694
|
+
if (updatedHandle) {
|
|
1695
|
+
this.notifyRetainedMutation();
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
this._onEffectiveVisibilityChanged(effective);
|
|
1700
|
+
if (effective != Visibility.Normal) {
|
|
1701
|
+
this.cancelDragState();
|
|
1702
|
+
}
|
|
1703
|
+
for (let i = 0; i < this.childNodes.length; ++i) {
|
|
1704
|
+
unchecked(this.childNodes[i])._setInheritedVisibility(effective);
|
|
1705
|
+
}
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
}
|