bm-core-ui 2.12.0-beta.3 → 2.12.0-beta.5
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/README.md +1 -1
- package/build/@types/index.d.ts +2187 -94
- package/build/BMCollectionView/BMCollectionView.js +979 -198
- package/build/BMCollectionView/BMCollectionViewFlowLayout.js +11 -4
- package/build/BMCoreUI.css +133 -2
- package/build/BMView/BMDragSession.js +1155 -0
- package/build/BMView/BMDragSessionActions.js +121 -0
- package/build/BMView/BMDragSessionPreview.js +1633 -0
- package/build/BMView/BMView_v2.5.js +21 -0
- package/build/BMWindow/BMPopover/BMPopover.js +35 -20
- package/build/BMWindow/BMWindow.js +124 -57
- package/build/images/AlignBottom.png +0 -0
- package/build/images/AlignCenterX.png +0 -0
- package/build/images/AlignCenterY.png +0 -0
- package/build/images/AlignLeading.png +0 -0
- package/build/images/AlignTop.png +0 -0
- package/build/images/AlignTrailing.png +0 -0
- package/build/images/AllConstraints.png +0 -0
- package/build/images/BottomConstraint.png +0 -0
- package/build/images/CenterXConstraint.png +0 -0
- package/build/images/CenterYConstraint.png +0 -0
- package/build/images/CoreUI2.png +0 -0
- package/build/images/CoreUI2@2x.png +0 -0
- package/build/images/Desktop.png +0 -0
- package/build/images/DesktopMini.png +0 -0
- package/build/images/EqualHeight.png +0 -0
- package/build/images/EqualHorizontalSpacing.png +0 -0
- package/build/images/EqualHorizontalSpacingInSuperview.png +0 -0
- package/build/images/EqualVerticalSpacing.png +0 -0
- package/build/images/EqualVerticalSpacingInSuperview.png +0 -0
- package/build/images/EqualWidth.png +0 -0
- package/build/images/HeightConstraint.png +0 -0
- package/build/images/InactiveConstraints.png +0 -0
- package/build/images/Layout.png +0 -0
- package/build/images/LayoutVariables.png +0 -0
- package/build/images/LeftConstraint.png +0 -0
- package/build/images/OwnConstraints.png +0 -0
- package/build/images/Phone.png +0 -0
- package/build/images/PhoneLandscape.png +0 -0
- package/build/images/PhoneLandscapeMini.png +0 -0
- package/build/images/PhoneMini.png +0 -0
- package/build/images/PhonePortrait.png +0 -0
- package/build/images/PhonePortraitMini.png +0 -0
- package/build/images/Properties.png +0 -0
- package/build/images/RightConstraint.png +0 -0
- package/build/images/SubviewConstraints.png +0 -0
- package/build/images/Tablet.png +0 -0
- package/build/images/TabletLandscape.png +0 -0
- package/build/images/TabletLandscapeMini.png +0 -0
- package/build/images/TabletMini.png +0 -0
- package/build/images/TabletPortrait.png +0 -0
- package/build/images/TabletPortraitMini.png +0 -0
- package/build/images/TopConstraint.png +0 -0
- package/build/images/WidthConstraint.png +0 -0
- package/build/index.js +4 -0
- package/lib/@types/BMCoreUI.min.d.ts +2187 -94
- package/lib/BMCoreUI.min.js +1 -1
- package/package.json +2 -2
package/build/@types/index.d.ts
CHANGED
|
@@ -4613,6 +4613,20 @@ export class BMView {
|
|
|
4613
4613
|
private _disableKeyboardShortcuts(): void;
|
|
4614
4614
|
|
|
4615
4615
|
|
|
4616
|
+
/**
|
|
4617
|
+
* Initiates a drag session with the specified drag delegate from a touch or mouse event.
|
|
4618
|
+
* @param event The event that triggered the drag gesture.
|
|
4619
|
+
* @param delegate The drag session delegate supplying items and
|
|
4620
|
+
* handling events for the session.
|
|
4621
|
+
* @param touchIdentifier If the event is a touch event and this is specified,
|
|
4622
|
+
* it represents the identifier of the touch point that
|
|
4623
|
+
* will be tracked throughout the drag session. If not
|
|
4624
|
+
* specified, the first changed touch will be used.
|
|
4625
|
+
*
|
|
4626
|
+
*/
|
|
4627
|
+
performDragWithEvent(event: MouseEvent | TouchEvent, {delegate, touchIdentifier}: {delegate: BMDragDelegate, touchIdentifier?: number | null | undefined}): void;
|
|
4628
|
+
|
|
4629
|
+
|
|
4616
4630
|
/**
|
|
4617
4631
|
* An internal list of layout constraints that affect this view. This array will contain both constraints having
|
|
4618
4632
|
* this view as the source view and constraints having this view as the target view. It also contains constraints
|
|
@@ -5399,111 +5413,1775 @@ export class BMTextField extends BMView {
|
|
|
5399
5413
|
* When this property is set to `NO`, suggestions will still appear as a drop down menu, but the text will not be automatically completed.
|
|
5400
5414
|
*
|
|
5401
5415
|
*/
|
|
5402
|
-
autoCompletes: boolean;
|
|
5416
|
+
autoCompletes: boolean;
|
|
5417
|
+
|
|
5418
|
+
/**
|
|
5419
|
+
* Used to control whether this text field supports suggestions that appear for the user as they are typing in this text field.
|
|
5420
|
+
* When this property is set to `YES`, if there are any suggestions obtained from the delegate object, the matching ones will appear
|
|
5421
|
+
* as a drop down below the text field. The text field will automatically select the first matching suggestion and fill it in if the user
|
|
5422
|
+
* presses the `return` key.
|
|
5423
|
+
*
|
|
5424
|
+
* When this property is set to `NO`, suggestions will be unavailable. This will also disable auto completion.
|
|
5425
|
+
*
|
|
5426
|
+
*/
|
|
5427
|
+
usesSuggestions: boolean;
|
|
5428
|
+
|
|
5429
|
+
/**
|
|
5430
|
+
* The maximum number of suggestions that will be visible when the autocomplete menu is open.
|
|
5431
|
+
*
|
|
5432
|
+
*/
|
|
5433
|
+
maxSuggestions: number;
|
|
5434
|
+
|
|
5435
|
+
/**
|
|
5436
|
+
* An optional delegate that can be used to respond to various callbacks from the text field.
|
|
5437
|
+
*
|
|
5438
|
+
*/
|
|
5439
|
+
delegate?: BMTextFieldDelegate | null | undefined;
|
|
5440
|
+
|
|
5441
|
+
/**
|
|
5442
|
+
* The focus event listener.
|
|
5443
|
+
*
|
|
5444
|
+
*/
|
|
5445
|
+
private _focusHandler: (($0: Event) => Promise<void>);
|
|
5446
|
+
|
|
5447
|
+
/**
|
|
5448
|
+
* The focus event listener.
|
|
5449
|
+
*
|
|
5450
|
+
*/
|
|
5451
|
+
private _blurHandler: (($0: Event) => void);
|
|
5452
|
+
|
|
5453
|
+
/**
|
|
5454
|
+
* The focus event listener.
|
|
5455
|
+
*
|
|
5456
|
+
*/
|
|
5457
|
+
private _keydownHandler: (($0: Event) => void);
|
|
5458
|
+
|
|
5459
|
+
/**
|
|
5460
|
+
* The focus event listener.
|
|
5461
|
+
*
|
|
5462
|
+
*/
|
|
5463
|
+
private _inputHandler: (($0: Event) => void);
|
|
5464
|
+
|
|
5465
|
+
/**
|
|
5466
|
+
* The paste event listener.
|
|
5467
|
+
*
|
|
5468
|
+
*/
|
|
5469
|
+
private _pasteHandler: (($0: Event) => void);
|
|
5470
|
+
|
|
5471
|
+
/**
|
|
5472
|
+
* Sets up the event handlers for this text field to handle suggestions.
|
|
5473
|
+
*
|
|
5474
|
+
*/
|
|
5475
|
+
private _setUpEventHandlers(): void;
|
|
5476
|
+
|
|
5477
|
+
|
|
5478
|
+
/**
|
|
5479
|
+
* Clears the event handlers for this text field when suggestions are disabled.
|
|
5480
|
+
*
|
|
5481
|
+
*/
|
|
5482
|
+
private _clearEventHandlers(): void;
|
|
5483
|
+
|
|
5484
|
+
|
|
5485
|
+
/**
|
|
5486
|
+
* Constructs and returns a DOM node for a menu item with the given label.
|
|
5487
|
+
* @param label The text to display in the menu item.
|
|
5488
|
+
* @param action An action that occurs when the menu item is selected.
|
|
5489
|
+
* @return A DOM node to be added to a menu.
|
|
5490
|
+
*
|
|
5491
|
+
*/
|
|
5492
|
+
private _menuItemWithLabel(label: string, {action}: {action: (($0: Event) => void)}): DOMNode;
|
|
5493
|
+
|
|
5494
|
+
|
|
5495
|
+
/**
|
|
5496
|
+
* Creates and brings up a context menu at the given coordinates, relative to the viewport.
|
|
5497
|
+
* @param point The point at which to show the menu.
|
|
5498
|
+
* @param withOptions The options that the menu should display.
|
|
5499
|
+
* @param kind Defaults to .Menu. The kind of menu to show.
|
|
5500
|
+
* @return The menu element.
|
|
5501
|
+
*
|
|
5502
|
+
*/
|
|
5503
|
+
private _showMenuAtPoint(point: BMPoint, {withOptions, kind}: {withOptions: DOMNode[], kind?: BMMenuKind | null | undefined}): DOMNode;
|
|
5504
|
+
|
|
5505
|
+
|
|
5506
|
+
/**
|
|
5507
|
+
* Constructs and returns a text field with a new DOM node.
|
|
5508
|
+
* @return A text field.
|
|
5509
|
+
*
|
|
5510
|
+
*/
|
|
5511
|
+
static textField (): BMTextField;
|
|
5512
|
+
|
|
5513
|
+
|
|
5514
|
+
/**
|
|
5515
|
+
* Constructs and returns a text field for the given input DOM node.
|
|
5516
|
+
* @param node An input DOM node.
|
|
5517
|
+
* @return A text field.
|
|
5518
|
+
*
|
|
5519
|
+
*/
|
|
5520
|
+
static textFieldForInputNode (node: DOMNode): BMTextField;
|
|
5521
|
+
|
|
5522
|
+
}
|
|
5523
|
+
|
|
5524
|
+
|
|
5525
|
+
/**
|
|
5526
|
+
* A list of constants describing what happens to source objects when they are transferred
|
|
5527
|
+
* as part of drag session a different target than the one they were dragged from.
|
|
5528
|
+
*
|
|
5529
|
+
*/
|
|
5530
|
+
export class BMDragTransferKind {
|
|
5531
|
+
/**
|
|
5532
|
+
* Indicates that the items should be moved from the source to the target. This must
|
|
5533
|
+
* be specified by both the source and the target for the movement to take place.
|
|
5534
|
+
*
|
|
5535
|
+
*/
|
|
5536
|
+
static Move: BMDragTransferKind;
|
|
5537
|
+
|
|
5538
|
+
/**
|
|
5539
|
+
* Indicates that a copy of the items will be transferred to the target. If either the
|
|
5540
|
+
* target or the source of the transfer specifies this transfer kind, a copy is performed
|
|
5541
|
+
* regardless of the transfer kind specified by the other.
|
|
5542
|
+
*
|
|
5543
|
+
*/
|
|
5544
|
+
static Copy: BMDragTransferKind;
|
|
5545
|
+
|
|
5546
|
+
private constructor();
|
|
5547
|
+
}
|
|
5548
|
+
|
|
5549
|
+
/**
|
|
5550
|
+
* An object that describes the action that should be performed for a drag session when it ends.
|
|
5551
|
+
*
|
|
5552
|
+
*/
|
|
5553
|
+
export class BMDragSessionAction {
|
|
5554
|
+
|
|
5555
|
+
/**
|
|
5556
|
+
* The action to perform at the end of the drag session.
|
|
5557
|
+
*
|
|
5558
|
+
*/
|
|
5559
|
+
readonly action: BMDragSessionActionKind;
|
|
5560
|
+
|
|
5561
|
+
/**
|
|
5562
|
+
* The message to display on the drag indicator describing the action.
|
|
5563
|
+
*
|
|
5564
|
+
*/
|
|
5565
|
+
readonly message: any;
|
|
5566
|
+
|
|
5567
|
+
/**
|
|
5568
|
+
* The HTML message to display on the drag indicator describing the action.
|
|
5569
|
+
*
|
|
5570
|
+
*/
|
|
5571
|
+
readonly messageHTML: any;
|
|
5572
|
+
|
|
5573
|
+
/**
|
|
5574
|
+
* Initializes this drag action with the specified drop action kind. Optionally,
|
|
5575
|
+
* a message and an item count override may be provided.
|
|
5576
|
+
* @param action The action to perform at the end of the drag session.
|
|
5577
|
+
* @param message If specified, an optional message to display on the
|
|
5578
|
+
* drag indicator describing the drop action.
|
|
5579
|
+
* @param messageHTML If specified, an optional HTML message to display on the
|
|
5580
|
+
* drag indicator describing the drop action. If `message` is
|
|
5581
|
+
* also specified, this parameter is not used.
|
|
5582
|
+
* @return This drag action.
|
|
5583
|
+
*
|
|
5584
|
+
*/
|
|
5585
|
+
initWithAction(action: BMDragSessionActionKind, {message, messageHTML}?: {message?: string | null | undefined, messageHTML?: string | null | undefined}): BMDragAction;
|
|
5586
|
+
|
|
5587
|
+
|
|
5588
|
+
/**
|
|
5589
|
+
* Creates and initializes a drag action with the specified drag action kind. Optionally,
|
|
5590
|
+
* a message and an item override may be provided.
|
|
5591
|
+
* @param action The action to perform at the end of the drag session.
|
|
5592
|
+
* @param message If specified, an optional message to display on the
|
|
5593
|
+
* drag indicator describing the drop action.
|
|
5594
|
+
* @param messageHTML If specified, an optional HTML message to display on the
|
|
5595
|
+
* drag indicator describing the drop action. If `message` is
|
|
5596
|
+
* also specified, this parameter is not used.
|
|
5597
|
+
* @return A drag action.
|
|
5598
|
+
*
|
|
5599
|
+
*/
|
|
5600
|
+
static actionWithKind (action: BMDragSessionDropActionKind, {message, messageHTML}?: {message?: string | null | undefined, messageHTML?: string | null | undefined}): BMDragSessionAction;
|
|
5601
|
+
|
|
5602
|
+
}
|
|
5603
|
+
|
|
5604
|
+
|
|
5605
|
+
/**
|
|
5606
|
+
* An object that describes the action that should be performed for a drop session when it ends.
|
|
5607
|
+
*
|
|
5608
|
+
*/
|
|
5609
|
+
export class BMDropSessionAction {
|
|
5610
|
+
|
|
5611
|
+
/**
|
|
5612
|
+
* The action to perform at the end of the drag session.
|
|
5613
|
+
*
|
|
5614
|
+
*/
|
|
5615
|
+
readonly action: BMDragSessionActionKind;
|
|
5616
|
+
|
|
5617
|
+
/**
|
|
5618
|
+
* The message to display on the drag indicator describing the action.
|
|
5619
|
+
*
|
|
5620
|
+
*/
|
|
5621
|
+
readonly message: any;
|
|
5622
|
+
|
|
5623
|
+
/**
|
|
5624
|
+
* The HTML message to display on the drag indicator describing the action.
|
|
5625
|
+
*
|
|
5626
|
+
*/
|
|
5627
|
+
readonly messageHTML: any;
|
|
5628
|
+
|
|
5629
|
+
/**
|
|
5630
|
+
* If specified when the action is `.AcceptPartially`, the drag items that are actually acceptable.
|
|
5631
|
+
*
|
|
5632
|
+
*/
|
|
5633
|
+
readonly acceptableItems: any;
|
|
5634
|
+
|
|
5635
|
+
/**
|
|
5636
|
+
* Initializes this drop action with the specified drop action kind. Optionally,
|
|
5637
|
+
* a message and an item count override may be provided.
|
|
5638
|
+
* @param action The action to perform at the end of the drop session.
|
|
5639
|
+
* @param message If specified, an optional message to display on the
|
|
5640
|
+
* drag indicator describing the drop action.
|
|
5641
|
+
* @param messageHTML If specified, an optional HTML message to display on the
|
|
5642
|
+
* drag indicator describing the drop action. If `message` is
|
|
5643
|
+
* also specified, this parameter is not used.
|
|
5644
|
+
* @param items If specified, the items that are acceptable for the current drop target.
|
|
5645
|
+
* Requires the `action` to be set to `.AcceptPartially` to take effect.
|
|
5646
|
+
* These items must be part of the drag or drop session.
|
|
5647
|
+
* @return This drop action.
|
|
5648
|
+
*
|
|
5649
|
+
*/
|
|
5650
|
+
initWithAction(action: BMDropSessionActionKind, {message, messageHTML, items}?: {message?: string | null | undefined, messageHTML?: string | null | undefined, items?: BMDragItem[] | null | undefined}): BMDragAction;
|
|
5651
|
+
|
|
5652
|
+
|
|
5653
|
+
/**
|
|
5654
|
+
* Creates and initializes a drop action with the specified drop action kind. Optionally,
|
|
5655
|
+
* a message and an item override may be provided.
|
|
5656
|
+
* @param action The action to perform at the end of the drop session.
|
|
5657
|
+
* @param message If specified, an optional message to display on the
|
|
5658
|
+
* drag indicator describing the drop action.
|
|
5659
|
+
* @param messageHTML If specified, an optional HTML message to display on the
|
|
5660
|
+
* drag indicator describing the drop action. If `message` is
|
|
5661
|
+
* also specified, this parameter is not used.
|
|
5662
|
+
* @param items If specified, the items that are acceptable for the current drop target.
|
|
5663
|
+
* Requires the `action` to be set to `.AcceptPartially` to take effect.
|
|
5664
|
+
* These items must be part of the drop session.
|
|
5665
|
+
* @return A drop action.
|
|
5666
|
+
*
|
|
5667
|
+
*/
|
|
5668
|
+
static actionWithKind (action: BMDragSessionDropActionKind, {message, messageHTML, items}?: {message?: string | null | undefined, messageHTML?: string | null | undefined, items?: BMDragItem[] | null | undefined}): BMDropSessionAction;
|
|
5669
|
+
|
|
5670
|
+
}
|
|
5671
|
+
|
|
5672
|
+
|
|
5673
|
+
/**
|
|
5674
|
+
* An object that describes an in-progress drag session. Drag sessions are automatically created by
|
|
5675
|
+
* views that begin drag operations and supplied to potential drop targets when the drag gesture
|
|
5676
|
+
* intersects their frame.
|
|
5677
|
+
*
|
|
5678
|
+
* To start a drag session, use the static `beginDragWithEvent` method, passing in the starting
|
|
5679
|
+
* event and a delegate object providing the contents of the drag session.
|
|
5680
|
+
*
|
|
5681
|
+
* The session can be used to obtain the items that participate in the drag gesture and to update
|
|
5682
|
+
* the state and messaging presented to the user.
|
|
5683
|
+
*
|
|
5684
|
+
*/
|
|
5685
|
+
export class BMDragSession implements EventHandlerObject {
|
|
5686
|
+
|
|
5687
|
+
/**
|
|
5688
|
+
* The drag delegate of hte object that initiated this drag session.
|
|
5689
|
+
*
|
|
5690
|
+
*/
|
|
5691
|
+
private _dragDelegate: BMDragDelegate;
|
|
5692
|
+
|
|
5693
|
+
/**
|
|
5694
|
+
* The view that initiated this drag session.
|
|
5695
|
+
*
|
|
5696
|
+
*/
|
|
5697
|
+
private _sourceView: BMView;
|
|
5698
|
+
|
|
5699
|
+
/**
|
|
5700
|
+
* The items participating in this drag session.
|
|
5701
|
+
*
|
|
5702
|
+
*/
|
|
5703
|
+
private readonly _items: any;
|
|
5704
|
+
|
|
5705
|
+
/**
|
|
5706
|
+
* An array of nodes corresponding to the previews of the items being dragged.
|
|
5707
|
+
* There may be fewer previews than items, and the preview positions in this array
|
|
5708
|
+
* correspond
|
|
5709
|
+
*
|
|
5710
|
+
*/
|
|
5711
|
+
private readonly _itemPreviews: any;
|
|
5712
|
+
|
|
5713
|
+
/**
|
|
5714
|
+
* The node displaying the items in this drag session.
|
|
5715
|
+
*
|
|
5716
|
+
*/
|
|
5717
|
+
private _itemCountNode: DOMNode;
|
|
5718
|
+
|
|
5719
|
+
/**
|
|
5720
|
+
* The current drop action as specified by the source view.
|
|
5721
|
+
*
|
|
5722
|
+
*/
|
|
5723
|
+
private _sourceDropAction: BMDragSessionAction;
|
|
5724
|
+
|
|
5725
|
+
/**
|
|
5726
|
+
* The current drop action as specified by the target view.
|
|
5727
|
+
*
|
|
5728
|
+
*/
|
|
5729
|
+
private _targetDropAction?: BMDropSessionAction | null | undefined;
|
|
5730
|
+
|
|
5731
|
+
/**
|
|
5732
|
+
* The outcome of ending the drag session at the current position.
|
|
5733
|
+
*
|
|
5734
|
+
*/
|
|
5735
|
+
private _dropAction: _BMDragDropSessionAction;
|
|
5736
|
+
|
|
5737
|
+
/**
|
|
5738
|
+
* The final drop action at the end of the session. This property is only accessible since the
|
|
5739
|
+
* `dragSessionWillFinish` delegate method is invoked.
|
|
5740
|
+
*
|
|
5741
|
+
*/
|
|
5742
|
+
readonly action: BMDragSessionAction | BMDropSessionAction | undefined;
|
|
5743
|
+
|
|
5744
|
+
/**
|
|
5745
|
+
* The event that started this drag session.
|
|
5746
|
+
*
|
|
5747
|
+
*/
|
|
5748
|
+
private _startEvent: MouseEvent | TouchEvent;
|
|
5749
|
+
|
|
5750
|
+
/**
|
|
5751
|
+
* The touch identifier tracked for this drag session if the session
|
|
5752
|
+
* was started via a touch event.
|
|
5753
|
+
*
|
|
5754
|
+
*/
|
|
5755
|
+
private _touchIdentifier?: number | null | undefined;
|
|
5756
|
+
|
|
5757
|
+
/**
|
|
5758
|
+
* The drag delegate object.
|
|
5759
|
+
*
|
|
5760
|
+
*/
|
|
5761
|
+
private _delegate: BMDragDelegate;
|
|
5762
|
+
|
|
5763
|
+
/**
|
|
5764
|
+
* Initializes this drag session with the specified initial mouse or touch event
|
|
5765
|
+
* and drag delegate object.
|
|
5766
|
+
* @param event The initial event that starts this drag session.
|
|
5767
|
+
* @param dragDelegate The drag delegate object providing information about
|
|
5768
|
+
* the items in this drag session.
|
|
5769
|
+
* @param view The view initiating this drag session.
|
|
5770
|
+
* @param touchIdentifier If the event is a touch event, the identifier of the
|
|
5771
|
+
* touch that should be tracked for the drag session.
|
|
5772
|
+
* If not specified, the first touch will be used instead.
|
|
5773
|
+
* @return This drag session.
|
|
5774
|
+
*
|
|
5775
|
+
*/
|
|
5776
|
+
private _initWithEvent(event: MouseEvent | TouchEvent, {dragDelegate, view, touchIdentifier}: {dragDelegate: BMDragDelegate, view: BMView, touchIdentifier?: number | null | undefined}): BMDragSession;
|
|
5777
|
+
|
|
5778
|
+
|
|
5779
|
+
/**
|
|
5780
|
+
* The current position of the drag session, relative to the viewport.
|
|
5781
|
+
*
|
|
5782
|
+
*/
|
|
5783
|
+
readonly position: BMPoint;
|
|
5784
|
+
|
|
5785
|
+
/**
|
|
5786
|
+
* The drag indicator displaying information about the drag and drop session.
|
|
5787
|
+
*
|
|
5788
|
+
*/
|
|
5789
|
+
private _dragIndicator?: _BMDragIndicator | null | undefined;
|
|
5790
|
+
|
|
5791
|
+
/**
|
|
5792
|
+
* The current drop target view, if any.
|
|
5793
|
+
*
|
|
5794
|
+
*/
|
|
5795
|
+
private _dropTarget?: BMView | null | undefined;
|
|
5796
|
+
|
|
5797
|
+
/**
|
|
5798
|
+
* A map containing the views that represent valid drop targets for this session as keys
|
|
5799
|
+
* and the drop sessions that were created for each as the associated values.
|
|
5800
|
+
*
|
|
5801
|
+
*/
|
|
5802
|
+
private _dropSessions: Map<BMView, BMDropSession | BMDragSession>;
|
|
5803
|
+
|
|
5804
|
+
/**
|
|
5805
|
+
* For touch drag sessions, an event handler used to determine when a new drop target
|
|
5806
|
+
* has been reached as the touch pointer moves over a new drop target.
|
|
5807
|
+
*
|
|
5808
|
+
*/
|
|
5809
|
+
private _touchDropTargetHandler?: (($0: TouchEvent) => void) | null | undefined;
|
|
5810
|
+
|
|
5811
|
+
/**
|
|
5812
|
+
* A dictionary of event handlers that have been attached to the source view for which this
|
|
5813
|
+
* drag session was created.
|
|
5814
|
+
*
|
|
5815
|
+
*/
|
|
5816
|
+
private _eventHandlers: Dictionary<unknown>;
|
|
5817
|
+
|
|
5818
|
+
/**
|
|
5819
|
+
* The preview set managing the drag previews.
|
|
5820
|
+
*
|
|
5821
|
+
*/
|
|
5822
|
+
private _previewSet: _BMDragPreviewSet;
|
|
5823
|
+
|
|
5824
|
+
/**
|
|
5825
|
+
* An array of drop previews that can be used to customize the drop animation. This property is only
|
|
5826
|
+
* initialized at the end of the drag session if the delegate object implemented the
|
|
5827
|
+
* `dragSessionRequiresCustomDropAnimationForItems` method and returned `YES` from it when it was
|
|
5828
|
+
* invoked.
|
|
5829
|
+
*
|
|
5830
|
+
*/
|
|
5831
|
+
readonly dropPreviews?: BMDropPreview[] | null | undefined;
|
|
5832
|
+
|
|
5833
|
+
/**
|
|
5834
|
+
* The kind of transfer that will be performed. Only set after the `dragSessionWillFinish` delegate
|
|
5835
|
+
* method returns if the outcome of the drag and drop gesture is transfer to a different view.
|
|
5836
|
+
* `undefined` in all other cases.
|
|
5837
|
+
*
|
|
5838
|
+
*/
|
|
5839
|
+
readonly transferKind?: BMDragTransferKind | null | undefined;
|
|
5840
|
+
|
|
5841
|
+
/**
|
|
5842
|
+
* Sets up the drag previews and indicator and appropriate event handlers and starts tracking
|
|
5843
|
+
* a drag originating from the event with which this drag session was initialized.
|
|
5844
|
+
*
|
|
5845
|
+
*/
|
|
5846
|
+
private _beginDrag(): void;
|
|
5847
|
+
|
|
5848
|
+
|
|
5849
|
+
/**
|
|
5850
|
+
* Invoked whenever the pointer moves while this drag session is in progress.
|
|
5851
|
+
* @param event The event.
|
|
5852
|
+
*
|
|
5853
|
+
*/
|
|
5854
|
+
private _dragDidMoveWithEvent(event: MouseEvent | TouchEvent): void;
|
|
5855
|
+
|
|
5856
|
+
|
|
5857
|
+
/**
|
|
5858
|
+
* Invoked when the pointer is released or cancelled while this drag session is in progress.
|
|
5859
|
+
* @param event The event.
|
|
5860
|
+
* @return A promise that resolves when all associated animations finish.
|
|
5861
|
+
*
|
|
5862
|
+
*/
|
|
5863
|
+
private _dragDidFinishWithEvent(event: MouseEvent | TouchEvent): Promise<void>;
|
|
5864
|
+
|
|
5865
|
+
|
|
5866
|
+
/**
|
|
5867
|
+
* Sets up the event handlers that are used to determine when the drag moves over one
|
|
5868
|
+
* of the valid drop targets.
|
|
5869
|
+
*
|
|
5870
|
+
*/
|
|
5871
|
+
private _initDropTargetHandlers(): void;
|
|
5872
|
+
|
|
5873
|
+
|
|
5874
|
+
/**
|
|
5875
|
+
* Removes the event handlers used to determine the drop target that have been set up for this drag session.
|
|
5876
|
+
*
|
|
5877
|
+
*/
|
|
5878
|
+
private _releaseDropTargetHandlers(): void;
|
|
5879
|
+
|
|
5880
|
+
|
|
5881
|
+
/**
|
|
5882
|
+
* An identifier for the timeout registered to update the item previews after the
|
|
5883
|
+
* drag gesture moves over a new drop target.
|
|
5884
|
+
*
|
|
5885
|
+
*/
|
|
5886
|
+
private _itemPreviewsUpdateIdentifier?: number | null | undefined;
|
|
5887
|
+
|
|
5888
|
+
/**
|
|
5889
|
+
* Updates the drop target, invoking the appropriate method on the delegate objects.
|
|
5890
|
+
* @param target The current drop target, or `undefined` if the drag gesture
|
|
5891
|
+
* is not currently over any drop target.
|
|
5892
|
+
*
|
|
5893
|
+
*/
|
|
5894
|
+
private _setDropTarget(target?: BMView | null | undefined): void;
|
|
5895
|
+
|
|
5896
|
+
|
|
5897
|
+
/**
|
|
5898
|
+
* Updates the drop action displayed by this drag session, based on the current
|
|
5899
|
+
* source and target drop actions.
|
|
5900
|
+
*
|
|
5901
|
+
*/
|
|
5902
|
+
private _updateDropAction(): void;
|
|
5903
|
+
|
|
5904
|
+
|
|
5905
|
+
/**
|
|
5906
|
+
* Starts a drag and drop session from the specified mouse or touch event.
|
|
5907
|
+
* using a delegate to supply information about the items that are being transferred.
|
|
5908
|
+
* @param event The event starting the drag.
|
|
5909
|
+
* @param dragDelegate The delegate object providing information about the
|
|
5910
|
+
* items being dragged.
|
|
5911
|
+
* @param view The view initiating this drag session.
|
|
5912
|
+
* @param touchIdentifier If the event is a touch event, the identifier of the
|
|
5913
|
+
* touch that should be tracked for the drag session.
|
|
5914
|
+
* If not specified, the first touch will be used instead.
|
|
5915
|
+
*
|
|
5916
|
+
*/
|
|
5917
|
+
private static _beginDragWithEvent (event: MouseEvent | TouchEvent, {dragDelegate, view, touchIdentifier}: {dragDelegate: BMDragDelegate, view: BMView, touchIdentifier?: number | null | undefined}): void;
|
|
5918
|
+
|
|
5919
|
+
|
|
5920
|
+
/**
|
|
5921
|
+
* Sets the maximum number of additional drag previews for multi-item drag sessions that can be displayed
|
|
5922
|
+
* in addition to the drag preview of the first item. Updating this value only affects drag sessions
|
|
5923
|
+
* started after this method returns.
|
|
5924
|
+
* @param max The new maximum number of previews to display.
|
|
5925
|
+
*
|
|
5926
|
+
*/
|
|
5927
|
+
static setMaximumAdditionalDragPreviews (max: number): void;
|
|
5928
|
+
|
|
5929
|
+
|
|
5930
|
+
/**
|
|
5931
|
+
* A map containing views that are drop targets as keys and their associated drop delegate objects as values.
|
|
5932
|
+
*
|
|
5933
|
+
*/
|
|
5934
|
+
private static _dropTargets (): void;
|
|
5935
|
+
|
|
5936
|
+
|
|
5937
|
+
/**
|
|
5938
|
+
* Registers a view as a potential drop target for future drag sessions, using the specified delegate
|
|
5939
|
+
* to handle updates to the associated drop sessions and the drop actions.
|
|
5940
|
+
*
|
|
5941
|
+
* If the view is already registered as a drop target, this will replace the delegate handling future
|
|
5942
|
+
* drop sessions for the view with the specified object.
|
|
5943
|
+
* @param target The view that will act as a drop target.
|
|
5944
|
+
* @param delegate The delegate that will handle actions and events from the drop
|
|
5945
|
+
* session on behalf of the target view.
|
|
5946
|
+
*
|
|
5947
|
+
*/
|
|
5948
|
+
static registerDropTarget (target: BMView, {delegate}: {delegate: BMDropDelegate}): void;
|
|
5949
|
+
|
|
5950
|
+
|
|
5951
|
+
/**
|
|
5952
|
+
* Unregisters a view as a potential drop target for future drag sessions. This has no effect on any
|
|
5953
|
+
* in-progress drop sessions which will continue using the previously registered delegate to handle
|
|
5954
|
+
* events and actions.
|
|
5955
|
+
*
|
|
5956
|
+
* This method has no effect if the view is not registered as a drop target.
|
|
5957
|
+
* @param target The view that was previously registered as a drop target.
|
|
5958
|
+
*
|
|
5959
|
+
*/
|
|
5960
|
+
static unregisterDropTarget (target: BMView): void;
|
|
5961
|
+
|
|
5962
|
+
}
|
|
5963
|
+
|
|
5964
|
+
|
|
5965
|
+
export class BMDropSession {
|
|
5966
|
+
|
|
5967
|
+
/**
|
|
5968
|
+
* The drag session managing the drag gesture for which this drop session was created.
|
|
5969
|
+
*
|
|
5970
|
+
*/
|
|
5971
|
+
private _dragSession: BMDragSession;
|
|
5972
|
+
|
|
5973
|
+
/**
|
|
5974
|
+
* The drop delegate specifying the behaviour of the drop over this drop target.
|
|
5975
|
+
*
|
|
5976
|
+
*/
|
|
5977
|
+
private _delegate: BMDropDelegate;
|
|
5978
|
+
|
|
5979
|
+
/**
|
|
5980
|
+
* A dictionary of event handlers that have been attached to the drop target view for which this
|
|
5981
|
+
* drop session was created.
|
|
5982
|
+
*
|
|
5983
|
+
*/
|
|
5984
|
+
private _eventHandlers: Dictionary<unknown>;
|
|
5985
|
+
|
|
5986
|
+
/**
|
|
5987
|
+
* The current drop action.
|
|
5988
|
+
*
|
|
5989
|
+
*/
|
|
5990
|
+
readonly dropAction: BMDropSessionAction;
|
|
5991
|
+
|
|
5992
|
+
/**
|
|
5993
|
+
* An array of drop previews that can be used to customize the drop animation. This property is only
|
|
5994
|
+
* initialized at the end of accepted drop sessions if the delegate object implemented the
|
|
5995
|
+
* `dropSessionRequiresCustomDropAnimationForItems` method and returned `YES` from it.
|
|
5996
|
+
*
|
|
5997
|
+
*/
|
|
5998
|
+
readonly dropPreviews?: BMDropPreview[] | null | undefined;
|
|
5999
|
+
|
|
6000
|
+
/**
|
|
6001
|
+
* The kind of transfer that will be performed. Only set before the `dropSessionPerformDrop` delegate
|
|
6002
|
+
* method is invoked if the outcome of this drop session is a transfer of items into the target view.
|
|
6003
|
+
*
|
|
6004
|
+
*/
|
|
6005
|
+
readonly transferKind?: BMDragTransferKind | null | undefined;
|
|
6006
|
+
|
|
6007
|
+
/**
|
|
6008
|
+
* Initializes this drop session with the specified drag session and the drop delegate.
|
|
6009
|
+
* @param session The drag session associated with this drop session
|
|
6010
|
+
* @param delegate The drop delegate used to determine the outcome of the drop.
|
|
6011
|
+
* @return This drop session.
|
|
6012
|
+
*
|
|
6013
|
+
*/
|
|
6014
|
+
private _initWithDragSession(session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
|
|
6015
|
+
|
|
6016
|
+
|
|
6017
|
+
/**
|
|
6018
|
+
* The current position of the drag and drop gesture.
|
|
6019
|
+
*
|
|
6020
|
+
*/
|
|
6021
|
+
readonly position: BMPoint;
|
|
6022
|
+
|
|
6023
|
+
/**
|
|
6024
|
+
* The items being transferred in the drag and drop gesture.
|
|
6025
|
+
*
|
|
6026
|
+
*/
|
|
6027
|
+
readonly items: BMDragItem[];
|
|
6028
|
+
|
|
6029
|
+
/**
|
|
6030
|
+
* The items that have been accepted through this drop session. This property is only initialized
|
|
6031
|
+
* before the `dropSessionPerformDrop` delegate method is invoked.
|
|
6032
|
+
*
|
|
6033
|
+
*/
|
|
6034
|
+
readonly dropItems?: BMDragItem[] | null | undefined;
|
|
6035
|
+
|
|
6036
|
+
/**
|
|
6037
|
+
* Creates and returns a drop session initialized with the specified drag session and the drop delegate.
|
|
6038
|
+
* @param session The drag session associated with the drop session
|
|
6039
|
+
* @param delegate The drop delegate used to determine the outcome of the drop.
|
|
6040
|
+
* @return A drop session.
|
|
6041
|
+
*
|
|
6042
|
+
*/
|
|
6043
|
+
private static _sessionForDragSession (session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
|
|
6044
|
+
|
|
6045
|
+
}
|
|
6046
|
+
|
|
6047
|
+
|
|
6048
|
+
/**
|
|
6049
|
+
* The specification of a `BMDragDelegate` object which is used to obtain information about a dragging session
|
|
6050
|
+
* from the object that starts it and customize its behaviour depending on its position in the viewport.
|
|
6051
|
+
*
|
|
6052
|
+
*/
|
|
6053
|
+
export interface BMDragDelegate {
|
|
6054
|
+
|
|
6055
|
+
/**
|
|
6056
|
+
* Invoked at the beginning of a drag session to obtain the initial items that will be
|
|
6057
|
+
* part of the drag session.
|
|
6058
|
+
*
|
|
6059
|
+
* The delegate object implementing this method must provide an array of drag items that
|
|
6060
|
+
* will be transferred as part of the drag session. The array must contain at least one item.
|
|
6061
|
+
* @param session The drag session that is starting.
|
|
6062
|
+
* @return An array of drag items that will be part of the drag session.
|
|
6063
|
+
*
|
|
6064
|
+
*/
|
|
6065
|
+
dragSessionInitialItems(session: BMDragSession): BMDragItem[];
|
|
6066
|
+
|
|
6067
|
+
|
|
6068
|
+
/**
|
|
6069
|
+
* Invoked by a drag session to obtain a preview for the specified drag item at the beginning
|
|
6070
|
+
* of a drag session. The drag session will invoke this method only for the first few items
|
|
6071
|
+
* that will be visible while the drag session is in progress.
|
|
6072
|
+
*
|
|
6073
|
+
* Delegate objects implementing this method must provide an appropriate preview for the
|
|
6074
|
+
* specified item by returning a {@link BMDragPreview} object initialized for the specified
|
|
6075
|
+
* drag item.
|
|
6076
|
+
* @param session The drag session for which to supply an item preview.
|
|
6077
|
+
* @param item An item that is part of the drag session whose preview
|
|
6078
|
+
* should be provided.
|
|
6079
|
+
* @return The preview that will be displayed for the item.
|
|
6080
|
+
*
|
|
6081
|
+
*/
|
|
6082
|
+
dragSessionPreviewForItem(session: BMDragSession, item: BMDragItem): BMDragPreview;
|
|
6083
|
+
|
|
6084
|
+
|
|
6085
|
+
/**
|
|
6086
|
+
* Invoked when a drag session is about to end and there items that will not be transferred to determine if
|
|
6087
|
+
* the drag delegate wants to play a customized drop animation for the specified items which for
|
|
6088
|
+
* which drag previews are currently displayed. This method is only invoked if there is at least one item
|
|
6089
|
+
* with a preview that will not be transferred or deleted as part of the drag session.
|
|
6090
|
+
*
|
|
6091
|
+
* Implementing and returning `YES` from this method will cause the drag session to not play the
|
|
6092
|
+
* standard drop animation for the specified items. Instead, in the `dragSessionAnimateDropWithPreviews`,
|
|
6093
|
+
* `dragSessionPerformMoveForItems` and `dragSessionPerformDelete` methods,
|
|
6094
|
+
* the drag session's `dropPreviews` property will contain an array of drag previews that can be
|
|
6095
|
+
* used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
|
|
6096
|
+
* @param session The drag session.
|
|
6097
|
+
* @param items The items that have not been accepted for transferring or deleted.
|
|
6098
|
+
* @return `NO` to play the standard drop animation, or `YES` to play
|
|
6099
|
+
* a customized drop animation.
|
|
6100
|
+
*
|
|
6101
|
+
*/
|
|
6102
|
+
dragSessionRequiresCustomDropAnimationForItems?(session: BMDragSession, items: BMDragItem[]): boolean;
|
|
6103
|
+
|
|
6104
|
+
|
|
6105
|
+
/**
|
|
6106
|
+
* Invoked after returning `YES` from `dragSessionRequiresCustomDropAnimationForItems` to play a drop animation
|
|
6107
|
+
* for the specified drop previews. Delegate objects implementing this method should play an appropriate drop animation
|
|
6108
|
+
* for the specified drop previews, then detach them from the document.
|
|
6109
|
+
* @param session The drag session for which to play the drop animation.
|
|
6110
|
+
* @param previews The drop previews that should be animated.
|
|
6111
|
+
*
|
|
6112
|
+
*/
|
|
6113
|
+
dragSessionAnimateDropWithPreviews?(session: BMDragSession, previews: BMDropPreview[]): void;
|
|
6114
|
+
|
|
6115
|
+
|
|
6116
|
+
/**
|
|
6117
|
+
* Invoked by a drag session after a drop target accepts or partially accepts the items in the session
|
|
6118
|
+
* and both this delegate and the associated drop delegate have specified that the transfer should
|
|
6119
|
+
* be a transfer of kind `.Move`.
|
|
6120
|
+
*
|
|
6121
|
+
* Delegate objects that support moving items must implement this method and remove the specified
|
|
6122
|
+
* items that have been moved into the drop target.
|
|
6123
|
+
* @param session The drag session through which items have been moved.
|
|
6124
|
+
* @param items The items that have been moved into the drop target. These
|
|
6125
|
+
* may be a subset of the session's items if the drop target
|
|
6126
|
+
* has specified a drop action of `.AcceptPartially`.
|
|
6127
|
+
*
|
|
6128
|
+
*/
|
|
6129
|
+
dragSessionPerformMoveForItems?(session: BMDragSession, items: BMDragItem[]): void;
|
|
6130
|
+
|
|
6131
|
+
|
|
6132
|
+
/**
|
|
6133
|
+
* Invoked by a drag session if a drop occurs in a location where this delegate has specified that
|
|
6134
|
+
* the action should be to delete the items.
|
|
6135
|
+
*
|
|
6136
|
+
* Delegate objects that support deleting items must implement this method and remove all items in
|
|
6137
|
+
* the drag session.
|
|
6138
|
+
* @param session The drag session through which the items have been removed.
|
|
6139
|
+
*
|
|
6140
|
+
*/
|
|
6141
|
+
dragSessionPerformDelete?(session: BMDragSession): void;
|
|
6142
|
+
|
|
6143
|
+
|
|
6144
|
+
/**
|
|
6145
|
+
* Invoked by a drag session to determine if items can be transferred to other drop targets.
|
|
6146
|
+
*
|
|
6147
|
+
* Delegate objects implementing this method should return a boolean indicating whether
|
|
6148
|
+
* transfers can be performed or not. A return value of `YES` is assumed when this method
|
|
6149
|
+
* is not implemented by the delegate object.
|
|
6150
|
+
* @param session The drag session that will be transferring items.
|
|
6151
|
+
* @return `YES` if item transfer is supported, `NO` otherwise.
|
|
6152
|
+
*
|
|
6153
|
+
*/
|
|
6154
|
+
dragSessionCanTransferItems?(session: BMDragSession): boolean;
|
|
6155
|
+
|
|
6156
|
+
|
|
6157
|
+
/**
|
|
6158
|
+
* Invoked by a drag session that is about to begin from this delegate.
|
|
6159
|
+
* @param session The drag session that is about to begin.
|
|
6160
|
+
*
|
|
6161
|
+
*/
|
|
6162
|
+
dragSessionWillBegin?(session: BMDragSession): void;
|
|
6163
|
+
|
|
6164
|
+
|
|
6165
|
+
/**
|
|
6166
|
+
* Invoked when a drag session enters the frame of the source view.
|
|
6167
|
+
* @param session The drag session that entered the view's frame.
|
|
6168
|
+
*
|
|
6169
|
+
*/
|
|
6170
|
+
dragSessionDidEnter?(session: BMDragSession): void;
|
|
6171
|
+
|
|
6172
|
+
|
|
6173
|
+
/**
|
|
6174
|
+
* Invoked by a drag session whenever its position is updated. This method is continually
|
|
6175
|
+
* invoked as the drag position changes, even while the gesture moves outside of the
|
|
6176
|
+
* source view's frame.
|
|
6177
|
+
* Delegates implementing this method should return a drop action indicating the outcome of
|
|
6178
|
+
* dropping the items at the session's current position.
|
|
6179
|
+
* @param session The drag session. Its position may be retrieved via
|
|
6180
|
+
* the `position` property.
|
|
6181
|
+
* @return The new action the source view would like to perform if the
|
|
6182
|
+
* drop session ended at the current position, or `undefined`
|
|
6183
|
+
* if the current action should be retained.
|
|
6184
|
+
*
|
|
6185
|
+
*/
|
|
6186
|
+
dragSessionDidUpdate?(session: BMDragSession): BMDragSessionAction | null | undefined;
|
|
6187
|
+
|
|
6188
|
+
|
|
6189
|
+
/**
|
|
6190
|
+
* Invoked when a drag session exits the frame of the source view.
|
|
6191
|
+
* @param session The drag session that exited the view's frame.
|
|
6192
|
+
*
|
|
6193
|
+
*/
|
|
6194
|
+
dragSessionDidExit?(session: BMDragSession): void;
|
|
6195
|
+
|
|
6196
|
+
|
|
6197
|
+
/**
|
|
6198
|
+
* Invoked by a drag session to obtain the kind of transfer to perform for the items being dragged.
|
|
6199
|
+
* This method is invoked when the drop occurs on a drop target that accepted the transfer or whenever
|
|
6200
|
+
* a drop requests a drop action that requires a specific transfer kind.
|
|
6201
|
+
*
|
|
6202
|
+
* Delegate objects implementing this method should return an appropriate transfer kind for
|
|
6203
|
+
* the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
|
|
6204
|
+
* @param session The drag session through which the item transfer was performed.
|
|
6205
|
+
* @return The kind of transfer to perform.
|
|
6206
|
+
*
|
|
6207
|
+
*/
|
|
6208
|
+
dragSessionTransferKind?(session: BMDragSession): BMDragTransferKind;
|
|
6209
|
+
|
|
6210
|
+
|
|
6211
|
+
/**
|
|
6212
|
+
* Invoked by a drag session that is about to finish.
|
|
6213
|
+
*
|
|
6214
|
+
* Delegate objects may optionally implement this method to perform any necessary cleanup
|
|
6215
|
+
* before the drag session ends.
|
|
6216
|
+
* @param session The drag session.
|
|
6217
|
+
*
|
|
6218
|
+
*/
|
|
6219
|
+
dragSessionWillFinish?(session: BMDragSession): void;
|
|
6220
|
+
|
|
6221
|
+
|
|
6222
|
+
/**
|
|
6223
|
+
* Invoked by a drag session that has finished and all associated animations have concluded.
|
|
6224
|
+
*
|
|
6225
|
+
* Delegate objects may optionally implement this method to perform any necessary cleanup
|
|
6226
|
+
* before the drag session ends.
|
|
6227
|
+
* @param session The drag session.
|
|
6228
|
+
*
|
|
6229
|
+
*/
|
|
6230
|
+
dragSessionDidFinish?(session: BMDragSession): void;
|
|
6231
|
+
|
|
6232
|
+
}
|
|
6233
|
+
|
|
6234
|
+
|
|
6235
|
+
/**
|
|
6236
|
+
* The specification of a `BMDropDelegate` object which is used to obtain information about
|
|
6237
|
+
* whether a drag session can be accepted by potential drop targets and to customize the information
|
|
6238
|
+
* presented to users as the drag moves over the drop area.
|
|
6239
|
+
*
|
|
6240
|
+
*/
|
|
6241
|
+
export interface BMDropDelegate {
|
|
6242
|
+
|
|
6243
|
+
/**
|
|
6244
|
+
* Invoked when a drag session starts to verify if the target view can accept the items
|
|
6245
|
+
* in the specified drop session. When returning `YES` from this method, the view will
|
|
6246
|
+
* be considered a valid drop target for the session and will receive updates when the
|
|
6247
|
+
* drag will enter the view's frame.
|
|
6248
|
+
* @param session The drop session containing the items to be verified.
|
|
6249
|
+
* @return `YES` if at least one item is acceptable for dropping,
|
|
6250
|
+
* `NO` otherwise.
|
|
6251
|
+
*
|
|
6252
|
+
*/
|
|
6253
|
+
dropSessionCanBegin(session: BMDropSession): boolean;
|
|
6254
|
+
|
|
6255
|
+
|
|
6256
|
+
/**
|
|
6257
|
+
* Invoked when a drop session ends while in the target view's frame. Delegate objects implementing
|
|
6258
|
+
* this method should perform the appropriate changes based on the session's drop action.
|
|
6259
|
+
* @param session The drop session for which to perform the drop action.
|
|
6260
|
+
*
|
|
6261
|
+
*/
|
|
6262
|
+
dropSessionPerformDrop(session: BMDropSession): void;
|
|
6263
|
+
|
|
6264
|
+
|
|
6265
|
+
/**
|
|
6266
|
+
* Invoked when a drop session is about to end while in the target view's frame to determine if
|
|
6267
|
+
* the drop delegate wants to play a customized drop animation for the specified items which for
|
|
6268
|
+
* which drag previews are currently displayed. This method is only invoked if the specified drop
|
|
6269
|
+
* action is `.Accept` or `.AcceptPartially`.
|
|
6270
|
+
*
|
|
6271
|
+
* Implementing and returning `YES` from this method will cause the drop session to not play the
|
|
6272
|
+
* standard drop animation for the specified items. Instead, in the `dropSessionPerformDrop` method,
|
|
6273
|
+
* the drop session's `dropPreviews` property will contain an array of drop previews that can be
|
|
6274
|
+
* used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
|
|
6275
|
+
* @param session The drop session.
|
|
6276
|
+
* @param items The items that have been accepted by the drop target and which
|
|
6277
|
+
* have drag previews associated with them.
|
|
6278
|
+
* @return `NO` to play the standard drop animation, or `YES` to play
|
|
6279
|
+
* a customized drop animation.
|
|
6280
|
+
*
|
|
6281
|
+
*/
|
|
6282
|
+
dropSessionRequiresCustomDropAnimationForItems?(session: BMDropSession, items: BMDragItem[]): boolean;
|
|
6283
|
+
|
|
6284
|
+
|
|
6285
|
+
/**
|
|
6286
|
+
* Invoked by a drop session to obtain the kind of transfer to perform for the items being dragged.
|
|
6287
|
+
* This method is invoked when the drop occurs on a drop target that accepted the transfer.
|
|
6288
|
+
* Delegate objects implementing this method should return an appropriate transfer kind for
|
|
6289
|
+
* the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
|
|
6290
|
+
* @param session The drop session through which the item transfer was performed.
|
|
6291
|
+
* @return The kind of transfer to perform.
|
|
6292
|
+
*
|
|
6293
|
+
*/
|
|
6294
|
+
dropSessionTransferKind?(session: BMDropSession): BMDragTransferKind;
|
|
6295
|
+
|
|
6296
|
+
|
|
6297
|
+
/**
|
|
6298
|
+
* Invoked when a drop session enters the frame of the target view.
|
|
6299
|
+
* @param session The drop session that entered the view's frame.
|
|
6300
|
+
*
|
|
6301
|
+
*/
|
|
6302
|
+
dropSessionDidEnter?(session: BMDropSession): void;
|
|
6303
|
+
|
|
6304
|
+
|
|
6305
|
+
/**
|
|
6306
|
+
* Invoked by a drop session whenever it updates while over the target view's frame. This method
|
|
6307
|
+
* is invoked when the session enters the frame and whenever it moves.
|
|
6308
|
+
* Delegates implementing this method should return a drop action indicating the outcome of
|
|
6309
|
+
* dropping the items at the session's current position.
|
|
6310
|
+
* @param session The drop session that updated.
|
|
6311
|
+
* @return The new action the target view would like to perform if the
|
|
6312
|
+
* drop session ended at the current position, or `undefined`
|
|
6313
|
+
* if the current action should be retained.
|
|
6314
|
+
*
|
|
6315
|
+
*/
|
|
6316
|
+
dropSessionDidUpdate?(session: BMDropSession): BMDropSessionAction | null | undefined;
|
|
6317
|
+
|
|
6318
|
+
|
|
6319
|
+
/**
|
|
6320
|
+
* Invoked when a drop session exits the frame of the target view. Subsequent updates for this drop
|
|
6321
|
+
* session will no longer be provided until the drop session moves into the target view again.
|
|
6322
|
+
* @param session The drop session that exited the view's frame.
|
|
6323
|
+
*
|
|
6324
|
+
*/
|
|
6325
|
+
dropSessionDidExit?(session: BMDropSession): void;
|
|
6326
|
+
|
|
6327
|
+
|
|
6328
|
+
/**
|
|
6329
|
+
* Invoked to notify the delegate that the specified drop session is about to finish. This is invoked for a drop
|
|
6330
|
+
* delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
|
|
6331
|
+
* in the target view's frame or not.
|
|
6332
|
+
* @param session The drop session that ended.
|
|
6333
|
+
*
|
|
6334
|
+
*/
|
|
6335
|
+
dropSessionWillFinish?(session: BMDropSession): void;
|
|
6336
|
+
|
|
6337
|
+
|
|
6338
|
+
/**
|
|
6339
|
+
* Invoked to notify the delegate that the specified drop session has finished. This is invoked for a drop
|
|
6340
|
+
* delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
|
|
6341
|
+
* in the target view's frame or not.
|
|
6342
|
+
* @param session The drop session that ended.
|
|
6343
|
+
*
|
|
6344
|
+
*/
|
|
6345
|
+
dropSessionDidFinish?(session: BMDropSession): void;
|
|
6346
|
+
|
|
6347
|
+
|
|
6348
|
+
/**
|
|
6349
|
+
* Invoked by a drop session to obtain a preview for the specified drag item while the session is in
|
|
6350
|
+
* the target view's frame.
|
|
6351
|
+
*
|
|
6352
|
+
* Delegate objects implementing this method may provide an appropriate preview for the
|
|
6353
|
+
* specified item by returning a {@link BMDragPreview} object initialized for the specified
|
|
6354
|
+
* drag item. When this method is not implemented, or when returning `undefined`, the preview
|
|
6355
|
+
* already in use for the item will continue to be used while the session is the target view's frame.
|
|
6356
|
+
* @param session The drop session for which to supply an item preview.
|
|
6357
|
+
* @param item An item that is part of the drop session whose preview
|
|
6358
|
+
* should be provided.
|
|
6359
|
+
* @return If specified, the preview that will be displayed for the item.
|
|
6360
|
+
* If omitted, the current preview will continue to be used.
|
|
6361
|
+
*
|
|
6362
|
+
*/
|
|
6363
|
+
dropSessionPreviewForItem?(session: BMDropSession, item: BMDragItem): BMDragPreview | null | undefined;
|
|
6364
|
+
|
|
6365
|
+
}
|
|
6366
|
+
|
|
6367
|
+
|
|
6368
|
+
/**
|
|
6369
|
+
* A provider that can supply the contents of an item that is part of a drag and drop gesture
|
|
6370
|
+
* in various representations.
|
|
6371
|
+
*
|
|
6372
|
+
*/
|
|
6373
|
+
export interface BMDragItem {
|
|
6374
|
+
|
|
6375
|
+
/**
|
|
6376
|
+
* Invoked to determine whether the contents of this drag item supports being represented
|
|
6377
|
+
* as the specified developer-defined type.
|
|
6378
|
+
* @param type The type being checked.
|
|
6379
|
+
* @return `YES` if the content can be represented as the specified
|
|
6380
|
+
* type, `NO` otherwise.
|
|
6381
|
+
*
|
|
6382
|
+
*/
|
|
6383
|
+
canConformToType(type: string): boolean;
|
|
6384
|
+
|
|
6385
|
+
|
|
6386
|
+
/**
|
|
6387
|
+
* Invoked to obtain the representation of the contents in this drag item converted to the specified
|
|
6388
|
+
* developer-defined type. If `canConformToType` returns `YES` for that type, this method must be able
|
|
6389
|
+
* to return an object of that type.
|
|
6390
|
+
*
|
|
6391
|
+
* Core UI may invoke this method supplying a type of `default` to obtain a representation to use for
|
|
6392
|
+
* legacy APIs. In this case, this method can return any representation, but multiple invocations of
|
|
6393
|
+
* this method with the `default` type must return the same representation.
|
|
6394
|
+
* @param type The type of object to return.
|
|
6395
|
+
* @return An object if the specified type representing this drag item's contents.
|
|
6396
|
+
*
|
|
6397
|
+
*/
|
|
6398
|
+
itemOfType(type: string): unknown;
|
|
6399
|
+
|
|
6400
|
+
}
|
|
6401
|
+
|
|
6402
|
+
|
|
6403
|
+
export class BMDropSessionActionKind {
|
|
6404
|
+
/**
|
|
6405
|
+
* Indicates that this drag session is ignored by the drop target and should be treated
|
|
6406
|
+
* as if the items are simply dragged out of the source view.
|
|
6407
|
+
*
|
|
6408
|
+
*/
|
|
6409
|
+
static Ignore: BMDropSessionActionKind;
|
|
6410
|
+
|
|
6411
|
+
/**
|
|
6412
|
+
* Indicates that the drop target can normally accept items from the source view but none
|
|
6413
|
+
* of the items in the current session are acceptable. Finishing the gesture over the
|
|
6414
|
+
* current drop target should cancel the gesture.
|
|
6415
|
+
*
|
|
6416
|
+
*/
|
|
6417
|
+
static Reject: BMDropSessionActionKind;
|
|
6418
|
+
|
|
6419
|
+
/**
|
|
6420
|
+
* Indicates that the drop target can accept the items in the drag session, but dropping them
|
|
6421
|
+
* will cause the items to be deleted. Requires the source view to specify a `.Move` transfer
|
|
6422
|
+
* for this drag session, otherwise the action reverts to `.Reject`.
|
|
6423
|
+
*
|
|
6424
|
+
*/
|
|
6425
|
+
static Delete: BMDropSessionActionKind;
|
|
6426
|
+
|
|
6427
|
+
/**
|
|
6428
|
+
* Indicates that the drop target can accept all the items in the drag session.
|
|
6429
|
+
*
|
|
6430
|
+
*/
|
|
6431
|
+
static Accept: BMDropSessionActionKind;
|
|
6432
|
+
|
|
6433
|
+
/**
|
|
6434
|
+
* Indicates that the drop target can accept only some of the items in the drag session.
|
|
6435
|
+
* Finishing the gesture will cause the unacceptable items to be discarded.
|
|
6436
|
+
*
|
|
6437
|
+
*/
|
|
6438
|
+
static AcceptPartially: BMDropSessionActionKind;
|
|
6439
|
+
|
|
6440
|
+
private constructor();
|
|
6441
|
+
}
|
|
6442
|
+
|
|
6443
|
+
export class BMDragSessionActionKind {
|
|
6444
|
+
/**
|
|
6445
|
+
* Indicates that dropping the items at the current location will have no additional effect.
|
|
6446
|
+
*
|
|
6447
|
+
*/
|
|
6448
|
+
static Ignore: BMDragSessionActionKind;
|
|
6449
|
+
|
|
6450
|
+
/**
|
|
6451
|
+
* Indicates that ending the drag session at the current location will cause the items to be
|
|
6452
|
+
* deleted.
|
|
6453
|
+
*
|
|
6454
|
+
*/
|
|
6455
|
+
static Delete: BMDragSessionActionKind;
|
|
6456
|
+
|
|
6457
|
+
/**
|
|
6458
|
+
* Indicates that dropping the items at the current location would normally cause an effect,
|
|
6459
|
+
* but that action cannot currently be performed.
|
|
6460
|
+
* Finishing the gesture over the current drop target should cancel the gesture.
|
|
6461
|
+
*
|
|
6462
|
+
*/
|
|
6463
|
+
static Reject: BMDragSessionActionKind;
|
|
6464
|
+
|
|
6465
|
+
private constructor();
|
|
6466
|
+
}
|
|
6467
|
+
|
|
6468
|
+
/**
|
|
6469
|
+
* An object that describes the action that should be performed for a drag or drop
|
|
6470
|
+
* session when it ends.
|
|
6471
|
+
*
|
|
6472
|
+
*/
|
|
6473
|
+
export class _BMDragDropSessionAction {
|
|
6474
|
+
|
|
6475
|
+
/**
|
|
6476
|
+
* The action to perform at the end of the drag session.
|
|
6477
|
+
*
|
|
6478
|
+
*/
|
|
6479
|
+
private _action: BMDragSessionActionKind | BMDropSessionActionKind;
|
|
6480
|
+
|
|
6481
|
+
/**
|
|
6482
|
+
* If specified, the message text to display for this outcome.
|
|
6483
|
+
*
|
|
6484
|
+
*/
|
|
6485
|
+
private _message?: string | null | undefined;
|
|
6486
|
+
|
|
6487
|
+
/**
|
|
6488
|
+
* If specified, the message markup to display for this outcome.
|
|
6489
|
+
*
|
|
6490
|
+
*/
|
|
6491
|
+
private _messageHTML?: string | null | undefined;
|
|
6492
|
+
|
|
6493
|
+
/**
|
|
6494
|
+
* If specified when the action is `.AcceptPartially`, the drag items that are actually acceptable.
|
|
6495
|
+
* If omitted, the UI will not indicate which items are acceptable.
|
|
6496
|
+
*
|
|
6497
|
+
*/
|
|
6498
|
+
private _acceptableItems?: BMDragItem[] | null | undefined;
|
|
6499
|
+
}
|
|
6500
|
+
|
|
6501
|
+
|
|
6502
|
+
/**
|
|
6503
|
+
* An object that represents a preview of a drag item and is displayed during a drag session.
|
|
6504
|
+
*
|
|
6505
|
+
*/
|
|
6506
|
+
export class BMDragPreview {
|
|
6507
|
+
|
|
6508
|
+
/**
|
|
6509
|
+
* The drag item represented by this drag preview.
|
|
6510
|
+
*
|
|
6511
|
+
*/
|
|
6512
|
+
private _dragItem: BMDragItem;
|
|
6513
|
+
|
|
6514
|
+
/**
|
|
6515
|
+
* Initializes this drag preview by creating a copy of the specified source node.
|
|
6516
|
+
* @param node The source node.
|
|
6517
|
+
* @param forItem The drag item for which a preview is created.
|
|
6518
|
+
* @return This drag preview.
|
|
6519
|
+
*
|
|
6520
|
+
*/
|
|
6521
|
+
initWithCopyOfSourceNode(node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
|
|
6522
|
+
|
|
6523
|
+
|
|
6524
|
+
/**
|
|
6525
|
+
* Designated initializer. Initializes this drag preview with the specified preview node
|
|
6526
|
+
* and optionally a source node.
|
|
6527
|
+
* @param node The node representing the preview.
|
|
6528
|
+
* @param forItem The drag item for which a preview is created.
|
|
6529
|
+
* @param sourceNode If specified, the node that the drag item represents.
|
|
6530
|
+
* @return This drag preview.
|
|
6531
|
+
*
|
|
6532
|
+
*/
|
|
6533
|
+
initWithPreviewNode(node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
|
|
6534
|
+
|
|
6535
|
+
|
|
6536
|
+
/**
|
|
6537
|
+
* The source node for which a preview is generated. This is used to run an appropriate animation
|
|
6538
|
+
* from the node corresponding to the drag item when the drag session starts or finishes.
|
|
6539
|
+
*
|
|
6540
|
+
* If the source node is not provided, a generic animation will typically play instead for the preview node.
|
|
6541
|
+
*
|
|
6542
|
+
*/
|
|
6543
|
+
private _sourceNode?: DOMNode | null | undefined;
|
|
6544
|
+
|
|
6545
|
+
/**
|
|
6546
|
+
* The node representing the preview. This node should not be modified while a drag
|
|
6547
|
+
* session is in progress.
|
|
6548
|
+
*
|
|
6549
|
+
*/
|
|
6550
|
+
readonly previewNode: DOMNode;
|
|
6551
|
+
|
|
6552
|
+
/**
|
|
6553
|
+
* When set to `YES`, this indicates that the preview node is an exact copy of the source node
|
|
6554
|
+
* and a transition between the preview and source node is not required.
|
|
6555
|
+
*
|
|
6556
|
+
*/
|
|
6557
|
+
private _isCopyOfSourceNode: boolean;
|
|
6558
|
+
|
|
6559
|
+
/**
|
|
6560
|
+
* The current frame of the drag preview, before any transforms are applied.
|
|
6561
|
+
*
|
|
6562
|
+
*/
|
|
6563
|
+
readonly frame: BMRect;
|
|
6564
|
+
|
|
6565
|
+
/**
|
|
6566
|
+
* Updates this preview's position on screen.
|
|
6567
|
+
* @param position The new position, relative to the center of this preview's frame.
|
|
6568
|
+
*
|
|
6569
|
+
*/
|
|
6570
|
+
private _setPosition(position: BMPoint): void;
|
|
6571
|
+
|
|
6572
|
+
|
|
6573
|
+
/**
|
|
6574
|
+
* Applies the specified frame to the preview node.
|
|
6575
|
+
* @param frame The frame to apply.
|
|
6576
|
+
*
|
|
6577
|
+
*/
|
|
6578
|
+
private _applyFrame(frame: BMRect): void;
|
|
6579
|
+
|
|
6580
|
+
|
|
6581
|
+
/**
|
|
6582
|
+
* A dictionary containing transform property names as keys and their applied values, expressed
|
|
6583
|
+
* in pixels as the value. The contents of object should not be modified while the drag session
|
|
6584
|
+
* is in progress.
|
|
6585
|
+
*
|
|
6586
|
+
*/
|
|
6587
|
+
readonly transform: Dictionary<number>;
|
|
6588
|
+
|
|
6589
|
+
/**
|
|
6590
|
+
* Applies the transform to the preview node.
|
|
6591
|
+
* @param transform The transform dictionary. See {@link BMDragPreview.transform}.
|
|
6592
|
+
*
|
|
6593
|
+
*/
|
|
6594
|
+
private _applyTransform(transform: Dictionary<number>): void;
|
|
6595
|
+
|
|
6596
|
+
|
|
6597
|
+
/**
|
|
6598
|
+
* The total amount of displacement to apply for this preview when rejected.
|
|
6599
|
+
*
|
|
6600
|
+
*/
|
|
6601
|
+
private _rejectionDistance: number;
|
|
6602
|
+
|
|
6603
|
+
/**
|
|
6604
|
+
* Set to YES when this preview is displaced to indicate that it is rejected.
|
|
6605
|
+
*
|
|
6606
|
+
*/
|
|
6607
|
+
private _rejected: boolean;
|
|
6608
|
+
|
|
6609
|
+
/**
|
|
6610
|
+
* Updates the rejection distance to the specified number of pixels. If this preview is
|
|
6611
|
+
* currently rejected, its position will be animated to the new distance.
|
|
6612
|
+
* @param distance The number of pixels to displace this preview by when rejected.
|
|
6613
|
+
*
|
|
6614
|
+
*/
|
|
6615
|
+
private _setRejectionDistance(distance: number): void;
|
|
6616
|
+
|
|
6617
|
+
|
|
6618
|
+
/**
|
|
6619
|
+
* Set to `YES` while this preview is playing the rejection animation.
|
|
6620
|
+
*
|
|
6621
|
+
*/
|
|
6622
|
+
private _rejecting: boolean;
|
|
6623
|
+
|
|
6624
|
+
/**
|
|
6625
|
+
* Updates the rejection state of this drag preview.
|
|
6626
|
+
* @param rejected `YES` if this preview's item is rejected, `NO` otherwise.
|
|
6627
|
+
*
|
|
6628
|
+
*/
|
|
6629
|
+
private _setRejected(rejected: boolean): void;
|
|
6630
|
+
|
|
6631
|
+
|
|
6632
|
+
/**
|
|
6633
|
+
* Set to `YES` while this preview's frame is animating.
|
|
6634
|
+
*
|
|
6635
|
+
*/
|
|
6636
|
+
private _animatingFrame: boolean;
|
|
6637
|
+
|
|
6638
|
+
/**
|
|
6639
|
+
* Set to `YES` after the preview node has been measured.
|
|
6640
|
+
*
|
|
6641
|
+
*/
|
|
6642
|
+
private _measured: boolean;
|
|
6643
|
+
|
|
6644
|
+
/**
|
|
6645
|
+
* Measures the preview node and updates the frame to the measured size.
|
|
6646
|
+
*
|
|
6647
|
+
*/
|
|
6648
|
+
private _measure(): void;
|
|
6649
|
+
|
|
6650
|
+
|
|
6651
|
+
/**
|
|
6652
|
+
* Attaches this drag session preview to the document and applies its frame and transform properties.
|
|
6653
|
+
* @param position If specified, the point at which the preview will be attached,
|
|
6654
|
+
* relative to the viewport.
|
|
6655
|
+
* @param before If specified, a node before which the preview node will be attached.
|
|
6656
|
+
* @return An iterator that must be iterated to sync DOM reads and writes
|
|
6657
|
+
* when multiple previews are attached at the same time.
|
|
6658
|
+
*
|
|
6659
|
+
*/
|
|
6660
|
+
private _attachAtPosition(position?: BMPoint | null | undefined, {before}?: {before?: DOMNode | null | undefined}): Iterator<void>;
|
|
6661
|
+
|
|
6662
|
+
|
|
6663
|
+
/**
|
|
6664
|
+
* Set to the source animation during the lift animation.
|
|
6665
|
+
*
|
|
6666
|
+
*/
|
|
6667
|
+
private _animationSourceNode?: DOMNode | null | undefined;
|
|
6668
|
+
|
|
6669
|
+
/**
|
|
6670
|
+
* Plays the lift animation for this drag preview at the beginning of a drag session or when the associated
|
|
6671
|
+
* item is added to an in-progress drag session.
|
|
6672
|
+
* @return A promise that resolves when the associated animation completes.
|
|
6673
|
+
*
|
|
6674
|
+
*/
|
|
6675
|
+
private _performLift(): Promise<void>;
|
|
6676
|
+
|
|
6677
|
+
|
|
6678
|
+
/**
|
|
6679
|
+
* Set to `YES` if this preview's drop animation is handled by the drop delegate.
|
|
6680
|
+
*
|
|
6681
|
+
*/
|
|
6682
|
+
private _dropHandled: boolean;
|
|
6683
|
+
|
|
6684
|
+
/**
|
|
6685
|
+
* Plays the drop animation for this drag preview at the end of the drag session, if the current
|
|
6686
|
+
* drop target did not handle the drop animation on its own.
|
|
6687
|
+
* @return A promise that resolves when the associated animation completes.
|
|
6688
|
+
*
|
|
6689
|
+
*/
|
|
6690
|
+
private _performDrop(): Promise<void>;
|
|
6691
|
+
|
|
6692
|
+
|
|
6693
|
+
/**
|
|
6694
|
+
* Plays the delete animation for this drag preview at the end of the drag session, if the drop
|
|
6695
|
+
* action was set to `.Delete`.
|
|
6696
|
+
* @return A promise that resolves when the associated animation completes.
|
|
6697
|
+
*
|
|
6698
|
+
*/
|
|
6699
|
+
private _performDelete(): Promise<void>;
|
|
6700
|
+
|
|
6701
|
+
|
|
6702
|
+
/**
|
|
6703
|
+
* If specified, the preview this preview is transitioning from, while the transition
|
|
6704
|
+
* is in progress. `undefined` in all other cases.
|
|
6705
|
+
*
|
|
6706
|
+
*/
|
|
6707
|
+
private _transitionPreview: BMDragPreview;
|
|
6708
|
+
|
|
6709
|
+
/**
|
|
6710
|
+
* A unique identifier for transitions, used to perform the appropriate cleanup at the end
|
|
6711
|
+
* of the transition only when needed.
|
|
6712
|
+
*
|
|
6713
|
+
*/
|
|
6714
|
+
private _transitionUID: number;
|
|
6715
|
+
|
|
6716
|
+
/**
|
|
6717
|
+
* Plays a transition animation from the specified drag preview to this drag preview, when the drag
|
|
6718
|
+
* session transitions to a new drop target. Detaches the specified drag preview from the document
|
|
6719
|
+
* if different from the current one.
|
|
6720
|
+
* @param preview The drag preview from which to play a transition.
|
|
6721
|
+
* @param fromRejectionDistance The reject distance prior to this transition taking place.
|
|
6722
|
+
* @return A promise that resolves when the associated animation completes.
|
|
6723
|
+
*
|
|
6724
|
+
*/
|
|
6725
|
+
private _performTransitionFromDragPreview(preview: BMDragPreview, {fromRejectionDistance}: {fromRejectionDistance: number}): Promise<void>;
|
|
6726
|
+
|
|
6727
|
+
|
|
6728
|
+
/**
|
|
6729
|
+
* Controls whether this drag preview is detachable. Active drag previews are not detachable.
|
|
6730
|
+
*
|
|
6731
|
+
*/
|
|
6732
|
+
private _detachable: boolean;
|
|
6733
|
+
|
|
6734
|
+
/**
|
|
6735
|
+
* Detaches this drag preview from the document and resets its transform to the values of the `_transform` property.
|
|
6736
|
+
* The preview should be reattached to the document using {@link BMDragPreview._attach} before being reused.
|
|
6737
|
+
*
|
|
6738
|
+
*/
|
|
6739
|
+
private _detach(): void;
|
|
6740
|
+
|
|
6741
|
+
|
|
6742
|
+
/**
|
|
6743
|
+
* Creates and returns a drag preview initialized by creating a copy of the specified source node.
|
|
6744
|
+
* @param node The source node.
|
|
6745
|
+
* @param forItem The drag item for which a preview is created.
|
|
6746
|
+
* @return A drag preview.
|
|
6747
|
+
*
|
|
6748
|
+
*/
|
|
6749
|
+
static dragPreviewWithCopyOfSourceNode (node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
|
|
6750
|
+
|
|
6751
|
+
|
|
6752
|
+
/**
|
|
6753
|
+
* Creates and returns a drag preview initialized with the specified preview node and optionally a source node.
|
|
6754
|
+
* @param node The node representing the preview.
|
|
6755
|
+
* @param forItem The drag item for which a preview is created.
|
|
6756
|
+
* @param sourceNode If specified, the node that the drag item represents.
|
|
6757
|
+
* @return A drag preview.
|
|
6758
|
+
*
|
|
6759
|
+
*/
|
|
6760
|
+
static dragPreviewWithPreviewNode (node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
|
|
6761
|
+
|
|
6762
|
+
}
|
|
6763
|
+
|
|
6764
|
+
|
|
6765
|
+
/**
|
|
6766
|
+
* An object that represents a preview of a drag item at the end of a drop session that can be used
|
|
6767
|
+
* by the drop delegate to play an appropriate drop animation for the item. When using the drop preview
|
|
6768
|
+
* to customize the drop animation, it is the responsibility of the drop delegate object to detach
|
|
6769
|
+
* the drop preview at the end of the animation, unless using one of the built-in animations provided
|
|
6770
|
+
* by the drop preview.
|
|
6771
|
+
*
|
|
6772
|
+
* Drop previews should not be created manually. Core UI will automatically create drop previews for
|
|
6773
|
+
* the appropriate items at the end of a drop session if there are items that have been accepted
|
|
6774
|
+
* by the drop target.
|
|
6775
|
+
*
|
|
6776
|
+
*/
|
|
6777
|
+
export class BMDropPreview {
|
|
6778
|
+
|
|
6779
|
+
/**
|
|
6780
|
+
* The original drag preview from which this drop preview was created.
|
|
6781
|
+
*
|
|
6782
|
+
*/
|
|
6783
|
+
private _preview: BMDragPreview;
|
|
6784
|
+
|
|
6785
|
+
/**
|
|
6786
|
+
* The drag item represented by this drop preview.
|
|
6787
|
+
*
|
|
6788
|
+
*/
|
|
6789
|
+
readonly item: BMDragItem;
|
|
6790
|
+
|
|
6791
|
+
/**
|
|
6792
|
+
* Initializes this drop preview with the specified drag preview and drag item.
|
|
6793
|
+
* @param preview The original drag preview.
|
|
6794
|
+
* @param forItem The item represented by this preview.
|
|
6795
|
+
* @return This drop preview.
|
|
6796
|
+
*
|
|
6797
|
+
*/
|
|
6798
|
+
private _initWithDragPreview(preview: BMDragPreview, {forItem}: {forItem: BMDragItem}): BMDropPreview;
|
|
6799
|
+
|
|
6800
|
+
|
|
6801
|
+
/**
|
|
6802
|
+
* The HTML element representing this preview.
|
|
6803
|
+
*
|
|
6804
|
+
*/
|
|
6805
|
+
readonly previewNode: any;
|
|
6806
|
+
|
|
6807
|
+
/**
|
|
6808
|
+
* A rect that describes the current position and size of the preview node relative to the viewport.
|
|
6809
|
+
*
|
|
6810
|
+
*/
|
|
6811
|
+
readonly frame: any;
|
|
6812
|
+
|
|
6813
|
+
/**
|
|
6814
|
+
* An object that describes the transform currently applied to the preview node. Its keys are transform
|
|
6815
|
+
* function names and its values are numbers representing the associated values. The units for the values are:
|
|
6816
|
+
* - `deg` for rotation properties
|
|
6817
|
+
* - `px` for translation properties
|
|
6818
|
+
* - untyped for scale properties
|
|
6819
|
+
*
|
|
6820
|
+
* The rotation transforms are always applied after all other transforms.
|
|
6821
|
+
*
|
|
6822
|
+
*/
|
|
6823
|
+
readonly transform: any;
|
|
6824
|
+
|
|
6825
|
+
/**
|
|
6826
|
+
* Plays a generic drop animation for this drop preview. This method must be invoked while an animation context is active.
|
|
6827
|
+
* When the animation finishes this drag preview is detached from the document.
|
|
6828
|
+
*
|
|
6829
|
+
*/
|
|
6830
|
+
performDrop(): void;
|
|
6831
|
+
|
|
6832
|
+
|
|
6833
|
+
/**
|
|
6834
|
+
* Plays a drop animation that visually transforms this drop preview into the specified node. This method must be invoked
|
|
6835
|
+
* while an animation context is active. When the animation finishes this drag preview is detached from the document.
|
|
6836
|
+
* @param node The node towards which to play the drop animation.
|
|
6837
|
+
*
|
|
6838
|
+
*/
|
|
6839
|
+
performDropToNode(node: DOMNode): void;
|
|
6840
|
+
|
|
6841
|
+
}
|
|
6842
|
+
|
|
6843
|
+
|
|
6844
|
+
export class _BMDragIndicatorOrientation {
|
|
6845
|
+
/**
|
|
6846
|
+
* Indicates that the drag indicator should appear on the top left corner.
|
|
6847
|
+
*
|
|
6848
|
+
*/
|
|
6849
|
+
static Left: _BMDragIndicatorOrientation;
|
|
6850
|
+
|
|
6851
|
+
/**
|
|
6852
|
+
* Indicates that the drag indicator should appear on the top right corner.
|
|
6853
|
+
*
|
|
6854
|
+
*/
|
|
6855
|
+
static Right: _BMDragIndicatorOrientation;
|
|
6856
|
+
|
|
6857
|
+
private constructor();
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
/**
|
|
6861
|
+
* An object that manages the indicator that appears during a drag and drop gesture.
|
|
6862
|
+
*
|
|
6863
|
+
*/
|
|
6864
|
+
export class _BMDragIndicator {
|
|
6865
|
+
|
|
6866
|
+
/**
|
|
6867
|
+
* The number of items that are acceptable for the current drop target. This should be equal to
|
|
6868
|
+
* or lower than the total number of items in this drag session.
|
|
6869
|
+
*
|
|
6870
|
+
*/
|
|
6871
|
+
private _acceptableItemCount: number;
|
|
6872
|
+
|
|
6873
|
+
/**
|
|
6874
|
+
* The node containing the indicator.
|
|
6875
|
+
*
|
|
6876
|
+
*/
|
|
6877
|
+
private _containerNode: DOMNode;
|
|
6878
|
+
|
|
6879
|
+
/**
|
|
6880
|
+
* The node displaying the item count, drop outcome and message.
|
|
6881
|
+
*
|
|
6882
|
+
*/
|
|
6883
|
+
private _indicatorNode: DOMNode;
|
|
6884
|
+
|
|
6885
|
+
/**
|
|
6886
|
+
* The node displaying the icon associated with the current drop icon.
|
|
6887
|
+
*
|
|
6888
|
+
*/
|
|
6889
|
+
private _iconNode: DOMNode;
|
|
6890
|
+
|
|
6891
|
+
/**
|
|
6892
|
+
* The HTML element representing the message displayed to the user.
|
|
6893
|
+
*
|
|
6894
|
+
*/
|
|
6895
|
+
private _messageNode: DOMNode;
|
|
6896
|
+
|
|
6897
|
+
/**
|
|
6898
|
+
* The HTML element used to measure the message text.
|
|
6899
|
+
*
|
|
6900
|
+
*/
|
|
6901
|
+
private _messageMeasurementNode: DOMNode;
|
|
6902
|
+
|
|
6903
|
+
/**
|
|
6904
|
+
* The message text currently displayed on the drag indicator.
|
|
6905
|
+
*
|
|
6906
|
+
*/
|
|
6907
|
+
private _message?: string | null | undefined;
|
|
6908
|
+
|
|
6909
|
+
/**
|
|
6910
|
+
* The message HTML markup currently displayed on the drag indicator.
|
|
6911
|
+
*
|
|
6912
|
+
*/
|
|
6913
|
+
private _message?: string | null | undefined;
|
|
6914
|
+
|
|
6915
|
+
/**
|
|
6916
|
+
* The kind of action displayed on the indicator.
|
|
6917
|
+
*
|
|
6918
|
+
*/
|
|
6919
|
+
private _dropActionKind: BMDragSessionActionKind | BMDropSessionActionKind;
|
|
6920
|
+
|
|
6921
|
+
/**
|
|
6922
|
+
* Initializes this drag indicator and attaches it to the document.
|
|
6923
|
+
* @return This drag indicator.
|
|
6924
|
+
*
|
|
6925
|
+
*/
|
|
6926
|
+
init(): _BMDragIndicator;
|
|
6927
|
+
|
|
6928
|
+
|
|
6929
|
+
/**
|
|
6930
|
+
* Updates the contents of this drag indicator using the details of the specified
|
|
6931
|
+
* drag or drop action.
|
|
6932
|
+
* @param action The action.
|
|
6933
|
+
*
|
|
6934
|
+
*/
|
|
6935
|
+
setAction(action: BMDragSessionAction | BMDropSessionAction): void;
|
|
6936
|
+
|
|
6937
|
+
|
|
6938
|
+
/**
|
|
6939
|
+
* The offset between the drag pointer and the center of this drag indicator.
|
|
6940
|
+
*
|
|
6941
|
+
*/
|
|
6942
|
+
private _offset: BMPoint;
|
|
6943
|
+
|
|
6944
|
+
/**
|
|
6945
|
+
* The unique sequence identifier of the current offset animation.
|
|
6946
|
+
*
|
|
6947
|
+
*/
|
|
6948
|
+
private _offsetAnimationID: number;
|
|
6949
|
+
|
|
6950
|
+
/**
|
|
6951
|
+
* Updates the offset of the indicator from the pointer's position.
|
|
6952
|
+
* @param offset The new offset to use.
|
|
6953
|
+
* @param animated Defaults to `NO`. When set to `YES` this change will be
|
|
6954
|
+
* animated, otherwise it will be instant.
|
|
6955
|
+
*
|
|
6956
|
+
*/
|
|
6957
|
+
setOffset(offset: BMPoint, {animated}?: {animated?: boolean | null | undefined}): void;
|
|
6958
|
+
|
|
6959
|
+
|
|
6960
|
+
/**
|
|
6961
|
+
* The current position of the drag session, relative to the viewport.
|
|
6962
|
+
*
|
|
6963
|
+
*/
|
|
6964
|
+
private _position: BMPoint;
|
|
6965
|
+
|
|
6966
|
+
/**
|
|
6967
|
+
* Updates the position of the drag gesture and all the drag previews.
|
|
6968
|
+
* @param position The new position.
|
|
6969
|
+
*
|
|
6970
|
+
*/
|
|
6971
|
+
setPosition(position: BMPoint): void;
|
|
6972
|
+
|
|
6973
|
+
|
|
6974
|
+
/**
|
|
6975
|
+
* Updates the drop action displayed on the drag indicator.
|
|
6976
|
+
* @param action The new drop action to display.
|
|
6977
|
+
*
|
|
6978
|
+
*/
|
|
6979
|
+
private _setDropActionKind(action: _BMDragDropSessionAction): void;
|
|
6980
|
+
|
|
6981
|
+
|
|
6982
|
+
/**
|
|
6983
|
+
* Updates the item count displayed on the drag indicator.
|
|
6984
|
+
* @param count The new item count to display.
|
|
6985
|
+
*
|
|
6986
|
+
*/
|
|
6987
|
+
setAcceptableItemCount(count: number): void;
|
|
6988
|
+
|
|
6989
|
+
|
|
6990
|
+
/**
|
|
6991
|
+
* Updates the message currently displayed on the drag indicator.
|
|
6992
|
+
* @param message The message to display, or `undefined` to not show any message.
|
|
6993
|
+
*
|
|
6994
|
+
*/
|
|
6995
|
+
private _setMessage(message?: string | null | undefined): void;
|
|
6996
|
+
|
|
6997
|
+
|
|
6998
|
+
/**
|
|
6999
|
+
* Updates the message currently displayed on the drag indicator using the specified HTML text.
|
|
7000
|
+
* @param message The message HTML to display, or `undefined` to not show any message.
|
|
7001
|
+
*
|
|
7002
|
+
*/
|
|
7003
|
+
private _setMessageHTML(message?: string | null | undefined): void;
|
|
7004
|
+
|
|
7005
|
+
|
|
7006
|
+
/**
|
|
7007
|
+
* Plays the lift animation for this drag indicator.
|
|
7008
|
+
* @return A promise that resolves when the animation completes.
|
|
7009
|
+
*
|
|
7010
|
+
*/
|
|
7011
|
+
performLift(): Promise<void>;
|
|
7012
|
+
|
|
7013
|
+
|
|
7014
|
+
/**
|
|
7015
|
+
* Plays the drop animation for this drag indicator.
|
|
7016
|
+
* @return A promise that resolves when the animation completes.
|
|
7017
|
+
*
|
|
7018
|
+
*/
|
|
7019
|
+
performDrop(): Promise<void>;
|
|
7020
|
+
|
|
7021
|
+
|
|
7022
|
+
/**
|
|
7023
|
+
* Detaches this drag indicator from the document.
|
|
7024
|
+
* The drag indicator should not be reused after this method returns.
|
|
7025
|
+
*
|
|
7026
|
+
*/
|
|
7027
|
+
release(): void;
|
|
7028
|
+
|
|
7029
|
+
}
|
|
7030
|
+
|
|
7031
|
+
|
|
7032
|
+
/**
|
|
7033
|
+
* An object that manages the appearance, position and animations of the preview elements
|
|
7034
|
+
* for items included in a drag session and the drag indicator.
|
|
7035
|
+
*
|
|
7036
|
+
*/
|
|
7037
|
+
export class _BMDragPreviewSet {
|
|
7038
|
+
|
|
7039
|
+
/**
|
|
7040
|
+
* The offset between the drag pointer and the center of the frames of the preview elements.
|
|
7041
|
+
*
|
|
7042
|
+
*/
|
|
7043
|
+
private _offset: BMPoint;
|
|
7044
|
+
|
|
7045
|
+
/**
|
|
7046
|
+
* The current position of the drag session.
|
|
7047
|
+
*
|
|
7048
|
+
*/
|
|
7049
|
+
private _position: BMPoint;
|
|
7050
|
+
|
|
7051
|
+
/**
|
|
7052
|
+
* The indicator displaying information about the associated drag session.
|
|
7053
|
+
*
|
|
7054
|
+
*/
|
|
7055
|
+
private _dragIndicator: _BMDragIndicator;
|
|
7056
|
+
|
|
7057
|
+
/**
|
|
7058
|
+
* A mapping between drag items and their associated drag previews.
|
|
7059
|
+
*
|
|
7060
|
+
*/
|
|
7061
|
+
private _dragPreviews: Map<BMDragItem, BMDragPreview>;
|
|
5403
7062
|
|
|
5404
7063
|
/**
|
|
5405
|
-
*
|
|
5406
|
-
* When this property is set to `YES`, if there are any suggestions obtained from the delegate object, the matching ones will appear
|
|
5407
|
-
* as a drop down below the text field. The text field will automatically select the first matching suggestion and fill it in if the user
|
|
5408
|
-
* presses the `return` key.
|
|
5409
|
-
*
|
|
5410
|
-
* When this property is set to `NO`, suggestions will be unavailable. This will also disable auto completion.
|
|
7064
|
+
* A mapping between drag items and the drag previews provided initially for each.
|
|
5411
7065
|
*
|
|
5412
7066
|
*/
|
|
5413
|
-
|
|
7067
|
+
private _baseDragPreviews: Map<BMDragItem, BMDragPreview>;
|
|
5414
7068
|
|
|
5415
7069
|
/**
|
|
5416
|
-
*
|
|
7070
|
+
* A set that controls which items appear as rejected.
|
|
5417
7071
|
*
|
|
5418
7072
|
*/
|
|
5419
|
-
|
|
7073
|
+
private _rejectedItems: Set<BMDragItem>;
|
|
5420
7074
|
|
|
5421
7075
|
/**
|
|
5422
|
-
*
|
|
7076
|
+
* The total displacement to apply to rejected previews.
|
|
5423
7077
|
*
|
|
5424
7078
|
*/
|
|
5425
|
-
|
|
7079
|
+
private _rejectionDistance: number;
|
|
5426
7080
|
|
|
5427
7081
|
/**
|
|
5428
|
-
*
|
|
7082
|
+
* Initializes this drag preview set with the specified item previews and offset position.
|
|
7083
|
+
* @param previews The previews for items in the drag session.
|
|
7084
|
+
* @param pointerOffset The offset between the drag pointer and the
|
|
7085
|
+
* center of the frames of the preview elements.
|
|
7086
|
+
* @return This preview set.
|
|
5429
7087
|
*
|
|
5430
7088
|
*/
|
|
5431
|
-
|
|
7089
|
+
initWithPreviews(previews: BMDragPreview[], {pointerOffset}: {pointerOffset: BMPoint}): _BMDragPreviewSet;
|
|
7090
|
+
|
|
5432
7091
|
|
|
5433
7092
|
/**
|
|
5434
|
-
*
|
|
7093
|
+
* An additional preview to display when all items are rejected.
|
|
5435
7094
|
*
|
|
5436
7095
|
*/
|
|
5437
|
-
private
|
|
7096
|
+
private _additionalPreview?: BMDragPreview | null | undefined;
|
|
5438
7097
|
|
|
5439
7098
|
/**
|
|
5440
|
-
*
|
|
7099
|
+
* Displays the specified additional preview, or clears it.
|
|
7100
|
+
* @param preview The additional preview to display, or `undefined` to
|
|
7101
|
+
* clear the additional preview.
|
|
5441
7102
|
*
|
|
5442
7103
|
*/
|
|
5443
|
-
|
|
7104
|
+
setAdditionalPreview(preview?: BMDragPreview | null | undefined): void;
|
|
7105
|
+
|
|
5444
7106
|
|
|
5445
7107
|
/**
|
|
5446
|
-
*
|
|
7108
|
+
* Updates the position of the drag gesture and all the drag previews.
|
|
7109
|
+
* @param position The new position.
|
|
5447
7110
|
*
|
|
5448
7111
|
*/
|
|
5449
|
-
|
|
7112
|
+
setPosition(position: BMPoint): void;
|
|
7113
|
+
|
|
5450
7114
|
|
|
5451
7115
|
/**
|
|
5452
|
-
*
|
|
7116
|
+
* Causes the previews for the specified items to appear as rejected. All other items will
|
|
7117
|
+
* appear as acceptable even if they had been previously set as rejected using this method.
|
|
7118
|
+
* @param items The items that should appear as rejected,
|
|
7119
|
+
* or `undefined` to clear the rejected items.
|
|
5453
7120
|
*
|
|
5454
7121
|
*/
|
|
5455
|
-
|
|
7122
|
+
setRejectedItems(items?: BMDragItem[] | null | undefined): void;
|
|
7123
|
+
|
|
5456
7124
|
|
|
5457
7125
|
/**
|
|
5458
|
-
*
|
|
7126
|
+
* Attaches the drag previews and plays their lift animations.
|
|
7127
|
+
* @param position The position of the drag session.
|
|
5459
7128
|
*
|
|
5460
7129
|
*/
|
|
5461
|
-
|
|
7130
|
+
beginLiftAtPosition(position: BMPoint): void;
|
|
5462
7131
|
|
|
5463
7132
|
|
|
5464
7133
|
/**
|
|
5465
|
-
*
|
|
7134
|
+
* Updates or resets the previews for the specified items using a map.
|
|
7135
|
+
* @param previews The drag previews to use, or `undefined` to reset it for each item.
|
|
5466
7136
|
*
|
|
5467
7137
|
*/
|
|
5468
|
-
|
|
7138
|
+
updatePreviewsWithMap(previews: Map<BMDragItem, BMDragPreview | undefined>): void;
|
|
5469
7139
|
|
|
5470
7140
|
|
|
5471
7141
|
/**
|
|
5472
|
-
*
|
|
5473
|
-
* @param label The text to display in the menu item.
|
|
5474
|
-
* @param action An action that occurs when the menu item is selected.
|
|
5475
|
-
* @return A DOM node to be added to a menu.
|
|
7142
|
+
* Determines the rejection distance based on the size of all current previews.
|
|
5476
7143
|
*
|
|
5477
7144
|
*/
|
|
5478
|
-
private
|
|
7145
|
+
private _updateRejectionDistance(): void;
|
|
5479
7146
|
|
|
5480
7147
|
|
|
5481
7148
|
/**
|
|
5482
|
-
*
|
|
5483
|
-
* @param point The point at which to show the menu.
|
|
5484
|
-
* @param withOptions The options that the menu should display.
|
|
5485
|
-
* @param kind Defaults to .Menu. The kind of menu to show.
|
|
5486
|
-
* @return The menu element.
|
|
7149
|
+
* The orientation of the drag indicator relative to the top edge of the drag previews.
|
|
5487
7150
|
*
|
|
5488
7151
|
*/
|
|
5489
|
-
private
|
|
7152
|
+
private readonly _indicatorOrientation: any;
|
|
7153
|
+
|
|
7154
|
+
/**
|
|
7155
|
+
* Updates the orientation of the drag indicator. If the orientation changes as a result
|
|
7156
|
+
* of this method, the change will be animated.
|
|
7157
|
+
* @param orientation The new orientation to use.
|
|
7158
|
+
*
|
|
7159
|
+
*/
|
|
7160
|
+
private _setIndicatorOrientation(orientation: _BMDragIndicatorOrientation): void;
|
|
5490
7161
|
|
|
5491
7162
|
|
|
5492
7163
|
/**
|
|
5493
|
-
*
|
|
5494
|
-
*
|
|
5495
|
-
*
|
|
7164
|
+
* The offset the indicator would use if the orientation was set to `.Right`.
|
|
7165
|
+
*
|
|
5496
7166
|
*/
|
|
5497
|
-
|
|
7167
|
+
private _indicatorOffsetRight: number;
|
|
7168
|
+
|
|
7169
|
+
/**
|
|
7170
|
+
* Updates the drag indicator offset from the drag session's position based on the size
|
|
7171
|
+
* and scale of the first displayed item preview.
|
|
7172
|
+
* The offset for the indicator is set such that it will appear to the top left of
|
|
7173
|
+
* the first preview.
|
|
7174
|
+
* @param animated Defaults to `YES`. Whether this change is animated.
|
|
7175
|
+
*
|
|
7176
|
+
*/
|
|
7177
|
+
private _updateDragIndicatorOffsetAnimated(animated?: boolean | null | undefined): void;
|
|
5498
7178
|
|
|
5499
7179
|
|
|
5500
7180
|
/**
|
|
5501
|
-
*
|
|
5502
|
-
*
|
|
5503
|
-
* @return A text field.
|
|
5504
|
-
*
|
|
7181
|
+
* Plays the drop animation for the current drag previews, then detaches them.
|
|
7182
|
+
*
|
|
5505
7183
|
*/
|
|
5506
|
-
|
|
7184
|
+
performDrop(): void;
|
|
5507
7185
|
|
|
5508
7186
|
}
|
|
5509
7187
|
|
|
@@ -10558,6 +12236,12 @@ export class BMCollectionViewFlowLayout extends BMCollectionViewLayout {
|
|
|
10558
12236
|
*/
|
|
10559
12237
|
pinsFootersToContentEdge: boolean;
|
|
10560
12238
|
|
|
12239
|
+
/**
|
|
12240
|
+
* Set to `YES` while the current layout is using scrollbar offsets, `NO` otherwise.
|
|
12241
|
+
*
|
|
12242
|
+
*/
|
|
12243
|
+
private _usingScrollbarOffset: boolean;
|
|
12244
|
+
|
|
10561
12245
|
/**
|
|
10562
12246
|
* Prepares the layout, optionally taking the scrollbar size into account.
|
|
10563
12247
|
* @param useOffset When set to `YES` the layout will take the scrollbar size into account.
|
|
@@ -11222,6 +12906,41 @@ export class BMCollectionViewAcceptPolicy {
|
|
|
11222
12906
|
private constructor();
|
|
11223
12907
|
}
|
|
11224
12908
|
|
|
12909
|
+
export class BMCollectionViewAcceptRegion {
|
|
12910
|
+
/**
|
|
12911
|
+
* Indicates that the drop session will have the same drop action regardless of where
|
|
12912
|
+
* in the collection view's frame it is.
|
|
12913
|
+
*
|
|
12914
|
+
*/
|
|
12915
|
+
static Anywhere: BMCollectionViewAcceptRegion;
|
|
12916
|
+
|
|
12917
|
+
/**
|
|
12918
|
+
* Indicates that the drop session's drop action changes based on the cell in which the
|
|
12919
|
+
* drop occurs. Drops outside of any cell's frame are rejected. The delegate object is
|
|
12920
|
+
* expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidEnterCell} method
|
|
12921
|
+
* provide the appropriate drop action for each cell.
|
|
12922
|
+
*
|
|
12923
|
+
*/
|
|
12924
|
+
static Cell: BMCollectionViewAcceptRegion;
|
|
12925
|
+
|
|
12926
|
+
/**
|
|
12927
|
+
* Indicates the drop session's drop action depends on the specific position in which the drop occurs.
|
|
12928
|
+
* The delegate object is expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidUpdate}
|
|
12929
|
+
* method to provide the appropriate action as the drop session's position updates.
|
|
12930
|
+
*
|
|
12931
|
+
*/
|
|
12932
|
+
static Position: BMCollectionViewAcceptRegion;
|
|
12933
|
+
|
|
12934
|
+
/**
|
|
12935
|
+
* Indicates that the collection view cannot process the session's items and no further updates will
|
|
12936
|
+
* be provided regarding this drop session.
|
|
12937
|
+
*
|
|
12938
|
+
*/
|
|
12939
|
+
static Nowhere: BMCollectionViewAcceptRegion;
|
|
12940
|
+
|
|
12941
|
+
private constructor();
|
|
12942
|
+
}
|
|
12943
|
+
|
|
11225
12944
|
|
|
11226
12945
|
|
|
11227
12946
|
/**
|
|
@@ -11320,7 +13039,7 @@ export class BMCollectionViewScrollingDirection {
|
|
|
11320
13039
|
}
|
|
11321
13040
|
|
|
11322
13041
|
/**
|
|
11323
|
-
* Controls the final horizontal scrolling position of a
|
|
13042
|
+
* Controls the final horizontal scrolling position of a programmatic scroll.
|
|
11324
13043
|
*
|
|
11325
13044
|
*/
|
|
11326
13045
|
export class BMCollectionViewScrollingGravityHorizontal {
|
|
@@ -11346,7 +13065,7 @@ export class BMCollectionViewScrollingGravityHorizontal {
|
|
|
11346
13065
|
}
|
|
11347
13066
|
|
|
11348
13067
|
/**
|
|
11349
|
-
* Controls the final vertical scrolling position of a
|
|
13068
|
+
* Controls the final vertical scrolling position of a programmatic scroll.
|
|
11350
13069
|
*
|
|
11351
13070
|
*/
|
|
11352
13071
|
export class BMCollectionViewScrollingGravityVertical {
|
|
@@ -11397,7 +13116,7 @@ export class BMCollectionViewScrollingGravityVertical {
|
|
|
11397
13116
|
*
|
|
11398
13117
|
*
|
|
11399
13118
|
*/
|
|
11400
|
-
export class BMCollectionView<T = any> extends BMView {
|
|
13119
|
+
export class BMCollectionView<T = any> extends BMView implements BMDragDelegate, BMDropDelegate {
|
|
11401
13120
|
|
|
11402
13121
|
/**
|
|
11403
13122
|
* The last measured intrinsic size for this collection view.
|
|
@@ -12088,11 +13807,139 @@ export class BMCollectionView<T = any> extends BMView {
|
|
|
12088
13807
|
* @param items An array of items.
|
|
12089
13808
|
* @param toIndexPath The suggested index path at which to add the items.
|
|
12090
13809
|
* @param withDropShadows A map containing the link between drop shadows and the items.
|
|
13810
|
+
* @return A promise that resolves when the associated data update
|
|
13811
|
+
* has completed.
|
|
13812
|
+
*
|
|
13813
|
+
*/
|
|
13814
|
+
private _insertItems(items: any[], {toIndexPath, withDropShadows}: {toIndexPath: BMIndexPath<T>, withDropShadows: Map<any, DOMNode>}): Promise<void>;
|
|
13815
|
+
|
|
13816
|
+
|
|
13817
|
+
/**
|
|
13818
|
+
* An array containing the cells whose index paths are part of the current drag session, or
|
|
13819
|
+
* `undefined` while there is no drag session in progress for this collection view.
|
|
13820
|
+
*
|
|
13821
|
+
*/
|
|
13822
|
+
private _draggingCells?: BMCollectionViewCell[] | null | undefined;
|
|
13823
|
+
|
|
13824
|
+
/**
|
|
13825
|
+
* A map that keeps track of the association between drag items in a drag session and the cells
|
|
13826
|
+
* whose items they represent.
|
|
13827
|
+
*
|
|
13828
|
+
*/
|
|
13829
|
+
private _cellItemMap: Map<BMDragItem, BMCollectionViewCell>;
|
|
13830
|
+
|
|
13831
|
+
/**
|
|
13832
|
+
* Begins a drag gesture from the specified event. The drag event will move the cell from which
|
|
13833
|
+
* the event originates, or all selected cells if that cell is selected.
|
|
13834
|
+
* @param event The event triggering this action.
|
|
13835
|
+
* @param forCell The cell from which this event originates.
|
|
13836
|
+
* @param touchIdentifier If this event is a `TouchEvent`, this represents the identifier
|
|
13837
|
+
* of the touch point that will control this drag & drop operation.
|
|
13838
|
+
*
|
|
13839
|
+
*/
|
|
13840
|
+
beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
|
|
13841
|
+
|
|
13842
|
+
|
|
13843
|
+
/**
|
|
13844
|
+
* Creates and returns a fallback drag item for the specified index path if the data source
|
|
13845
|
+
* object cannot provide a customized drag item.
|
|
13846
|
+
* @param indexPath The index path for which to return a drag item.
|
|
13847
|
+
* @return A drag item;
|
|
13848
|
+
*
|
|
13849
|
+
*/
|
|
13850
|
+
private _defaultDragItemForIndexPath(indexPath: BMIndexPath): BMDragItem;
|
|
13851
|
+
|
|
13852
|
+
|
|
13853
|
+
/**
|
|
13854
|
+
* The current drag action to use based on the current drag position.
|
|
13855
|
+
*
|
|
13856
|
+
*/
|
|
13857
|
+
private _dragAction?: BMDragSessionAction | null | undefined;
|
|
13858
|
+
|
|
13859
|
+
/**
|
|
13860
|
+
* Set to `YES` while a drag session started by this collection view is in its frame.
|
|
13861
|
+
*
|
|
13862
|
+
*/
|
|
13863
|
+
private _dragSessionInFrame: boolean;
|
|
13864
|
+
|
|
13865
|
+
/**
|
|
13866
|
+
* The amount by which to scroll on the Y axis during the current drag session.
|
|
13867
|
+
*
|
|
13868
|
+
*/
|
|
13869
|
+
private _dragScrollDirectionY: number;
|
|
13870
|
+
|
|
13871
|
+
/**
|
|
13872
|
+
* The amount by which to scroll on the X axis during the current drag session.
|
|
13873
|
+
*
|
|
13874
|
+
*/
|
|
13875
|
+
private _dragScrollDirectionX: number;
|
|
13876
|
+
|
|
13877
|
+
/**
|
|
13878
|
+
* Whenever the pointer moves to the edges of this collection view during a drag session,
|
|
13879
|
+
* this method periodically scrolls the collection view's contents appropriately.
|
|
13880
|
+
*
|
|
13881
|
+
*/
|
|
13882
|
+
private _dragScroll(): void;
|
|
13883
|
+
|
|
13884
|
+
|
|
13885
|
+
/**
|
|
13886
|
+
* The identifier of the animation frame callback used to scroll this collection during a drag session while the
|
|
13887
|
+
* mouse pointer
|
|
13888
|
+
*
|
|
13889
|
+
*/
|
|
13890
|
+
private _scrollFrameIdentifier?: number | null | undefined;
|
|
13891
|
+
|
|
13892
|
+
/**
|
|
13893
|
+
* The kind of region being tracked during a drop session. `undefined` if a drop session is
|
|
13894
|
+
* not in progress.
|
|
13895
|
+
*
|
|
13896
|
+
*/
|
|
13897
|
+
private _dropSessionRegionKind?: BMCollectionViewAcceptRegion | null | undefined;
|
|
13898
|
+
|
|
13899
|
+
/**
|
|
13900
|
+
* The current drop action to use based on the current drop session position.
|
|
13901
|
+
*
|
|
13902
|
+
*/
|
|
13903
|
+
private _dropAction?: BMDropSessionAction | null | undefined;
|
|
13904
|
+
|
|
13905
|
+
/**
|
|
13906
|
+
* The index path associated with the current drop session, if any.
|
|
13907
|
+
*
|
|
13908
|
+
*/
|
|
13909
|
+
private _dropIndexPath?: BMIndexPath | null | undefined;
|
|
13910
|
+
|
|
13911
|
+
/**
|
|
13912
|
+
* Returns the position of the specified drag or drop session relative to the collection view's bounds.
|
|
13913
|
+
* @param session The drag or drop session.
|
|
13914
|
+
* @return The coordinates relative to the bounds.
|
|
13915
|
+
*
|
|
13916
|
+
*/
|
|
13917
|
+
positionOfDragSession(session: BMDragSession | BMDropSession): BMPoint;
|
|
13918
|
+
|
|
13919
|
+
|
|
13920
|
+
/**
|
|
13921
|
+
* Determines the index path at the specified point whose coordinates are relative to the bounds.
|
|
13922
|
+
* @param point The point.
|
|
13923
|
+
* @return The index path, if any cell's frame intersects the point,
|
|
13924
|
+
* or `undefined` otherwise.
|
|
12091
13925
|
*
|
|
12092
13926
|
*/
|
|
12093
|
-
|
|
13927
|
+
indexPathAtPoint(point: BMPoint): BMIndexPath | null | undefined;
|
|
12094
13928
|
|
|
12095
13929
|
|
|
13930
|
+
/**
|
|
13931
|
+
* The most recent index path the current drop session has been over.
|
|
13932
|
+
*
|
|
13933
|
+
*/
|
|
13934
|
+
private _lastDropIndexPath: BMIndexPath;
|
|
13935
|
+
|
|
13936
|
+
/**
|
|
13937
|
+
* The drop previews that must be animated at the end of a successful drop session. Only set while performing
|
|
13938
|
+
* the data update associated with accepting items via a drop session.
|
|
13939
|
+
*
|
|
13940
|
+
*/
|
|
13941
|
+
private _dropPreviews?: BMDropPreview[] | null | undefined;
|
|
13942
|
+
|
|
12096
13943
|
/**
|
|
12097
13944
|
* Begins a drag gesture from the given event. The drag event will move the cell from which
|
|
12098
13945
|
* the event originates.
|
|
@@ -12102,7 +13949,7 @@ export class BMCollectionView<T = any> extends BMView {
|
|
|
12102
13949
|
* of the touch point that will control this drag & drop operation.
|
|
12103
13950
|
*
|
|
12104
13951
|
*/
|
|
12105
|
-
|
|
13952
|
+
private _beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
|
|
12106
13953
|
|
|
12107
13954
|
|
|
12108
13955
|
/**
|
|
@@ -12301,7 +14148,7 @@ export class BMCollectionView<T = any> extends BMView {
|
|
|
12301
14148
|
* Invoked when an arrow is pressed while this collection view has keyboard focus.
|
|
12302
14149
|
* Highlights the index path to the specified direction of the currently highlighted index path.
|
|
12303
14150
|
* @param arrow The key code of the keyboard arrow that was pressed.
|
|
12304
|
-
* @param withEvent The event that
|
|
14151
|
+
* @param withEvent The event that triggered this action.
|
|
12305
14152
|
*
|
|
12306
14153
|
*/
|
|
12307
14154
|
keyboardArrowPressed(arrow: string, {withEvent}: {withEvent: KeyboardEvent}): void;
|
|
@@ -12437,6 +14284,20 @@ export class BMCollectionView<T = any> extends BMView {
|
|
|
12437
14284
|
*/
|
|
12438
14285
|
readonly dataUpdated?: Promise<void> | null | undefined;
|
|
12439
14286
|
|
|
14287
|
+
/**
|
|
14288
|
+
* Finds and returns the drop preview associated with the specified layout attributes, if any exists.
|
|
14289
|
+
* @param attributes Tha attributes for which to find the drop preview.
|
|
14290
|
+
* @param previewMap
|
|
14291
|
+
* An optional mapping between index paths and drop items
|
|
14292
|
+
* used to find the drop preview for the item representation
|
|
14293
|
+
* that the data set actually inserted. The default item
|
|
14294
|
+
* representation will be used if this is not provided.
|
|
14295
|
+
* @return The drop preview if it was found, `undefined` otherwise.
|
|
14296
|
+
*
|
|
14297
|
+
*/
|
|
14298
|
+
private _dropPreviewForLayoutAttributes(attributes: BMCollectionViewLayoutAttributes, {previewMap}?: {previewMap?: Map<BMIndexPath<T>, BMDropPreview> | null | undefined}): BMDropPreview | null | undefined;
|
|
14299
|
+
|
|
14300
|
+
|
|
12440
14301
|
/**
|
|
12441
14302
|
* Should be invoked when the entire data set is updated in bulk.
|
|
12442
14303
|
* This method should be invoked when the data set object has access to the new data;
|
|
@@ -12818,11 +14679,12 @@ export interface BMCollectionViewDataSet<T = any> {
|
|
|
12818
14679
|
* For collection views that support moving items, this method must be implemented by the data sets these collection views
|
|
12819
14680
|
* use. In this case, data sets that don't support moving items may simply return `NO` from this method.
|
|
12820
14681
|
* @param indexPath The item's current index path.
|
|
12821
|
-
* @param toIndexPath
|
|
12822
|
-
* @
|
|
14682
|
+
* @param toIndexPath The index path to which the item should move.
|
|
14683
|
+
* @param session The drag session through which this change was performed.
|
|
14684
|
+
* @return `YES` if the data set has performed the requested change, `NO` otherwise.
|
|
12823
14685
|
*
|
|
12824
14686
|
*/
|
|
12825
|
-
moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T
|
|
14687
|
+
moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
|
|
12826
14688
|
|
|
12827
14689
|
|
|
12828
14690
|
/**
|
|
@@ -12836,14 +14698,15 @@ export interface BMCollectionViewDataSet<T = any> {
|
|
|
12836
14698
|
* `moveItemFromIndexPath(_, {toIndexPath})` passing in each of the items that need to be moved.
|
|
12837
14699
|
* @param indexPaths An array of index paths identifying which items have to be moved.
|
|
12838
14700
|
* @param toIndexPath The starting index path to which the items should move. This represents the index path of the current layout
|
|
12839
|
-
* before any items may have moved. It is the data set's
|
|
14701
|
+
* before any items may have moved. It is the data set's responsibility to adjust this index path as the items shift
|
|
12840
14702
|
* within its data structure.
|
|
12841
|
-
* @
|
|
14703
|
+
* @param session The drag session through which this change was performed.
|
|
14704
|
+
* @return An array of index paths specifying the positions of the items after they have been moved.
|
|
12842
14705
|
* The index paths in this array are not required to match either of the lists supplied by
|
|
12843
|
-
*
|
|
14706
|
+
* collection view.
|
|
12844
14707
|
*
|
|
12845
14708
|
*/
|
|
12846
|
-
moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T
|
|
14709
|
+
moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
|
|
12847
14710
|
|
|
12848
14711
|
|
|
12849
14712
|
/**
|
|
@@ -12853,10 +14716,12 @@ export interface BMCollectionViewDataSet<T = any> {
|
|
|
12853
14716
|
* Optionally, data sets may reject the change and not perform any action or only partially accept the update
|
|
12854
14717
|
* and remove just some of the items, by changing their internal data structures appropriately.
|
|
12855
14718
|
* The order of the items in the array is guaranteed to be such that the target index paths are in ascending order.
|
|
12856
|
-
* @param indexPaths
|
|
14719
|
+
* @param indexPaths An array of index paths identifying which items have to be removed.
|
|
14720
|
+
* @param session The drag session through which this change was performed, if it occurred
|
|
14721
|
+
* through a drag and drop gesture.
|
|
12857
14722
|
*
|
|
12858
14723
|
*/
|
|
12859
|
-
removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[]): void;
|
|
14724
|
+
removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
|
|
12860
14725
|
|
|
12861
14726
|
|
|
12862
14727
|
/**
|
|
@@ -12865,14 +14730,49 @@ export interface BMCollectionViewDataSet<T = any> {
|
|
|
12865
14730
|
* the items, then trigger a data update to run on the collection view.
|
|
12866
14731
|
* Optionally, data sets may reject the change and not perform any action or only partially accept the update
|
|
12867
14732
|
* and add just some of the items, by changing their internal data structures appropriately.
|
|
12868
|
-
* @param items
|
|
12869
|
-
*
|
|
14733
|
+
* @param items An array of objects to add to the collection view, using the default representation
|
|
14734
|
+
* of the items in the drop session. Additional representations, if needed, can be obtained
|
|
14735
|
+
* from the drop session.
|
|
14736
|
+
* @param toIndexPath The starting index path to which the items should be inserted.
|
|
14737
|
+
* @param session The drop session through which this change was performed, if it occurred
|
|
14738
|
+
* through a drag and drop gesture.
|
|
14739
|
+
* @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
|
|
14740
|
+
*
|
|
14741
|
+
*/
|
|
14742
|
+
insertItems?(items: any[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session?: BMDropSession | null | undefined}): Promise<void> | void;
|
|
14743
|
+
|
|
14744
|
+
|
|
14745
|
+
/**
|
|
14746
|
+
* Invoked by collection after a successful transfer via a drop session to determine the index path associated
|
|
14747
|
+
* with the specified drag item during the associated data update. Data set objects which implement this method
|
|
14748
|
+
* should return the index path associated with the appropriate representation of the specified drag item that
|
|
14749
|
+
* was accepted through the drop session.
|
|
14750
|
+
* @param item The drag item for which to obtain the associated index path.
|
|
14751
|
+
* @return The associated index path if it could be determined, `undefined` otherwise.
|
|
14752
|
+
*
|
|
14753
|
+
*/
|
|
14754
|
+
indexPathForDragItem?(item: BMDragItem): BMIndexPath<T> | null | undefined;
|
|
14755
|
+
|
|
14756
|
+
|
|
14757
|
+
/**
|
|
14758
|
+
* This method should be implemented by data set objects that support transferring items via drag and drop
|
|
14759
|
+
* to create the drag items that will be part of a drag session.
|
|
14760
|
+
*
|
|
14761
|
+
* Data set objects implementing this method should return a drag item for the specified index path with
|
|
14762
|
+
* the appropriate representations that potential drop targets can verify to determine if they can accept
|
|
14763
|
+
* the items being transferred through the session.
|
|
14764
|
+
* @param indexPath The index path for which to create a drag item.
|
|
14765
|
+
* @param session The drag session that will be used to transfer the items.
|
|
14766
|
+
* @return The drag item.
|
|
12870
14767
|
*
|
|
12871
14768
|
*/
|
|
12872
|
-
|
|
14769
|
+
dragItemForIndexPath?(indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
|
|
12873
14770
|
|
|
12874
14771
|
|
|
12875
14772
|
/**
|
|
14773
|
+
* @deprecated Not used if `dragItemForIndexPath` is implemented.
|
|
14774
|
+
*
|
|
14775
|
+
* ------
|
|
12876
14776
|
* This method may be implemented by data set objects that support transferring items to another collection view.
|
|
12877
14777
|
* Data set objects implementing this method are expected to create a copy of the specified item and return it.
|
|
12878
14778
|
* The item is guaranteed to be an object that was returned at some point by the data set when it provided an index path.
|
|
@@ -13007,10 +14907,11 @@ export interface BMCollectionViewDataSource<T = any> {
|
|
|
13007
14907
|
* @param collectionView The collection view that is moving the item.
|
|
13008
14908
|
* @param indexPath The item's current index path.
|
|
13009
14909
|
* @param toIndexPath The index path to which the item should move.
|
|
14910
|
+
* @param session The drag session through which this change was performed.
|
|
13010
14911
|
* @return `YES` if the data set has performed the requested change, `NO` otherwise.
|
|
13011
14912
|
*
|
|
13012
14913
|
*/
|
|
13013
|
-
collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T
|
|
14914
|
+
collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
|
|
13014
14915
|
|
|
13015
14916
|
|
|
13016
14917
|
/**
|
|
@@ -13027,12 +14928,13 @@ export interface BMCollectionViewDataSource<T = any> {
|
|
|
13027
14928
|
* @param toIndexPath The starting index path to which the items should move. This represents the index path of the current layout
|
|
13028
14929
|
* before any items may have moved. It is the data source's responsibility to adjust this index path as the items shift
|
|
13029
14930
|
* within its data structure.
|
|
14931
|
+
* @param session The drag session through which this change was performed.
|
|
13030
14932
|
* @return An array of index paths specifying the positions of the items after they have been moved.
|
|
13031
14933
|
* The index paths in this array are not required to match either of the lists supplied by
|
|
13032
14934
|
* collection view.
|
|
13033
14935
|
*
|
|
13034
14936
|
*/
|
|
13035
|
-
collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T
|
|
14937
|
+
collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
|
|
13036
14938
|
|
|
13037
14939
|
|
|
13038
14940
|
/**
|
|
@@ -13044,9 +14946,11 @@ export interface BMCollectionViewDataSource<T = any> {
|
|
|
13044
14946
|
* The order of the items in the array is guaranteed to be such that the target index paths are in ascending order.
|
|
13045
14947
|
* @param collectionView The collection view that is removing the items.
|
|
13046
14948
|
* @param indexPaths An array of index paths identifying which items have to be removed.
|
|
14949
|
+
* @param session If this change occurred via a drag session, the session through which
|
|
14950
|
+
* the items were removed.
|
|
13047
14951
|
*
|
|
13048
14952
|
*/
|
|
13049
|
-
collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[]): void;
|
|
14953
|
+
collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
|
|
13050
14954
|
|
|
13051
14955
|
|
|
13052
14956
|
/**
|
|
@@ -13056,15 +14960,56 @@ export interface BMCollectionViewDataSource<T = any> {
|
|
|
13056
14960
|
* this method returns for the appropriate animation to play on the items being transferred.
|
|
13057
14961
|
* Optionally, data sources may reject the change and not perform any action or only partially accept the update
|
|
13058
14962
|
* and add just some of the items, by changing their internal data structures appropriately.
|
|
13059
|
-
* @param collectionView
|
|
13060
|
-
* @param items
|
|
13061
|
-
*
|
|
14963
|
+
* @param collectionView The collection view into which items are being inserted.
|
|
14964
|
+
* @param items An array of objects to add to the collection view. If this change
|
|
14965
|
+
* occurred trough a drop session, this represents the default representation
|
|
14966
|
+
* of the drag items.
|
|
14967
|
+
* @param toIndexPath The starting index path to which the items should be inserted.
|
|
14968
|
+
* @param session The drop session through which this change was performed, if this
|
|
14969
|
+
* occurred via a drag and drop gesture.
|
|
14970
|
+
* @param indexPaths
|
|
14971
|
+
* If the data set inserted a different representation of the items than the default,
|
|
14972
|
+
* this map must be filled out with the new index paths associated with each item in
|
|
14973
|
+
* the drop session that was actually inserted.
|
|
14974
|
+
* @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
|
|
13062
14975
|
*
|
|
13063
14976
|
*/
|
|
13064
|
-
collectionViewInsertItems?(collectionView: BMCollectionView, items: any[], {toIndexPath}: {toIndexPath: BMIndexPath<T
|
|
14977
|
+
collectionViewInsertItems?(collectionView: BMCollectionView, items: any[], {toIndexPath, session, indexPaths}: {toIndexPath: BMIndexPath<T>, session?: BMDropSession | null | undefined, indexPaths?: Map<BMDragItem, BMIndexPath<T>> | null | undefined}): Promise<void> | void;
|
|
14978
|
+
|
|
14979
|
+
|
|
14980
|
+
/**
|
|
14981
|
+
* This method should be implemented by data source objects that support transferring items via drag and drop
|
|
14982
|
+
* to create the drag items that will be part of a drag session.
|
|
14983
|
+
*
|
|
14984
|
+
* Data source objects implementing this method should return a drag item for the specified index path with
|
|
14985
|
+
* the appropriate representations that potential drop targets can verify to determine if they can accept
|
|
14986
|
+
* the items being transferred through the session.
|
|
14987
|
+
* @param collectionView The collection view that started the dragging session.
|
|
14988
|
+
* @param indexPath The index path for which to create a drag item.
|
|
14989
|
+
* @param session The drag session that will be used to transfer the items.
|
|
14990
|
+
* @return The drag item.
|
|
14991
|
+
*
|
|
14992
|
+
*/
|
|
14993
|
+
collectionViewDragItemForIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
|
|
14994
|
+
|
|
14995
|
+
|
|
14996
|
+
/**
|
|
14997
|
+
* Invoked by collection after a successful transfer via a drop session to determine the index path associated
|
|
14998
|
+
* with the specified drag item during the associated data update. Data source objects which implement this method
|
|
14999
|
+
* should return the index path associated with the appropriate representation of the specified drag item that
|
|
15000
|
+
* was accepted through the drop session.
|
|
15001
|
+
* @param collectionView The collection view that accepted items from a drop session.
|
|
15002
|
+
* @param item The drag item for which to obtain the associated index path.
|
|
15003
|
+
* @return The associated index path if it could be determined, `undefined` otherwise.
|
|
15004
|
+
*
|
|
15005
|
+
*/
|
|
15006
|
+
collectionViewIndexPathForDragItem?(collectionView: BMCollectionView, item: BMDragItem): BMIndexPath<T> | null | undefined;
|
|
13065
15007
|
|
|
13066
15008
|
|
|
13067
15009
|
/**
|
|
15010
|
+
* @deprecated Not used if `dragItemForIndexPath` is implemented.
|
|
15011
|
+
*
|
|
15012
|
+
* ------
|
|
13068
15013
|
* This method may be implemented by data source objects that support transferring items to another collection view.
|
|
13069
15014
|
* Data source objects implementing this method are expected to create a copy of the specified item and return it.
|
|
13070
15015
|
* The item is guaranteed to be an object that was returned at some point by the data set when it provided an index path.
|
|
@@ -13166,7 +15111,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13166
15111
|
|
|
13167
15112
|
/**
|
|
13168
15113
|
* Invoked by the collection view whenever any cell should be selected to determine whether that selection is allowed.
|
|
13169
|
-
* The
|
|
15114
|
+
* The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
|
|
13170
15115
|
* You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
|
|
13171
15116
|
* If this method is not implemented by the delegate object, the collection view will assume that the cell may be selected.
|
|
13172
15117
|
* @param collectionView The calling collection view.
|
|
@@ -13190,7 +15135,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13190
15135
|
|
|
13191
15136
|
/**
|
|
13192
15137
|
* Invoked by the collection view whenever any cell should be deselected to determine whether that selection is allowed.
|
|
13193
|
-
* The
|
|
15138
|
+
* The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
|
|
13194
15139
|
* You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
|
|
13195
15140
|
* If this method is not implemented by the delegate object, the collection view will assume that the cell may be deselected.
|
|
13196
15141
|
* @param collectionView The calling collection view.
|
|
@@ -13325,8 +15270,8 @@ export interface BMCollectionViewDelegate {
|
|
|
13325
15270
|
* Invoked by the collection view whenever any cell is clicked or tapped. Delegate objects can implement this method to react
|
|
13326
15271
|
* to cell click or tap events.
|
|
13327
15272
|
* Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
|
|
13328
|
-
* and prevent the default actions from
|
|
13329
|
-
* By default, when returning NO or nothing from this method, the collection view will
|
|
15273
|
+
* and prevent the default actions from occurring.
|
|
15274
|
+
* By default, when returning NO or nothing from this method, the collection view will toggle the selection state of the clicked cell.
|
|
13330
15275
|
* @param collectionView The calling collection view.
|
|
13331
15276
|
* @param cell The cell that triggered this event.
|
|
13332
15277
|
* @param withEvent The event that triggered this action.
|
|
@@ -13340,7 +15285,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13340
15285
|
* Invoked by the collection view whenever any cell is double clicked or double tapped. Delegate objects can implement this method to react
|
|
13341
15286
|
* to cell click or tap events.
|
|
13342
15287
|
* Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
|
|
13343
|
-
* and prevent the default actions from
|
|
15288
|
+
* and prevent the default actions from occurring.
|
|
13344
15289
|
* @param collectionView The calling collection view.
|
|
13345
15290
|
* @param cell The cell that triggered this event.
|
|
13346
15291
|
* @param withEvent The event that triggered this action.
|
|
@@ -13354,7 +15299,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13354
15299
|
* Invoked by the collection view whenever any cell is long clicked or long tapped. Delegate objects can implement this method to react
|
|
13355
15300
|
* to cell click or tap events.
|
|
13356
15301
|
* Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
|
|
13357
|
-
* and prevent the default actions from
|
|
15302
|
+
* and prevent the default actions from occurring.
|
|
13358
15303
|
* @param collectionView The calling collection view.
|
|
13359
15304
|
* @param cell The cell that triggered this event.
|
|
13360
15305
|
* @param withEvent The event that triggered this action.
|
|
@@ -13368,7 +15313,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13368
15313
|
* Invoked by the collection view whenever any cell is right clicked. Delegate objects can implement this method to react
|
|
13369
15314
|
* to cell click events.
|
|
13370
15315
|
* Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
|
|
13371
|
-
* and prevent the default actions from
|
|
15316
|
+
* and prevent the default actions from occurring.
|
|
13372
15317
|
* By default, when returning NO or nothing from this method, the browser's default context menu will appear.
|
|
13373
15318
|
* @param collectionView The calling collection view.
|
|
13374
15319
|
* @param cell The cell that triggered this event.
|
|
@@ -13420,7 +15365,7 @@ export interface BMCollectionViewDelegate {
|
|
|
13420
15365
|
|
|
13421
15366
|
/**
|
|
13422
15367
|
* Invoked by the collection view immediately before starting an interactive drag gesture for a cell.
|
|
13423
|
-
* Delegate objects can implement this method to perform any changes that might be needed to
|
|
15368
|
+
* Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
|
|
13424
15369
|
* @param collectionView The calling collection view.
|
|
13425
15370
|
* @param cell The cell that is about to be dragged.
|
|
13426
15371
|
* @param atIndexPath The cell's current index path.
|
|
@@ -13436,81 +15381,217 @@ export interface BMCollectionViewDelegate {
|
|
|
13436
15381
|
* If this method is not implemented, collection view will assume that items cannot be transferred.
|
|
13437
15382
|
* @param collectionView The calling collection view.
|
|
13438
15383
|
* @param indexPaths The index paths that may be transferred by the drag gesture.
|
|
15384
|
+
* @param session The drag session through which the items may be transferred.
|
|
13439
15385
|
* @return `YES` if the index paths can be removed, `NO` otherwise.
|
|
13440
15386
|
*
|
|
13441
15387
|
*/
|
|
13442
|
-
collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
|
|
15388
|
+
collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
|
|
13443
15389
|
|
|
13444
15390
|
|
|
13445
15391
|
/**
|
|
13446
|
-
* Invoked by collection view to determine
|
|
13447
|
-
*
|
|
15392
|
+
* Invoked by collection view to determine whether the items at the specified index paths may be reordered as
|
|
15393
|
+
* a result of a drag and drop gesture.
|
|
15394
|
+
*
|
|
15395
|
+
* Delegate objects may implement this method and return `YES` to allow items to be reordered during the drag
|
|
15396
|
+
* and drop gesture or `NO` to prevent this behaviour. **The default return value is assumed to be `YES` when
|
|
15397
|
+
* this method is not implemented.**
|
|
15398
|
+
* @param collectionView The collection view that started the drag session.
|
|
15399
|
+
* @param indexPaths The index paths of the items that are part of the drag session.
|
|
15400
|
+
* @param session The drag session through which the items are reordered.
|
|
15401
|
+
* @return `YES` if the items can be moved, `NO` otherwise.
|
|
15402
|
+
*
|
|
15403
|
+
*/
|
|
15404
|
+
collectionViewCanReorderItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
|
|
15405
|
+
|
|
15406
|
+
|
|
15407
|
+
/**
|
|
15408
|
+
* Invoked by collection view to determine how to handle the transfer of the items at the specified index paths to
|
|
15409
|
+
* a different view.
|
|
13448
15410
|
* @param collectionView The calling collection view.
|
|
13449
15411
|
* @param indexPaths The index paths that will be transferred by the drag gesture.
|
|
15412
|
+
* @param session The drag session through which the items are transferred.
|
|
13450
15413
|
* @return The desired accept policy.
|
|
13451
15414
|
*
|
|
13452
15415
|
*/
|
|
13453
|
-
collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): BMCollectionViewTransferPolicy;
|
|
15416
|
+
collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): BMCollectionViewTransferPolicy;
|
|
13454
15417
|
|
|
13455
15418
|
|
|
13456
15419
|
/**
|
|
13457
15420
|
* Invoked by collection view to determine if the given items may be imported from another collection view.
|
|
15421
|
+
*
|
|
13458
15422
|
* Delegate object can implement this method to let collection view know whether or not it can import the items.
|
|
13459
15423
|
* If this method is not implemented, collection view will assume that items cannot be imported.
|
|
13460
|
-
* @param collectionView
|
|
13461
|
-
* @param items
|
|
13462
|
-
*
|
|
15424
|
+
* @param collectionView The calling collection view.
|
|
15425
|
+
* @param items The items that might be imported, using the default representation
|
|
15426
|
+
* supplied by the item provider. The actual item providers can be obtained
|
|
15427
|
+
* from the drop session.
|
|
15428
|
+
* @param session The associated drop session.
|
|
15429
|
+
* @return `YES` if the items can be imported, `NO` if they can not
|
|
15430
|
+
* or an accept region to further customize how the items can be
|
|
15431
|
+
* imported from the source view.
|
|
15432
|
+
*
|
|
15433
|
+
*/
|
|
15434
|
+
collectionViewCanAcceptItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): boolean | BMCollectionViewAcceptRegion;
|
|
15435
|
+
|
|
15436
|
+
|
|
15437
|
+
/**
|
|
15438
|
+
* Invoked by collection view to obtain a preview element for the specified drop session item.
|
|
15439
|
+
*
|
|
15440
|
+
* Delegate objects may optionally implement and return an element to customize the appearance of
|
|
15441
|
+
* the specified element when the drop session enters the collection view's frame.
|
|
15442
|
+
* @param collectionView The collection view.
|
|
15443
|
+
* @param session The drop session.
|
|
15444
|
+
* @param item The item for which to return a preview.
|
|
15445
|
+
* @return A preview for the item, or `undefined` to retain the
|
|
15446
|
+
* preview supplied by the view that started the drag session.
|
|
15447
|
+
*
|
|
15448
|
+
*/
|
|
15449
|
+
collectionViewPreviewForDropSession?(collectionView: BMCollectionView, session: BMDropSession, {item}: {item: BMDragItem}): DOMNode | null | undefined;
|
|
15450
|
+
|
|
15451
|
+
|
|
15452
|
+
/**
|
|
15453
|
+
* Invoked by collection view at the start of a drag and drop gesture when the accept region was set to `.Anywhere` or
|
|
15454
|
+
* `YES` was returned from `collectionViewCanAcceptItems`.
|
|
15455
|
+
*
|
|
15456
|
+
* Delegate objects implementing this method should provide the drop action that will be used for this drop session.
|
|
15457
|
+
* A default action of kind `.Accept` is used when this method is not implemented.
|
|
15458
|
+
* @param collectionView The collection view for which the drop session started.
|
|
15459
|
+
* @param session The drop session that started.
|
|
15460
|
+
* @return The drop action to use.
|
|
15461
|
+
*
|
|
15462
|
+
*/
|
|
15463
|
+
collectionViewDropActionForDropSession?(collectionView: BMCollectionView, session: BMDropSession): BMDropAction;
|
|
15464
|
+
|
|
15465
|
+
|
|
15466
|
+
/**
|
|
15467
|
+
* Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` in
|
|
15468
|
+
* `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position.
|
|
15469
|
+
*
|
|
15470
|
+
* Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
|
|
15471
|
+
* ending the session at its current position, or `undefined` to retain the previous action.
|
|
15472
|
+
* @param collectionView The collection view the drop session is tracking.
|
|
15473
|
+
* @param session The drop session.
|
|
15474
|
+
* @param position The position of the drop session relative to the collection view's bounds.
|
|
15475
|
+
* @return The new drop action, or `undefined` to retain the current action.
|
|
15476
|
+
*
|
|
15477
|
+
*/
|
|
15478
|
+
collectionViewDropSessionDidUpdate?(collectionView: BMCollectionView, session: BMDropSession, {position}: {position: BMPoint}): BMDropSessionAction | null | undefined;
|
|
15479
|
+
|
|
15480
|
+
|
|
15481
|
+
/**
|
|
15482
|
+
* Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
|
|
15483
|
+
* `.Cell` in `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position
|
|
15484
|
+
* when the gesture enters the frame of the cell at the specified index path.
|
|
15485
|
+
*
|
|
15486
|
+
* Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
|
|
15487
|
+
* ending the session at its current position, or `undefined` to retain the previous action.
|
|
15488
|
+
* @param collectionView The collection view the drop session is tracking.
|
|
15489
|
+
* @param session The drop session.
|
|
15490
|
+
* @param indexPath The index path of the cell the drag and drop gesture has entered.
|
|
15491
|
+
* @return The new drop action, or `undefined` to retain the current action.
|
|
15492
|
+
*
|
|
15493
|
+
*/
|
|
15494
|
+
collectionViewDropSessionDidEnterIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): BMDropSessionAction | null | undefined;
|
|
15495
|
+
|
|
15496
|
+
|
|
15497
|
+
/**
|
|
15498
|
+
* Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
|
|
15499
|
+
* `.Cell` in `collectionViewCanAcceptItems` when the gesture exits the frame of the cell at the specified index path.
|
|
15500
|
+
*
|
|
15501
|
+
* If the accept region was set to `.Cell` in `collectionViewCanAcceptItems`, collection view will automatically update
|
|
15502
|
+
* the drop session to ignore the drop. If the accept region was set to `.Position`, `collectionViewDropSessionDidUpdate`
|
|
15503
|
+
* will be subsequently invoked to obtain a new drop action.
|
|
15504
|
+
*
|
|
15505
|
+
* Delegate objects can optionally implement this method to perform any necessary cleanup if the drop session is no
|
|
15506
|
+
* longer acceptable outside of any cell.
|
|
15507
|
+
* @param collectionView The collection view the drop session is tracking.
|
|
15508
|
+
* @param session The drop session.
|
|
15509
|
+
* @param indexPath The index path of the cell the drag and drop gesture has entered.
|
|
15510
|
+
*
|
|
15511
|
+
*/
|
|
15512
|
+
collectionViewDropSessionDidExitIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): void;
|
|
15513
|
+
|
|
15514
|
+
|
|
15515
|
+
/**
|
|
15516
|
+
* Invoked by collection when a drop session is about to finish, regardless of its outcome.
|
|
15517
|
+
*
|
|
15518
|
+
* Delegate objects can optionally implement this method to perform any cleanup.
|
|
15519
|
+
* @param collectionView The collection view for which the drop session is ending.
|
|
15520
|
+
* @param session The drop session that will end.
|
|
13463
15521
|
*
|
|
13464
15522
|
*/
|
|
13465
|
-
|
|
15523
|
+
collectionViewDropSessionWillFinish?(collectionView: BMCollectionView, session: BMDropSession): void;
|
|
13466
15524
|
|
|
13467
15525
|
|
|
13468
15526
|
/**
|
|
13469
15527
|
* Invoked by collection view to determine how to handle the import of the given items from a different
|
|
13470
15528
|
* collection view.
|
|
13471
15529
|
* @param collectionView The calling collection view.
|
|
13472
|
-
* @param items The items that might be imported
|
|
15530
|
+
* @param items The items that might be imported, using the default representation
|
|
15531
|
+
* supplied by the item provider. The actual item providers can be obtained
|
|
15532
|
+
* from the drop session.
|
|
15533
|
+
* @param session The associated drop session.
|
|
13473
15534
|
* @return The desired accept policy.
|
|
13474
15535
|
*
|
|
13475
15536
|
*/
|
|
13476
|
-
collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[]): BMCollectionViewAcceptPolicy;
|
|
15537
|
+
collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): BMCollectionViewAcceptPolicy;
|
|
13477
15538
|
|
|
13478
15539
|
|
|
13479
15540
|
/**
|
|
13480
15541
|
* Invoked by collection view to determine if the items at the specified index paths may be removed by an interactive
|
|
13481
15542
|
* drag gesture.
|
|
15543
|
+
*
|
|
13482
15544
|
* Delegate object can implement this method to let collection view know whether or not it can remove the items.
|
|
13483
15545
|
* If this method is not implemented, collection view will assume that items cannot be removed.
|
|
13484
15546
|
* @param collectionView The calling collection view.
|
|
13485
15547
|
* @param indexPaths The index paths that may be removed by the drag gesture.
|
|
15548
|
+
* @param session The associated drag session.
|
|
13486
15549
|
* @return `YES` if the index paths can be removed, `NO` otherwise.
|
|
13487
15550
|
*
|
|
13488
15551
|
*/
|
|
13489
|
-
collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
|
|
15552
|
+
collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): boolean;
|
|
15553
|
+
|
|
15554
|
+
|
|
15555
|
+
/**
|
|
15556
|
+
* Invoked by collection view to determine what message to display for a drag session that will delete
|
|
15557
|
+
* the items at the specified index paths.
|
|
15558
|
+
*
|
|
15559
|
+
* Delegate object can implement this method to provide a customized message that will be displayed to
|
|
15560
|
+
* the user while the drag session is in progress. The default message that will be displayed when this
|
|
15561
|
+
* method is not implemented is `"Remove"`.
|
|
15562
|
+
* @param collectionView The calling collection view.
|
|
15563
|
+
* @param indexPaths The index paths that may be removed by the drag gesture.
|
|
15564
|
+
* @param session The associated drag session.
|
|
15565
|
+
* @return The message to display.
|
|
15566
|
+
*
|
|
15567
|
+
*/
|
|
15568
|
+
collectionDeleteMessageForIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): string;
|
|
13490
15569
|
|
|
13491
15570
|
|
|
13492
15571
|
/**
|
|
13493
15572
|
* Invoked by the collection view immediately before a drag gesture is about to end for a cell. This is invoked before any
|
|
13494
15573
|
* associated animations begin.
|
|
13495
|
-
* Delegate objects can implement this method to perform any changes that might be needed to
|
|
15574
|
+
* Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
|
|
13496
15575
|
* @param collectionView The calling collection view.
|
|
13497
15576
|
* @param cell The cell that is about to be dragged.
|
|
13498
15577
|
* @param atIndexPath The cell's new index path.
|
|
15578
|
+
* @param session The drag session managing the interactive movement.
|
|
13499
15579
|
*
|
|
13500
15580
|
*/
|
|
13501
|
-
collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
|
|
15581
|
+
collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
|
|
13502
15582
|
|
|
13503
15583
|
|
|
13504
15584
|
/**
|
|
13505
15585
|
* Invoked by the collection view immediately after a drag gesture has ended for a cell. This is invoked after any
|
|
13506
15586
|
* associated animations end.
|
|
13507
|
-
* Delegate objects can implement this method to perform any changes that might be needed to
|
|
15587
|
+
* Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
|
|
13508
15588
|
* @param collectionView The calling collection view.
|
|
13509
15589
|
* @param cell The cell that is about to be dragged.
|
|
13510
15590
|
* @param atIndexPath The cell's new index path.
|
|
15591
|
+
* @param session The drag session managing the interactive movement.
|
|
13511
15592
|
*
|
|
13512
15593
|
*/
|
|
13513
|
-
collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
|
|
15594
|
+
collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
|
|
13514
15595
|
|
|
13515
15596
|
}
|
|
13516
15597
|
|
|
@@ -13919,6 +16000,18 @@ export class BMWindow extends BMView {
|
|
|
13919
16000
|
*/
|
|
13920
16001
|
readonly toolbar: DOMNode;
|
|
13921
16002
|
|
|
16003
|
+
/**
|
|
16004
|
+
* Defined for non-modal windows. The drag handle used to resize the window.
|
|
16005
|
+
*
|
|
16006
|
+
*/
|
|
16007
|
+
private _dragHandle: DOMNode;
|
|
16008
|
+
|
|
16009
|
+
/**
|
|
16010
|
+
* Controls whether the window resize handle appears.
|
|
16011
|
+
*
|
|
16012
|
+
*/
|
|
16013
|
+
resizable: boolean;
|
|
16014
|
+
|
|
13922
16015
|
/**
|
|
13923
16016
|
* The window overlay.
|
|
13924
16017
|
*
|