1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.applyAnchorClass = applyAnchorClass;
|
7 | exports.anchorTranslate = exports.anchorType = void 0;
|
8 | var anchorType;
|
9 | exports.anchorType = anchorType;
|
10 |
|
11 | (function (anchorType) {
|
12 | anchorType["CENTER"] = "center";
|
13 | anchorType["TOP"] = "top";
|
14 | anchorType["TOP-LEFT"] = "top-left";
|
15 | anchorType["TOP-RIGHT"] = "top-right";
|
16 | anchorType["BOTTOM"] = "bottom";
|
17 | anchorType["BOTTOM-LEFT"] = "bottom-left";
|
18 | anchorType["LEFT"] = "left";
|
19 | anchorType["RIGHT"] = "right";
|
20 | })(anchorType || (exports.anchorType = anchorType = {}));
|
21 |
|
22 | var anchorTranslate = {
|
23 | center: 'translate(-50%,-50%)',
|
24 | top: 'translate(-50%,0)',
|
25 | 'top-left': 'translate(0,0)',
|
26 | 'top-right': 'translate(-100%,0)',
|
27 | bottom: 'translate(-50%,-100%)',
|
28 | 'bottom-left': 'translate(0,-100%)',
|
29 | 'bottom-right': 'translate(-100%,-100%)',
|
30 | left: 'translate(0,-50%)',
|
31 | right: 'translate(-100%,-50%)'
|
32 | };
|
33 | exports.anchorTranslate = anchorTranslate;
|
34 |
|
35 | function applyAnchorClass(element, anchor, prefix) {
|
36 | var classList = element.classList;
|
37 |
|
38 | for (var _key in anchorTranslate) {
|
39 | if (anchorTranslate.hasOwnProperty(_key)) {
|
40 | classList.remove("l7-".concat(prefix, "-anchor-").concat(_key));
|
41 | }
|
42 | }
|
43 |
|
44 | classList.add("l7-".concat(prefix, "-anchor-").concat(anchor));
|
45 | }
|
46 |
|
\ | No newline at end of file |