bm-core-ui 2.9.0 → 2.9.1

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.
@@ -5532,7 +5532,7 @@ BMCollectionView.prototype = BMExtend(BM_COLLECTION_VIEW_USE_BMVIEW_SUBCLASS ? O
5532
5532
  if (self._droppedShadows) {
5533
5533
  self._droppedShadows.forEach(shadow => {
5534
5534
  if (shadow.transform) {
5535
- BMHook(shadow.node, {rotateZ: shadow.rotation});
5535
+ BMHook(shadow.node, {rotateZ: shadow.rotation + 'deg', translateX: '0px', translateY: '0px'});
5536
5536
  let controller = BMAnimationContextGetCurrent().controllerForObject(shadow, {node: shadow.node});
5537
5537
  controller.registerBuiltInProperty('translateX', {withValue: shadow.transform.origin.x + 'px'});
5538
5538
  controller.registerBuiltInProperty('translateY', {withValue: shadow.transform.origin.y + 'px'});
@@ -5542,7 +5542,7 @@ BMCollectionView.prototype = BMExtend(BM_COLLECTION_VIEW_USE_BMVIEW_SUBCLASS ? O
5542
5542
  controller.registerBuiltInProperty('opacity', {withValue: 0});
5543
5543
  }
5544
5544
  else {
5545
- BMHook(shadow.node, {rotateZ: shadow.rotation});
5545
+ BMHook(shadow.node, {rotateZ: shadow.rotation + 'deg'});
5546
5546
  let controller = BMAnimationContextGetCurrent().controllerForObject(shadow, {node: shadow.node});
5547
5547
  controller.registerBuiltInProperty('scaleX', {withValue: .33});
5548
5548
  controller.registerBuiltInProperty('scaleY', {withValue: .33});
@@ -0,0 +1,101 @@
1
+ //@ts-check
2
+
3
+ //@type BMViewShadow
4
+
5
+ import { BMCopyProperties, YES } from "../Core/BMCoreUI";
6
+ import { BMRectMakeWithNodeFrame } from "../Core/BMRect";
7
+
8
+ /**
9
+ * A view shadow represents a copy of a view's DOM nodes, without any event handlers attached
10
+ * that is always positioned absolutely. View shadows are created by invoking `retainShadow` on a view
11
+ * and are typically used for animations where it is needed for the view to move outside of its
12
+ * container.
13
+ *
14
+ * A view may only have a single shadow active at a time.
15
+ */
16
+ export class BMViewShadow {
17
+
18
+ /**
19
+ * The DOM node rendered by this view shadow.
20
+ */
21
+ _node; // <DOMNode>
22
+
23
+ get node() {
24
+ return this._node;
25
+ }
26
+
27
+ /**
28
+ * Animatable. The view shadow's frame, relative to the viewport.
29
+ */
30
+ _frame; // <BMRect>
31
+
32
+ get frame() {
33
+ return this._frame;
34
+ }
35
+
36
+ set frame(frame) {
37
+ this._frame = frame.copy();
38
+
39
+ BMCopyProperties(this._node, {
40
+ left: `${frame.left}px`,
41
+ top: `${frame.top}px`,
42
+ width: `${frame.width}px`,
43
+ height: `${frame.height}px`
44
+ });
45
+ }
46
+
47
+ /**
48
+ * The shadow's retain count.
49
+ */
50
+ _retainCount = 0; // <Number>
51
+
52
+ /**
53
+ * Initializes this view shadow by copying the DOM content of
54
+ * the specified view.
55
+ * @param view <BMView> The view whose DOM content should be copied.
56
+ * @returns <BMViewShadow> This view shadow.
57
+ */
58
+ initWithView(view) {
59
+ this._node = view.node.copy(YES);
60
+
61
+ this._node.classList.add('BMViewShadow');
62
+
63
+ // Make this node shadow occupy the same position as the original node
64
+ const frame = BMRectMakeWithNodeFrame(view.node);
65
+
66
+ // In scrolling containers, the view may often get cut off, which will cause
67
+ // incorrect sizes to be reported by the bounding client rect
68
+ frame.size.width = view.node.offsetWidth;
69
+ frame.size.height = view.node.offsetHeight;
70
+
71
+ this.frame = frame;
72
+ }
73
+
74
+ /**
75
+ * Retains this view shadow, increasing its retain count by 1.
76
+ *
77
+ * This method must be invoked before this view shadow is used as part of any animation
78
+ * or interaction. When it is no longer needed, the implementation should invoke the
79
+ * `release` method.
80
+ */
81
+ retain() {
82
+ this._retainCount++;
83
+ }
84
+
85
+ /**
86
+ * Releases this view shadow, decreasing its retain count by 1.
87
+ *
88
+ * This method must be invoked whenever this view shadow is no longer needed.
89
+ * When the retain count reaches 0, this view shadow will be removed from the document.
90
+ */
91
+ release() {
92
+ this._retainCount--;
93
+
94
+ if (!this._retainCount) {
95
+ this._node.remove();
96
+ }
97
+ }
98
+
99
+ }
100
+
101
+ //@endtype
@@ -447,7 +447,12 @@ IScroll.prototype = {
447
447
  return;
448
448
  }
449
449
 
450
- if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
450
+ if (
451
+ this.options.preventDefault &&
452
+ !utils.isBadAndroid &&
453
+ !utils.preventDefaultException(e.target, this.options.preventDefaultException) &&
454
+ !e.target.classList.contains('BMCollectionViewCellEventHandler') && !e.target.parentNode.classList.contains('BMCollectionViewCellEventHandler')
455
+ ) {
451
456
  e.preventDefault();
452
457
  }
453
458
 
@@ -597,7 +602,10 @@ IScroll.prototype = {
597
602
  return;
598
603
  }
599
604
 
600
- if ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {
605
+ if (
606
+ this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) &&
607
+ !e.target.classList.contains('BMCollectionViewCellEventHandler') && !e.target.parentNode.classList.contains('BMCollectionViewCellEventHandler')
608
+ ) {
601
609
  e.preventDefault();
602
610
  }
603
611