aboutsummaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts
diff options
context:
space:
mode:
authorYuanHu <yuan.hu1@zte.com.cn>2018-03-27 17:24:38 +0800
committerYuanHu <yuan.hu1@zte.com.cn>2018-03-27 17:24:38 +0800
commit573f32b362f4639928485d66feb1c0721109716b (patch)
tree39ab8771c9ef87ee2b61abe1e126e31629bdf9eb /sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts
parent99fcc841c86367722097f54497dbc7c856c19251 (diff)
Include paletx core
Include paletx core to WF Designer UI. Issue-ID: SDC-1130,SDC-1131 Change-Id: I9a2591e022b5ff118cccbbc839796be19d70df84 Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts')
-rw-r--r--sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts87
1 files changed, 87 insertions, 0 deletions
diff --git a/sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts b/sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts
new file mode 100644
index 00000000..dad3f04e
--- /dev/null
+++ b/sdc-workflow-designer-ui/src/app/paletx/core/overlay/position/connected-position.ts
@@ -0,0 +1,87 @@
+/**
+ * @license
+ * Copyright Google Inc. All Rights Reserved.
+ *
+ * Use of this source code is governed by an MIT-style license that can be
+ * found in the LICENSE file at https://angular.io/license
+ */
+/* tslint:disable:array-type member-access variable-name typedef
+ only-arrow-functions directive-class-suffix component-class-suffix
+ component-selector no-unnecessary-type-assertion arrow-parens*/
+/** Horizontal dimension of a connection point on the perimeter of the origin or
+ * overlay element. */
+import {Optional} from '@angular/core';
+export type HorizontalConnectionPos = 'start' | 'center' | 'end';
+
+/** Vertical dimension of a connection point on the perimeter of the origin or
+ * overlay element. */
+export type VerticalConnectionPos = 'top' | 'center' | 'bottom';
+
+
+/** A connection point on the origin element. */
+export interface OriginConnectionPosition {
+ originX: HorizontalConnectionPos;
+ originY: VerticalConnectionPos;
+}
+
+/** A connection point on the overlay element. */
+export interface OverlayConnectionPosition {
+ overlayX: HorizontalConnectionPos;
+ overlayY: VerticalConnectionPos;
+}
+
+/** The points of the origin element and the overlay element to connect. */
+export class ConnectionPositionPair {
+ originX: HorizontalConnectionPos;
+ originY: VerticalConnectionPos;
+ overlayX: HorizontalConnectionPos;
+ overlayY: VerticalConnectionPos;
+
+ constructor(
+ origin: OriginConnectionPosition, overlay: OverlayConnectionPosition) {
+ this.originX = origin.originX;
+ this.originY = origin.originY;
+ this.overlayX = overlay.overlayX;
+ this.overlayY = overlay.overlayY;
+ }
+}
+
+/**
+ * Set of properties regarding the position of the origin and overlay relative
+ * to the viewport with respect to the containing Scrollable elements.
+ *
+ * The overlay and origin are clipped if any part of their bounding client
+ * rectangle exceeds the bounds of any one of the strategy's Scrollable's
+ * bounding client rectangle.
+ *
+ * The overlay and origin are outside view if there is no overlap between their
+ * bounding client rectangle and any one of the strategy's Scrollable's bounding
+ * client rectangle.
+ *
+ * ----------- -----------
+ * | outside | | clipped |
+ * | view | --------------------------
+ * | | | | | |
+ * ---------- | ----------- |
+ * -------------------------- | |
+ * | | | Scrollable |
+ * | | | |
+ * | | --------------------------
+ * | Scrollable |
+ * | |
+ * --------------------------
+ */
+export class ScrollableViewProperties {
+ isOriginClipped: boolean;
+ isOriginOutsideView: boolean;
+ isOverlayClipped: boolean;
+ isOverlayOutsideView: boolean;
+}
+
+/** The change event emitted by the strategy when a fallback position is used.
+ */
+export class ConnectedOverlayPositionChange {
+ constructor(
+ public connectionPair: ConnectionPositionPair,
+ @Optional() public scrollableViewProperties: ScrollableViewProperties) {}
+}