diff options
Diffstat (limited to 'sdc-workflow-designer-ui/src/app/paletx/core/overlay/overlay-position-map.ts')
-rw-r--r-- | sdc-workflow-designer-ui/src/app/paletx/core/overlay/overlay-position-map.ts | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/sdc-workflow-designer-ui/src/app/paletx/core/overlay/overlay-position-map.ts b/sdc-workflow-designer-ui/src/app/paletx/core/overlay/overlay-position-map.ts deleted file mode 100644 index 8ce53850..00000000 --- a/sdc-workflow-designer-ui/src/app/paletx/core/overlay/overlay-position-map.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* tslint:disable:array-type member-access variable-name typedef - only-arrow-functions directive-class-suffix component-class-suffix - component-selector one-variable-per-declaration - no-attribute-parameter-decorator*/ -import {ConnectionPositionPair} from './index'; - -export const POSITION_MAP: any = { - 'top': { - originX: 'center', - originY: 'top', - overlayX: 'center', - overlayY: 'bottom' - }, - 'topCenter': { - originX: 'center', - originY: 'top', - overlayX: 'center', - overlayY: 'bottom' - }, - 'topLeft': - {originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom'}, - 'topRight': - {originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom'}, - 'right': { - originX: 'end', - originY: 'center', - overlayX: 'start', - overlayY: 'center', - }, - 'rightTop': { - originX: 'end', - originY: 'top', - overlayX: 'start', - overlayY: 'top', - }, - 'rightBottom': { - originX: 'end', - originY: 'bottom', - overlayX: 'start', - overlayY: 'bottom', - }, - 'bottom': { - originX: 'center', - originY: 'bottom', - overlayX: 'center', - overlayY: 'top', - }, - 'bottomCenter': { - originX: 'center', - originY: 'bottom', - overlayX: 'center', - overlayY: 'top', - }, - 'bottomLeft': { - originX: 'start', - originY: 'bottom', - overlayX: 'start', - overlayY: 'top', - }, - 'bottomRight': { - originX: 'end', - originY: 'bottom', - overlayX: 'end', - overlayY: 'top', - }, - 'left': { - originX: 'start', - originY: 'center', - overlayX: 'end', - overlayY: 'center', - }, - 'leftTop': { - originX: 'start', - originY: 'top', - overlayX: 'end', - overlayY: 'top', - }, - 'leftBottom': { - originX: 'start', - originY: 'bottom', - overlayX: 'end', - overlayY: 'bottom', - }, -}; -export const DEFAULT_4_POSITIONS = _objectValues([ - POSITION_MAP['top'], POSITION_MAP['right'], POSITION_MAP['bottom'], - POSITION_MAP['left'] -]); -export const DEFAULT_DROPDOWN_POSITIONS = - _objectValues([POSITION_MAP['bottomLeft'], POSITION_MAP['topLeft']]); -export const DEFAULT_DATEPICKER_POSITIONS = [ - { - originX: 'start', - originY: 'top', - overlayX: 'start', - overlayY: 'top', - }, - { - originX: 'start', - originY: 'bottom', - overlayX: 'start', - overlayY: 'bottom', - } -] as ConnectionPositionPair[]; - -function arrayMap(array: any, iteratee: any) { - let index = -1; - const length = array === null ? 0 : array.length, result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -function baseValues(object: any, props: any) { - return arrayMap(props, function(key: any) { - return object[key]; - }); -} - -function _objectValues(object: any) { - return object === null ? [] : baseValues(object, Object.keys(object)); -} |