UNPKG

2.79 kBJavaScriptView Raw
1"use strict";
2/*
3 * Copyright 2015 Palantir Technologies, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17Object.defineProperty(exports, "__esModule", { value: true });
18exports.getPositionIgnoreAngles = exports.isPositionVertical = exports.isPositionHorizontal = exports.Position = void 0;
19exports.Position = {
20 BOTTOM: "bottom",
21 BOTTOM_LEFT: "bottom-left",
22 BOTTOM_RIGHT: "bottom-right",
23 LEFT: "left",
24 LEFT_BOTTOM: "left-bottom",
25 LEFT_TOP: "left-top",
26 RIGHT: "right",
27 RIGHT_BOTTOM: "right-bottom",
28 RIGHT_TOP: "right-top",
29 TOP: "top",
30 TOP_LEFT: "top-left",
31 TOP_RIGHT: "top-right",
32};
33function isPositionHorizontal(position) {
34 /* istanbul ignore next */
35 return (position === exports.Position.TOP ||
36 position === exports.Position.TOP_LEFT ||
37 position === exports.Position.TOP_RIGHT ||
38 position === exports.Position.BOTTOM ||
39 position === exports.Position.BOTTOM_LEFT ||
40 position === exports.Position.BOTTOM_RIGHT);
41}
42exports.isPositionHorizontal = isPositionHorizontal;
43function isPositionVertical(position) {
44 /* istanbul ignore next */
45 return (position === exports.Position.LEFT ||
46 position === exports.Position.LEFT_TOP ||
47 position === exports.Position.LEFT_BOTTOM ||
48 position === exports.Position.RIGHT ||
49 position === exports.Position.RIGHT_TOP ||
50 position === exports.Position.RIGHT_BOTTOM);
51}
52exports.isPositionVertical = isPositionVertical;
53function getPositionIgnoreAngles(position) {
54 if (position === exports.Position.TOP || position === exports.Position.TOP_LEFT || position === exports.Position.TOP_RIGHT) {
55 return exports.Position.TOP;
56 }
57 else if (position === exports.Position.BOTTOM ||
58 position === exports.Position.BOTTOM_LEFT ||
59 position === exports.Position.BOTTOM_RIGHT) {
60 return exports.Position.BOTTOM;
61 }
62 else if (position === exports.Position.LEFT || position === exports.Position.LEFT_TOP || position === exports.Position.LEFT_BOTTOM) {
63 return exports.Position.LEFT;
64 }
65 else {
66 return exports.Position.RIGHT;
67 }
68}
69exports.getPositionIgnoreAngles = getPositionIgnoreAngles;
70//# sourceMappingURL=position.js.map
\No newline at end of file