@effindomv2/fui-as 0.1.50 → 0.1.51
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/package.json +1 -1
- package/scripts/build.sh +6 -1
- package/src/controls/Button.ts +3 -61
- package/src/controls/Checkbox.ts +16 -1
- package/src/controls/RadioButton.ts +16 -1
- package/src/controls/Switch.ts +16 -1
- package/src/controls/internal/PressableLabeledControl.ts +36 -1
- package/src/core/Node.ts +80 -7
- package/src/nodes/FlexBox.ts +10 -0
- package/src/nodes/Grid.ts +10 -0
- package/src/nodes/ScrollView.ts +10 -0
- package/src/nodes/TextCore.ts +10 -0
package/package.json
CHANGED
package/scripts/build.sh
CHANGED
|
@@ -217,6 +217,7 @@ resolve_runtime_dist_dir() {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
RUNTIME_DIST_DIR="$(resolve_runtime_dist_dir)"
|
|
220
|
+
RUNTIME_SET_HASH="$(node -e 'const fs=require("fs"); const value=JSON.parse(fs.readFileSync(process.argv[1], "utf8")).runtime_set_hash; if (typeof value !== "string" || value.length === 0) process.exit(1); process.stdout.write(value);' "${RUNTIME_DIST_DIR}/effindom.v2.manifest.json")"
|
|
220
221
|
|
|
221
222
|
write_runtime_config() {
|
|
222
223
|
local destination="$1"
|
|
@@ -224,7 +225,11 @@ write_runtime_config() {
|
|
|
224
225
|
|
|
225
226
|
cat > "${destination}/${RUNTIME_CONFIG_FILE}" <<EOF
|
|
226
227
|
window.__effindomRuntime = Object.assign({}, window.__effindomRuntime, {
|
|
227
|
-
|
|
228
|
+
manifestUrls: [
|
|
229
|
+
'https://runtimes.effindom.dev/v2/manifests/${RUNTIME_SET_HASH}.json',
|
|
230
|
+
new URL('${manifest_url}', document.currentScript && document.currentScript.src ? document.currentScript.src : document.baseURI).toString(),
|
|
231
|
+
],
|
|
232
|
+
expectedRuntimeSetHash: '${RUNTIME_SET_HASH}',
|
|
228
233
|
buildMode: 'debug',
|
|
229
234
|
});
|
|
230
235
|
EOF
|
package/src/controls/Button.ts
CHANGED
|
@@ -74,10 +74,6 @@ export class Button extends FlexBox {
|
|
|
74
74
|
private readonly disposables: Array<Disposable> = new Array<Disposable>();
|
|
75
75
|
private action: ((event: ClickEventArgs) => void) | null = null;
|
|
76
76
|
private actionBinding: Callback1<ClickEventArgs> | null = null;
|
|
77
|
-
private doubleAction: ((event: ClickEventArgs) => void) | null = null;
|
|
78
|
-
private doubleActionBinding: Callback1<ClickEventArgs> | null = null;
|
|
79
|
-
private tripleAction: ((event: ClickEventArgs) => void) | null = null;
|
|
80
|
-
private tripleActionBinding: Callback1<ClickEventArgs> | null = null;
|
|
81
77
|
private hoverChanged: ((event: HoverChangedEventArgs) => void) | null = null;
|
|
82
78
|
private hoverChangedBinding: Callback1<HoverChangedEventArgs> | null = null;
|
|
83
79
|
private disposed: bool = false;
|
|
@@ -171,40 +167,6 @@ export class Button extends FlexBox {
|
|
|
171
167
|
return this;
|
|
172
168
|
}
|
|
173
169
|
|
|
174
|
-
onDoubleClick(cb: (event: ClickEventArgs) => void): this {
|
|
175
|
-
this.doubleAction = cb;
|
|
176
|
-
this.doubleActionBinding = null;
|
|
177
|
-
return this;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
bindDoubleClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
181
|
-
this.doubleAction = null;
|
|
182
|
-
this.doubleActionBinding = bind1<Owner, ClickEventArgs>(owner, handler);
|
|
183
|
-
return this;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
onDoubleClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
187
|
-
this.bindDoubleClick(owner, handler);
|
|
188
|
-
return this;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
onTripleClick(cb: (event: ClickEventArgs) => void): this {
|
|
192
|
-
this.tripleAction = cb;
|
|
193
|
-
this.tripleActionBinding = null;
|
|
194
|
-
return this;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
bindTripleClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
198
|
-
this.tripleAction = null;
|
|
199
|
-
this.tripleActionBinding = bind1<Owner, ClickEventArgs>(owner, handler);
|
|
200
|
-
return this;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
onTripleClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
204
|
-
this.bindTripleClick(owner, handler);
|
|
205
|
-
return this;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
170
|
onHoverChanged(cb: (event: HoverChangedEventArgs) => void): this {
|
|
209
171
|
this.hoverChanged = cb;
|
|
210
172
|
this.hoverChangedBinding = null;
|
|
@@ -369,7 +331,7 @@ export class Button extends FlexBox {
|
|
|
369
331
|
this.pressed.value = true;
|
|
370
332
|
}
|
|
371
333
|
|
|
372
|
-
endPress(
|
|
334
|
+
endPress(fireAction: bool = true): void {
|
|
373
335
|
const wasPressed = this.pressed.value;
|
|
374
336
|
this.pressed.value = false;
|
|
375
337
|
if (!wasPressed || !fireAction) {
|
|
@@ -383,26 +345,6 @@ export class Button extends FlexBox {
|
|
|
383
345
|
if (binding !== null) {
|
|
384
346
|
binding.invoke(ClickEventArgs.Empty);
|
|
385
347
|
}
|
|
386
|
-
if (clickCount == 2) {
|
|
387
|
-
const doubleCallback = this.doubleAction;
|
|
388
|
-
if (doubleCallback !== null) {
|
|
389
|
-
doubleCallback(ClickEventArgs.Empty);
|
|
390
|
-
}
|
|
391
|
-
const doubleBinding = this.doubleActionBinding;
|
|
392
|
-
if (doubleBinding !== null) {
|
|
393
|
-
doubleBinding.invoke(ClickEventArgs.Empty);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
if (clickCount == 3) {
|
|
397
|
-
const tripleCallback = this.tripleAction;
|
|
398
|
-
if (tripleCallback !== null) {
|
|
399
|
-
tripleCallback(ClickEventArgs.Empty);
|
|
400
|
-
}
|
|
401
|
-
const tripleBinding = this.tripleActionBinding;
|
|
402
|
-
if (tripleBinding !== null) {
|
|
403
|
-
tripleBinding.invoke(ClickEventArgs.Empty);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
348
|
}
|
|
407
349
|
|
|
408
350
|
cancelPress(): void {
|
|
@@ -459,7 +401,7 @@ export class Button extends FlexBox {
|
|
|
459
401
|
return;
|
|
460
402
|
}
|
|
461
403
|
if (eventType == PointerEventType.Up && this.pressed.value) {
|
|
462
|
-
this.endPress(
|
|
404
|
+
this.endPress(true);
|
|
463
405
|
}
|
|
464
406
|
}
|
|
465
407
|
|
|
@@ -497,7 +439,7 @@ export class Button extends FlexBox {
|
|
|
497
439
|
}
|
|
498
440
|
if (eventType == KeyEventType.Up && this.keyboardArmedKey !== null && changetype<string>(this.keyboardArmedKey) == key) {
|
|
499
441
|
this.keyboardArmedKey = null;
|
|
500
|
-
this.endPress(
|
|
442
|
+
this.endPress(true);
|
|
501
443
|
return true;
|
|
502
444
|
}
|
|
503
445
|
return callbackHandled;
|
package/src/controls/Checkbox.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Callback1, Handler1 } from "../core/BoundCallback";
|
|
2
2
|
import { SemanticCheckedState, SemanticRole } from "../core/ffi";
|
|
3
|
-
import { CheckboxChangedEventArgs } from "../core/Node";
|
|
3
|
+
import { CheckboxChangedEventArgs, ClickEventArgs } from "../core/Node";
|
|
4
4
|
import { PersistedInt32Codec, PersistedValueState } from "../core/PersistedState";
|
|
5
5
|
import { bind1 } from "../core/bind";
|
|
6
6
|
import { LabeledControlSizing } from "./ControlSizing";
|
|
@@ -124,6 +124,21 @@ export class Checkbox extends PressableLabeledControl {
|
|
|
124
124
|
return this;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
onClick(callback: (event: ClickEventArgs) => void): this {
|
|
128
|
+
super.onClick(callback);
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
bindClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
133
|
+
super.bindClick(owner, handler);
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
138
|
+
super.onClickWith(owner, handler);
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
|
|
127
142
|
bindChanged<Owner>(owner: Owner, handler: Handler1<Owner, CheckboxChangedEventArgs>): this {
|
|
128
143
|
this.changedCallback = null;
|
|
129
144
|
this.changedBinding = bind1<Owner, CheckboxChangedEventArgs>(owner, handler);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Callback1, Handler1 } from "../core/BoundCallback";
|
|
2
2
|
import { KeyEventType, SemanticCheckedState, SemanticRole } from "../core/ffi";
|
|
3
|
-
import { RadioButtonChangedEventArgs } from "../core/Node";
|
|
3
|
+
import { ClickEventArgs, RadioButtonChangedEventArgs } from "../core/Node";
|
|
4
4
|
import { activeTheme } from "../core/Theme";
|
|
5
5
|
import { bind1 } from "../core/bind";
|
|
6
6
|
import { LabeledControlSizing } from "./ControlSizing";
|
|
@@ -87,6 +87,21 @@ export class RadioButton extends PressableLabeledControl {
|
|
|
87
87
|
return this;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
onClick(callback: (event: ClickEventArgs) => void): this {
|
|
91
|
+
super.onClick(callback);
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
bindClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
96
|
+
super.bindClick(owner, handler);
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
onClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
101
|
+
super.onClickWith(owner, handler);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
90
105
|
bindChanged<Owner>(owner: Owner, handler: Handler1<Owner, RadioButtonChangedEventArgs>): this {
|
|
91
106
|
this.changedCallback = null;
|
|
92
107
|
this.changedBinding = bind1<Owner, RadioButtonChangedEventArgs>(owner, handler);
|
package/src/controls/Switch.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Callback1, Handler1 } from "../core/BoundCallback";
|
|
2
2
|
import { SemanticCheckedState, SemanticRole } from "../core/ffi";
|
|
3
|
-
import { SwitchChangedEventArgs } from "../core/Node";
|
|
3
|
+
import { ClickEventArgs, SwitchChangedEventArgs } from "../core/Node";
|
|
4
4
|
import { PersistedBoolCodec, PersistedValueState } from "../core/PersistedState";
|
|
5
5
|
import { bind1 } from "../core/bind";
|
|
6
6
|
import { activeTheme } from "../core/Theme";
|
|
@@ -92,6 +92,21 @@ export class Switch extends PressableLabeledControl {
|
|
|
92
92
|
return this;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
onClick(callback: (event: ClickEventArgs) => void): this {
|
|
96
|
+
super.onClick(callback);
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
bindClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
101
|
+
super.bindClick(owner, handler);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
onClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
106
|
+
super.onClickWith(owner, handler);
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
|
|
95
110
|
bindChanged<Owner>(owner: Owner, handler: Handler1<Owner, SwitchChangedEventArgs>): this {
|
|
96
111
|
this.changedCallback = null;
|
|
97
112
|
this.changedBinding = bind1<Owner, SwitchChangedEventArgs>(owner, handler);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { rgba } from "../../color";
|
|
2
2
|
import { HandlerAction } from "../../core/Action";
|
|
3
|
+
import { Callback1, Handler1 } from "../../core/BoundCallback";
|
|
4
|
+
import { bind1 } from "../../core/bind";
|
|
3
5
|
import { Disposable, disposeAll } from "../../core/Disposable";
|
|
4
6
|
import { FocusAdornerManager } from "../../core/FocusAdornerManager";
|
|
5
7
|
import { keyboardFocusVisible } from "../../core/FocusVisibility";
|
|
6
|
-
import { Node } from "../../core/Node";
|
|
8
|
+
import { ClickEventArgs, Node } from "../../core/Node";
|
|
7
9
|
import {
|
|
8
10
|
AlignItems,
|
|
9
11
|
CursorStyle,
|
|
@@ -37,6 +39,8 @@ export class PressableLabeledControl extends FlexBox {
|
|
|
37
39
|
protected focusedState: bool = false;
|
|
38
40
|
private keyPressedState: bool = false;
|
|
39
41
|
private pointerPressedState: bool = false;
|
|
42
|
+
private clickCallback: ((event: ClickEventArgs) => void) | null = null;
|
|
43
|
+
private clickBinding: Callback1<ClickEventArgs> | null = null;
|
|
40
44
|
|
|
41
45
|
constructor(role: SemanticRole, label: string, indicatorPresenterRoot: FlexBox) {
|
|
42
46
|
super();
|
|
@@ -106,6 +110,7 @@ export class PressableLabeledControl extends FlexBox {
|
|
|
106
110
|
this.pressedState = false;
|
|
107
111
|
this.syncVisualState();
|
|
108
112
|
this.handleActivated();
|
|
113
|
+
this.fireSemanticClick();
|
|
109
114
|
}
|
|
110
115
|
}
|
|
111
116
|
|
|
@@ -125,6 +130,7 @@ export class PressableLabeledControl extends FlexBox {
|
|
|
125
130
|
this.pressedState = false;
|
|
126
131
|
this.syncVisualState();
|
|
127
132
|
this.handleActivated();
|
|
133
|
+
this.fireSemanticClick();
|
|
128
134
|
return true;
|
|
129
135
|
}
|
|
130
136
|
return callbackHandled;
|
|
@@ -157,6 +163,23 @@ export class PressableLabeledControl extends FlexBox {
|
|
|
157
163
|
|
|
158
164
|
protected handleActivated(): void {}
|
|
159
165
|
|
|
166
|
+
onClick(callback: (event: ClickEventArgs) => void): this {
|
|
167
|
+
this.clickCallback = callback;
|
|
168
|
+
this.clickBinding = null;
|
|
169
|
+
return this;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
bindClick<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
173
|
+
this.clickCallback = null;
|
|
174
|
+
this.clickBinding = bind1<Owner, ClickEventArgs>(owner, handler);
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
onClickWith<Owner>(owner: Owner, handler: Handler1<Owner, ClickEventArgs>): this {
|
|
179
|
+
this.bindClick(owner, handler);
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
|
|
160
183
|
protected syncVisualState(): void {}
|
|
161
184
|
|
|
162
185
|
protected replaceIndicatorRoot(nextRoot: FlexBox): void {
|
|
@@ -245,4 +268,16 @@ export class PressableLabeledControl extends FlexBox {
|
|
|
245
268
|
}
|
|
246
269
|
FocusAdornerManager.hideOwner(this);
|
|
247
270
|
}
|
|
271
|
+
|
|
272
|
+
private fireSemanticClick(): void {
|
|
273
|
+
const callback = this.clickCallback;
|
|
274
|
+
if (callback !== null) {
|
|
275
|
+
callback(ClickEventArgs.Empty);
|
|
276
|
+
return;
|
|
277
|
+
}
|
|
278
|
+
const binding = this.clickBinding;
|
|
279
|
+
if (binding !== null) {
|
|
280
|
+
binding.invoke(ClickEventArgs.Empty);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
248
283
|
}
|
package/src/core/Node.ts
CHANGED
|
@@ -684,6 +684,10 @@ export abstract class Node implements DragGestureHost, Disposable {
|
|
|
684
684
|
private portalFlag: bool = false;
|
|
685
685
|
private pointerClickCallback: ((event: PointerClickEventArgs) => void) | null = null;
|
|
686
686
|
private pointerClickBinding: Callback1<PointerClickEventArgs> | null = null;
|
|
687
|
+
private pointerDoubleClickCallback: ((event: PointerClickEventArgs) => void) | null = null;
|
|
688
|
+
private pointerDoubleClickBinding: Callback1<PointerClickEventArgs> | null = null;
|
|
689
|
+
private pointerTripleClickCallback: ((event: PointerClickEventArgs) => void) | null = null;
|
|
690
|
+
private pointerTripleClickBinding: Callback1<PointerClickEventArgs> | null = null;
|
|
687
691
|
private pointerDownEventCallback: ((event: PointerEventArgs) => void) | null = null;
|
|
688
692
|
private pointerDownEventBinding: Callback1<PointerEventArgs> | null = null;
|
|
689
693
|
private pointerMoveEventCallback: ((event: PointerEventArgs) => void) | null = null;
|
|
@@ -1104,6 +1108,44 @@ export abstract class Node implements DragGestureHost, Disposable {
|
|
|
1104
1108
|
return this;
|
|
1105
1109
|
}
|
|
1106
1110
|
|
|
1111
|
+
onPointerDoubleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
1112
|
+
this.pointerDoubleClickCallback = cb;
|
|
1113
|
+
this.pointerDoubleClickBinding = null;
|
|
1114
|
+
this.requireInteractive();
|
|
1115
|
+
return this;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
bindPointerDoubleClick<Owner>(owner: Owner, handler: Handler1<Owner, PointerClickEventArgs>): this {
|
|
1119
|
+
this.pointerDoubleClickCallback = null;
|
|
1120
|
+
this.pointerDoubleClickBinding = bind1<Owner, PointerClickEventArgs>(owner, handler);
|
|
1121
|
+
this.requireInteractive();
|
|
1122
|
+
return this;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
onPointerDoubleClickWith<Owner>(owner: Owner, handler: Handler1<Owner, PointerClickEventArgs>): this {
|
|
1126
|
+
this.bindPointerDoubleClick(owner, handler);
|
|
1127
|
+
return this;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
onPointerTripleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
1131
|
+
this.pointerTripleClickCallback = cb;
|
|
1132
|
+
this.pointerTripleClickBinding = null;
|
|
1133
|
+
this.requireInteractive();
|
|
1134
|
+
return this;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
bindPointerTripleClick<Owner>(owner: Owner, handler: Handler1<Owner, PointerClickEventArgs>): this {
|
|
1138
|
+
this.pointerTripleClickCallback = null;
|
|
1139
|
+
this.pointerTripleClickBinding = bind1<Owner, PointerClickEventArgs>(owner, handler);
|
|
1140
|
+
this.requireInteractive();
|
|
1141
|
+
return this;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
onPointerTripleClickWith<Owner>(owner: Owner, handler: Handler1<Owner, PointerClickEventArgs>): this {
|
|
1145
|
+
this.bindPointerTripleClick(owner, handler);
|
|
1146
|
+
return this;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1107
1149
|
onPointerDown(cb: (event: PointerEventArgs) => void): this {
|
|
1108
1150
|
this.pointerDownEventCallback = cb;
|
|
1109
1151
|
this.pointerDownEventBinding = null;
|
|
@@ -2166,12 +2208,43 @@ export abstract class Node implements DragGestureHost, Disposable {
|
|
|
2166
2208
|
const callback = this.pointerClickCallback;
|
|
2167
2209
|
if (callback !== null) {
|
|
2168
2210
|
callback(clickEvent);
|
|
2169
|
-
|
|
2211
|
+
} else {
|
|
2212
|
+
const binding = this.pointerClickBinding;
|
|
2213
|
+
if (binding !== null) {
|
|
2214
|
+
binding.invoke(clickEvent);
|
|
2215
|
+
}
|
|
2170
2216
|
}
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2217
|
+
if (clickEvent.clickCount == 2) {
|
|
2218
|
+
const doubleCallback = this.pointerDoubleClickCallback;
|
|
2219
|
+
if (doubleCallback !== null) {
|
|
2220
|
+
doubleCallback(clickEvent);
|
|
2221
|
+
} else {
|
|
2222
|
+
const doubleBinding = this.pointerDoubleClickBinding;
|
|
2223
|
+
if (doubleBinding !== null) {
|
|
2224
|
+
doubleBinding.invoke(clickEvent);
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
} else if (clickEvent.clickCount == 3) {
|
|
2228
|
+
const tripleCallback = this.pointerTripleClickCallback;
|
|
2229
|
+
if (tripleCallback !== null) {
|
|
2230
|
+
tripleCallback(clickEvent);
|
|
2231
|
+
} else {
|
|
2232
|
+
const tripleBinding = this.pointerTripleClickBinding;
|
|
2233
|
+
if (tripleBinding !== null) {
|
|
2234
|
+
tripleBinding.invoke(clickEvent);
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2174
2237
|
}
|
|
2238
|
+
event.handled = clickEvent.handled;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
private hasPointerClickHandler(): bool {
|
|
2242
|
+
return this.pointerClickCallback !== null
|
|
2243
|
+
|| this.pointerClickBinding !== null
|
|
2244
|
+
|| this.pointerDoubleClickCallback !== null
|
|
2245
|
+
|| this.pointerDoubleClickBinding !== null
|
|
2246
|
+
|| this.pointerTripleClickCallback !== null
|
|
2247
|
+
|| this.pointerTripleClickBinding !== null;
|
|
2175
2248
|
}
|
|
2176
2249
|
|
|
2177
2250
|
private cancelDragState(): void {
|
|
@@ -2212,7 +2285,7 @@ export abstract class Node implements DragGestureHost, Disposable {
|
|
|
2212
2285
|
if (!event.handled) {
|
|
2213
2286
|
if (event.eventType == PointerEventType.Down) {
|
|
2214
2287
|
const isPrimaryButton = isPrimaryActivationPointer(event);
|
|
2215
|
-
this.clickPending = isPrimaryButton &&
|
|
2288
|
+
this.clickPending = isPrimaryButton && this.hasPointerClickHandler();
|
|
2216
2289
|
this.clickPendingCount = event.clickCount;
|
|
2217
2290
|
} else if (event.eventType == PointerEventType.Up) {
|
|
2218
2291
|
if (this.clickPending) {
|
|
@@ -2259,14 +2332,14 @@ export abstract class Node implements DragGestureHost, Disposable {
|
|
|
2259
2332
|
if (dragGesture !== null && isPrimaryButton) {
|
|
2260
2333
|
const waitForLongPress = event.pointerType == PointerType.Touch || event.pointerType == PointerType.Pen;
|
|
2261
2334
|
dragGesture.handlePointerDown(nodeX, nodeY, _modifiers, waitForLongPress);
|
|
2262
|
-
this.dragClickPending = this.
|
|
2335
|
+
this.dragClickPending = this.hasPointerClickHandler();
|
|
2263
2336
|
this.dragClickPendingCount = event.clickCount;
|
|
2264
2337
|
this.clickPending = false;
|
|
2265
2338
|
this.clickPendingCount = 0;
|
|
2266
2339
|
} else {
|
|
2267
2340
|
this.dragClickPending = false;
|
|
2268
2341
|
this.dragClickPendingCount = 0;
|
|
2269
|
-
this.clickPending = isPrimaryButton &&
|
|
2342
|
+
this.clickPending = isPrimaryButton && this.hasPointerClickHandler();
|
|
2270
2343
|
this.clickPendingCount = event.clickCount;
|
|
2271
2344
|
}
|
|
2272
2345
|
return;
|
package/src/nodes/FlexBox.ts
CHANGED
|
@@ -619,6 +619,16 @@ export class FlexBox extends Node {
|
|
|
619
619
|
return this;
|
|
620
620
|
}
|
|
621
621
|
|
|
622
|
+
onPointerDoubleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
623
|
+
super.onPointerDoubleClick(cb);
|
|
624
|
+
return this;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
onPointerTripleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
628
|
+
super.onPointerTripleClick(cb);
|
|
629
|
+
return this;
|
|
630
|
+
}
|
|
631
|
+
|
|
622
632
|
onPointerEnter(cb: (event: PointerEventArgs) => void): this {
|
|
623
633
|
super.onPointerEnter(cb);
|
|
624
634
|
return this;
|
package/src/nodes/Grid.ts
CHANGED
|
@@ -129,6 +129,16 @@ export class Grid extends FlexBox {
|
|
|
129
129
|
return this;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
onPointerDoubleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
133
|
+
super.onPointerDoubleClick(cb);
|
|
134
|
+
return this;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
onPointerTripleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
138
|
+
super.onPointerTripleClick(cb);
|
|
139
|
+
return this;
|
|
140
|
+
}
|
|
141
|
+
|
|
132
142
|
onPointerEnter(cb: (event: PointerEventArgs) => void): this {
|
|
133
143
|
super.onPointerEnter(cb);
|
|
134
144
|
return this;
|
package/src/nodes/ScrollView.ts
CHANGED
|
@@ -362,6 +362,16 @@ export class ScrollView extends Node {
|
|
|
362
362
|
return this;
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
+
onPointerDoubleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
366
|
+
super.onPointerDoubleClick(cb);
|
|
367
|
+
return this;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
onPointerTripleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
371
|
+
super.onPointerTripleClick(cb);
|
|
372
|
+
return this;
|
|
373
|
+
}
|
|
374
|
+
|
|
365
375
|
onPointerEnter(cb: (event: PointerEventArgs) => void): this {
|
|
366
376
|
super.onPointerEnter(cb);
|
|
367
377
|
return this;
|
package/src/nodes/TextCore.ts
CHANGED
|
@@ -618,6 +618,16 @@ export class TextCore extends Node {
|
|
|
618
618
|
return this;
|
|
619
619
|
}
|
|
620
620
|
|
|
621
|
+
onPointerDoubleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
622
|
+
super.onPointerDoubleClick(cb);
|
|
623
|
+
return this;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
onPointerTripleClick(cb: (event: PointerClickEventArgs) => void): this {
|
|
627
|
+
super.onPointerTripleClick(cb);
|
|
628
|
+
return this;
|
|
629
|
+
}
|
|
630
|
+
|
|
621
631
|
onPointerEnter(cb: (event: PointerEventArgs) => void): this {
|
|
622
632
|
super.onPointerEnter(cb);
|
|
623
633
|
return this;
|