babylonjs-gui 5.9.1 → 5.12.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/babylon.gui.d.ts +193 -36
- package/babylon.gui.js +1359 -249
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +1 -2
- package/babylon.gui.min.js.map +1 -1
- package/babylon.gui.module.d.ts +402 -73
- package/package.json +5 -5
- package/babylon.gui.min.js.LICENSE.txt +0 -14
package/babylon.gui.d.ts
CHANGED
|
@@ -1233,7 +1233,7 @@ declare module BABYLON.GUI {
|
|
|
1233
1233
|
* second dimension is computed as first dimension * fixedRatio
|
|
1234
1234
|
*/
|
|
1235
1235
|
fixedRatio: number;
|
|
1236
|
-
|
|
1236
|
+
protected _fixedRatioMasterIsWidth: boolean;
|
|
1237
1237
|
/**
|
|
1238
1238
|
* Gets or sets control width
|
|
1239
1239
|
* @see https://doc.babylonjs.com/how_to/gui#position-and-size
|
|
@@ -2123,6 +2123,11 @@ declare module BABYLON.GUI {
|
|
|
2123
2123
|
* BABYLON.Observable notified when _sourceLeft, _sourceTop, _sourceWidth and _sourceHeight are computed
|
|
2124
2124
|
*/
|
|
2125
2125
|
onSVGAttributesComputedObservable: BABYLON.Observable<Image>;
|
|
2126
|
+
/**
|
|
2127
|
+
* Gets or sets the referrer policy to apply on the img element load request.
|
|
2128
|
+
* You should set referrerPolicy before set the source of the image if you want to ensure the header will be present on the xhr loading request
|
|
2129
|
+
*/
|
|
2130
|
+
referrerPolicy: BABYLON.Nullable<ReferrerPolicy>;
|
|
2126
2131
|
/**
|
|
2127
2132
|
* Gets a boolean indicating that the content is loaded
|
|
2128
2133
|
*/
|
|
@@ -2303,39 +2308,39 @@ declare module BABYLON.GUI {
|
|
|
2303
2308
|
*/
|
|
2304
2309
|
export class InputText extends Control implements IFocusableControl {
|
|
2305
2310
|
name?: string | undefined;
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2311
|
+
protected _textWrapper: TextWrapper;
|
|
2312
|
+
protected _placeholderText: string;
|
|
2313
|
+
protected _background: string;
|
|
2314
|
+
protected _focusedBackground: string;
|
|
2315
|
+
protected _focusedColor: string;
|
|
2316
|
+
protected _placeholderColor: string;
|
|
2317
|
+
protected _thickness: number;
|
|
2318
|
+
protected _margin: ValueAndUnit;
|
|
2319
|
+
protected _autoStretchWidth: boolean;
|
|
2320
|
+
protected _maxWidth: ValueAndUnit;
|
|
2321
|
+
protected _isFocused: boolean;
|
|
2317
2322
|
/** the type of device that most recently focused the input: "mouse", "touch" or "pen" */
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2323
|
+
protected _focusedBy: string;
|
|
2324
|
+
protected _blinkTimeout: number;
|
|
2325
|
+
protected _blinkIsEven: boolean;
|
|
2321
2326
|
private _cursorOffset;
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2327
|
+
protected _scrollLeft: BABYLON.Nullable<number>;
|
|
2328
|
+
protected _textWidth: number;
|
|
2329
|
+
protected _clickedCoordinate: BABYLON.Nullable<number>;
|
|
2330
|
+
protected _deadKey: boolean;
|
|
2331
|
+
protected _addKey: boolean;
|
|
2332
|
+
protected _currentKey: string;
|
|
2333
|
+
protected _isTextHighlightOn: boolean;
|
|
2334
|
+
protected _textHighlightColor: string;
|
|
2335
|
+
protected _highligherOpacity: number;
|
|
2336
|
+
protected _highlightedText: string;
|
|
2332
2337
|
private _startHighlightIndex;
|
|
2333
2338
|
private _endHighlightIndex;
|
|
2334
2339
|
private _cursorIndex;
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2340
|
+
protected _onFocusSelectAll: boolean;
|
|
2341
|
+
protected _isPointerDown: boolean;
|
|
2342
|
+
protected _onClipboardObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.ClipboardInfo>>;
|
|
2343
|
+
protected _onPointerDblTapObserver: BABYLON.Nullable<BABYLON.Observer<BABYLON.PointerInfo>>;
|
|
2339
2344
|
/** @hidden */
|
|
2340
2345
|
_connectedVirtualKeyboard: BABYLON.Nullable<VirtualKeyboard>;
|
|
2341
2346
|
/** Gets or sets a string representing the message displayed on mobile when the control gets the focus */
|
|
@@ -2415,7 +2420,7 @@ declare module BABYLON.GUI {
|
|
|
2415
2420
|
/** Gets or sets the text displayed in the control */
|
|
2416
2421
|
get text(): string;
|
|
2417
2422
|
set text(value: string);
|
|
2418
|
-
|
|
2423
|
+
protected _textHasChanged(): void;
|
|
2419
2424
|
/** Gets or sets control width */
|
|
2420
2425
|
get width(): string | number;
|
|
2421
2426
|
set width(value: string | number);
|
|
@@ -2454,14 +2459,14 @@ declare module BABYLON.GUI {
|
|
|
2454
2459
|
* @param offset
|
|
2455
2460
|
* @hidden
|
|
2456
2461
|
*/
|
|
2457
|
-
|
|
2462
|
+
protected _updateValueFromCursorIndex(offset: number): void;
|
|
2458
2463
|
/**
|
|
2459
2464
|
* @param evt
|
|
2460
2465
|
* @hidden
|
|
2461
2466
|
*/
|
|
2462
|
-
|
|
2467
|
+
protected _processDblClick(evt: BABYLON.PointerInfo): void;
|
|
2463
2468
|
/** @hidden */
|
|
2464
|
-
|
|
2469
|
+
protected _selectAllText(): void;
|
|
2465
2470
|
/**
|
|
2466
2471
|
* Handles the keyboard event
|
|
2467
2472
|
* @param evt Defines the KeyboardEvent
|
|
@@ -2471,17 +2476,17 @@ declare module BABYLON.GUI {
|
|
|
2471
2476
|
* @param ev
|
|
2472
2477
|
* @hidden
|
|
2473
2478
|
*/
|
|
2474
|
-
|
|
2479
|
+
protected _onCopyText(ev: ClipboardEvent): void;
|
|
2475
2480
|
/**
|
|
2476
2481
|
* @param ev
|
|
2477
2482
|
* @hidden
|
|
2478
2483
|
*/
|
|
2479
|
-
|
|
2484
|
+
protected _onCutText(ev: ClipboardEvent): void;
|
|
2480
2485
|
/**
|
|
2481
2486
|
* @param ev
|
|
2482
2487
|
* @hidden
|
|
2483
2488
|
*/
|
|
2484
|
-
|
|
2489
|
+
protected _onPasteText(ev: ClipboardEvent): void;
|
|
2485
2490
|
_draw(context: BABYLON.ICanvasRenderingContext): void;
|
|
2486
2491
|
_onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, pi: BABYLON.PointerInfoBase): boolean;
|
|
2487
2492
|
_onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number, pi: BABYLON.PointerInfoBase): void;
|
|
@@ -2491,6 +2496,158 @@ declare module BABYLON.GUI {
|
|
|
2491
2496
|
}
|
|
2492
2497
|
|
|
2493
2498
|
|
|
2499
|
+
/**
|
|
2500
|
+
* Class used to create input text control
|
|
2501
|
+
*/
|
|
2502
|
+
export class InputTextArea extends InputText {
|
|
2503
|
+
name?: string | undefined;
|
|
2504
|
+
private _textHorizontalAlignment;
|
|
2505
|
+
private _textVerticalAlignment;
|
|
2506
|
+
private _lines;
|
|
2507
|
+
private _lineSpacing;
|
|
2508
|
+
private _outlineWidth;
|
|
2509
|
+
private _outlineColor;
|
|
2510
|
+
private _maxHeight;
|
|
2511
|
+
private _clipTextTop;
|
|
2512
|
+
private _clipTextLeft;
|
|
2513
|
+
private _cursorInfo;
|
|
2514
|
+
private _highlightCursorInfo;
|
|
2515
|
+
/**
|
|
2516
|
+
* An event triggered after the text was broken up into lines
|
|
2517
|
+
*/
|
|
2518
|
+
onLinesReadyObservable: BABYLON.Observable<InputTextArea>;
|
|
2519
|
+
/** @hidden */
|
|
2520
|
+
_connectedVirtualKeyboard: BABYLON.Nullable<VirtualKeyboard>;
|
|
2521
|
+
private _contextForBreakLines;
|
|
2522
|
+
private _clickedCoordinateX;
|
|
2523
|
+
private _clickedCoordinateY;
|
|
2524
|
+
private _availableWidth;
|
|
2525
|
+
private _availableHeight;
|
|
2526
|
+
private _scrollTop;
|
|
2527
|
+
private _autoStretchHeight;
|
|
2528
|
+
/**
|
|
2529
|
+
* Gets or sets outlineWidth of the text to display
|
|
2530
|
+
*/
|
|
2531
|
+
get outlineWidth(): number;
|
|
2532
|
+
/**
|
|
2533
|
+
* Gets or sets outlineWidth of the text to display
|
|
2534
|
+
*/
|
|
2535
|
+
set outlineWidth(value: number);
|
|
2536
|
+
/**
|
|
2537
|
+
* Gets or sets outlineColor of the text to display
|
|
2538
|
+
*/
|
|
2539
|
+
get outlineColor(): string;
|
|
2540
|
+
/**
|
|
2541
|
+
* Gets or sets outlineColor of the text to display
|
|
2542
|
+
*/
|
|
2543
|
+
set outlineColor(value: string);
|
|
2544
|
+
/** Gets or sets a boolean indicating if the control can auto stretch its height to adapt to the text */
|
|
2545
|
+
get autoStretchHeight(): boolean;
|
|
2546
|
+
set autoStretchHeight(value: boolean);
|
|
2547
|
+
set height(value: string | number);
|
|
2548
|
+
get maxHeight(): string | number;
|
|
2549
|
+
/** Gets the maximum width allowed by the control in pixels */
|
|
2550
|
+
get maxHeightInPixels(): number;
|
|
2551
|
+
set maxHeight(value: string | number);
|
|
2552
|
+
/**
|
|
2553
|
+
* Creates a new InputTextArea
|
|
2554
|
+
* @param name defines the control name
|
|
2555
|
+
* @param text defines the text of the control
|
|
2556
|
+
*/
|
|
2557
|
+
constructor(name?: string | undefined, text?: string);
|
|
2558
|
+
protected _getTypeName(): string;
|
|
2559
|
+
/**
|
|
2560
|
+
* Handles the keyboard event
|
|
2561
|
+
* @param evt Defines the KeyboardEvent
|
|
2562
|
+
*/
|
|
2563
|
+
processKeyboard(evt: BABYLON.IKeyboardEvent): void;
|
|
2564
|
+
/**
|
|
2565
|
+
* Process the last keyboard input
|
|
2566
|
+
*
|
|
2567
|
+
* @param code The ascii input number
|
|
2568
|
+
* @param key The key string representation
|
|
2569
|
+
* @param evt The keyboard event emits with input
|
|
2570
|
+
* @hidden
|
|
2571
|
+
*/
|
|
2572
|
+
alternativeProcessKey(code: string, key?: string, evt?: BABYLON.IKeyboardEvent): void;
|
|
2573
|
+
protected _parseLineWordWrap(line: string | undefined, width: number, context: BABYLON.ICanvasRenderingContext): {
|
|
2574
|
+
text: string;
|
|
2575
|
+
width: number;
|
|
2576
|
+
lineEnding: string;
|
|
2577
|
+
}[];
|
|
2578
|
+
protected _breakLines(refWidth: number, context: BABYLON.ICanvasRenderingContext): object[];
|
|
2579
|
+
protected _parseLine(line: string | undefined, context: BABYLON.ICanvasRenderingContext): {
|
|
2580
|
+
text: string;
|
|
2581
|
+
width: number;
|
|
2582
|
+
lineEnding: string;
|
|
2583
|
+
};
|
|
2584
|
+
/**
|
|
2585
|
+
* Processing of child right before the parent measurement update
|
|
2586
|
+
*
|
|
2587
|
+
* @param parentMeasure The parent measure
|
|
2588
|
+
* @param context The rendering canvas
|
|
2589
|
+
* @hidden
|
|
2590
|
+
*/
|
|
2591
|
+
protected _preMeasure(parentMeasure: Measure, context: BABYLON.ICanvasRenderingContext): void;
|
|
2592
|
+
/**
|
|
2593
|
+
* Processing of child after the parent measurement update
|
|
2594
|
+
*
|
|
2595
|
+
* @param parentMeasure The parent measure
|
|
2596
|
+
* @param context The rendering canvas
|
|
2597
|
+
* @hidden
|
|
2598
|
+
*/
|
|
2599
|
+
protected _additionalProcessing(parentMeasure: Measure, context: BABYLON.ICanvasRenderingContext): void;
|
|
2600
|
+
private _drawText;
|
|
2601
|
+
/**
|
|
2602
|
+
* Copy the text in the clipboard
|
|
2603
|
+
*
|
|
2604
|
+
* @param ev The clipboard event
|
|
2605
|
+
* @hidden
|
|
2606
|
+
*/
|
|
2607
|
+
protected _onCopyText(ev: ClipboardEvent): void;
|
|
2608
|
+
/**
|
|
2609
|
+
* Cut the text and copy it in the clipboard
|
|
2610
|
+
*
|
|
2611
|
+
* @param ev The clipboard event
|
|
2612
|
+
* @hidden
|
|
2613
|
+
*/
|
|
2614
|
+
protected _onCutText(ev: ClipboardEvent): void;
|
|
2615
|
+
/**
|
|
2616
|
+
* Paste the copied text from the clipboard
|
|
2617
|
+
*
|
|
2618
|
+
* @param ev The clipboard event
|
|
2619
|
+
* @hidden
|
|
2620
|
+
*/
|
|
2621
|
+
protected _onPasteText(ev: ClipboardEvent): void;
|
|
2622
|
+
_draw(context: BABYLON.ICanvasRenderingContext): void;
|
|
2623
|
+
private _resetBlinking;
|
|
2624
|
+
protected _applyStates(context: BABYLON.ICanvasRenderingContext): void;
|
|
2625
|
+
_onPointerDown(target: Control, coordinates: BABYLON.Vector2, pointerId: number, buttonIndex: number, pi: BABYLON.PointerInfoBase): boolean;
|
|
2626
|
+
_onPointerMove(target: Control, coordinates: BABYLON.Vector2, pointerId: number, pi: BABYLON.PointerInfoBase): void;
|
|
2627
|
+
/**
|
|
2628
|
+
* Apply the correct position of cursor according to current modification
|
|
2629
|
+
*/
|
|
2630
|
+
private _updateCursorPosition;
|
|
2631
|
+
/**
|
|
2632
|
+
* Update all values of cursor information based on cursorIndex value
|
|
2633
|
+
*
|
|
2634
|
+
* @param offset The index to take care of
|
|
2635
|
+
* @hidden
|
|
2636
|
+
*/
|
|
2637
|
+
protected _updateValueFromCursorIndex(offset: number): void;
|
|
2638
|
+
/**
|
|
2639
|
+
* Select the word immediatly under the cursor on double click
|
|
2640
|
+
*
|
|
2641
|
+
* @param _evt Pointer informations of double click
|
|
2642
|
+
* @hidden
|
|
2643
|
+
*/
|
|
2644
|
+
protected _processDblClick(_evt: BABYLON.PointerInfo): void;
|
|
2645
|
+
/** @hidden */
|
|
2646
|
+
protected _selectAllText(): void;
|
|
2647
|
+
dipose(): void;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
|
|
2494
2651
|
/** Class used to render 2D lines */
|
|
2495
2652
|
export class Line extends Control {
|
|
2496
2653
|
name?: string | undefined;
|