@shoper/phoenix_design_system 0.22.5 → 0.22.6-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.
- package/build/cjs/{packages/phoenix/external → external}/classnames/index.js +10 -16
- package/build/{esm/packages/phoenix → cjs}/external/classnames/index.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/cjs/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js +46 -170
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js.map +1 -1
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +6 -10
- package/build/cjs/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js.map +1 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +11 -4
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/build/esm/{packages/phoenix/external → external}/classnames/index.js +10 -16
- package/build/{cjs/packages/phoenix → esm}/external/classnames/index.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/checkbox/checkbox_control.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/input/input.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/input/input.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/radio/radio.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/switch/switch.js.map +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js +1 -1
- package/build/esm/packages/phoenix/src/components/form/textarea/textarea.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.d.ts +2 -15
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js +46 -170
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.d.ts +3 -3
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js +6 -10
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller.js.map +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.d.ts +11 -4
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.js +1 -2
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_controller_types.js.map +1 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.d.ts +4 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js +11 -4
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element/phoenix_light_lit_element.js.map +1 -1
- package/package.json +1 -1
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.d.ts +0 -45
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.js +0 -4
- package/build/esm/packages/phoenix/src/controllers/relative_position_controller/relative_position_calculator_types.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createCommonjsModule } from '
|
|
1
|
+
import { createCommonjsModule } from '../../_virtual/_commonjsHelpers.js';
|
|
2
2
|
|
|
3
3
|
/*!
|
|
4
|
-
Copyright (c)
|
|
4
|
+
Copyright (c) 2017 Jed Watson.
|
|
5
5
|
Licensed under the MIT License (MIT), see
|
|
6
6
|
http://jedwatson.github.io/classnames
|
|
7
7
|
*/
|
|
@@ -13,7 +13,7 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
13
13
|
|
|
14
14
|
var hasOwn = {}.hasOwnProperty;
|
|
15
15
|
|
|
16
|
-
function classNames() {
|
|
16
|
+
function classNames () {
|
|
17
17
|
var classes = [];
|
|
18
18
|
|
|
19
19
|
for (var i = 0; i < arguments.length; i++) {
|
|
@@ -24,22 +24,16 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
24
24
|
|
|
25
25
|
if (argType === 'string' || argType === 'number') {
|
|
26
26
|
classes.push(arg);
|
|
27
|
-
} else if (Array.isArray(arg)) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
classes.push(inner);
|
|
32
|
-
}
|
|
27
|
+
} else if (Array.isArray(arg) && arg.length) {
|
|
28
|
+
var inner = classNames.apply(null, arg);
|
|
29
|
+
if (inner) {
|
|
30
|
+
classes.push(inner);
|
|
33
31
|
}
|
|
34
32
|
} else if (argType === 'object') {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
classes.push(key);
|
|
39
|
-
}
|
|
33
|
+
for (var key in arg) {
|
|
34
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
35
|
+
classes.push(key);
|
|
40
36
|
}
|
|
41
|
-
} else {
|
|
42
|
-
classes.push(arg.toString());
|
|
43
37
|
}
|
|
44
38
|
}
|
|
45
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
4
4
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
6
6
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
8
8
|
import { CHECKBOX_PROPS_TO_SYNC, CHECKBOX_CONTROL_CSS_CLASSES } from './checkbox_constants.js';
|
|
9
9
|
|
|
10
10
|
let HCheckbox = class HCheckbox extends PhoenixLightLitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_el
|
|
|
4
4
|
import { html } from 'lit-html';
|
|
5
5
|
import { property } from '@lit/reactive-element/decorators.js';
|
|
6
6
|
import { createRef, ref } from 'lit-html/directives/ref.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
8
8
|
import { ControlPropsSyncConsumerController } from '../controllers/props_synchronizing/control_props_sync_consumer_controller.js';
|
|
9
9
|
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
10
10
|
import { CHECKBOX_CONTROL_EVENTS, CHECKBOX_CONTROL_CSS_CLASSES } from './checkbox_constants.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -5,7 +5,7 @@ import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_el
|
|
|
5
5
|
import { INPUT_CONTROL_TYPES, INPUT_PROPS_TO_SYNC, INPUT_CONTROL_CSS_CLASSES } from './input_constants.js';
|
|
6
6
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
7
7
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
8
|
-
import classnames from '
|
|
8
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
9
9
|
|
|
10
10
|
let HInput = class HInput extends PhoenixLightLitElement {
|
|
11
11
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
4
4
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
6
6
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
8
8
|
import { CHECKBOX_PROPS_TO_SYNC } from '../checkbox/checkbox_constants.js';
|
|
9
9
|
import { RADIO_CONTROL_CSS_CLASSES } from './radio_constants.js';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
4
4
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
6
6
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
8
8
|
import { CHECKBOX_PROPS_TO_SYNC } from '../checkbox/checkbox_constants.js';
|
|
9
9
|
import { SWITCH_CONTROL_CSS_CLASSES } from './switch_constants.js';
|
|
10
10
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -4,7 +4,7 @@ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/
|
|
|
4
4
|
import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
|
|
5
5
|
import { BASE_FORM_CONTROL_PROPS } from '../controllers/props_synchronizing/control_props_sync_controller_constants.js';
|
|
6
6
|
import { ControlPropsSyncProviderController } from '../controllers/props_synchronizing/control_props_sync_provider_controller.js';
|
|
7
|
-
import classnames from '
|
|
7
|
+
import classnames from '../../../../../../external/classnames/index.js';
|
|
8
8
|
import { TEXTAREA_PROPS_TO_SYNC, TEXTAREA_CONTROL_CSS_CLASSES } from './textarea_constants.js';
|
|
9
9
|
|
|
10
10
|
let HTextarea = class HTextarea extends PhoenixLightLitElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;AACA;AACA;AACA;AACA;AACA,uBAAuB,gDAAoD;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
import { TRelativePositionCalculatorConstructorOptions } from
|
|
2
|
-
import { TRelativePositionControllerPositionData } from "./relative_position_controller_types";
|
|
1
|
+
import { TRelativePositionCalculatorConstructorOptions, TRelativePositionControllerPositionData } from "./relative_position_controller_types";
|
|
3
2
|
export declare class PositionCalculator {
|
|
4
3
|
#private;
|
|
5
|
-
constructor({ direction, relativeElementRect, positionElementRect, container, nearestNonStaticElementFromElementToPositionRect,
|
|
4
|
+
constructor({ direction, relativeElementRect, positionElementRect, container, nearestNonStaticElementFromElementToPositionRect, shouldNotReposition }: TRelativePositionCalculatorConstructorOptions);
|
|
6
5
|
calculatePosition(): TRelativePositionControllerPositionData;
|
|
7
6
|
private _canFitTopSide;
|
|
8
7
|
private _canFitBottomSide;
|
|
9
8
|
private _canFitCenter;
|
|
10
|
-
private _canFitLeftSide;
|
|
11
|
-
private _canFitRightSide;
|
|
12
9
|
private _calculateSidePosition;
|
|
13
|
-
private _calculateTopSide;
|
|
14
|
-
private _calculateBottomSide;
|
|
15
|
-
private _calculateCenterSide;
|
|
16
|
-
private _calculateLeftSide;
|
|
17
|
-
private _calculateRightSide;
|
|
18
10
|
private calculateAlignmentPosition;
|
|
19
|
-
private _calculateTopAlignment;
|
|
20
|
-
private _calculateBottomAlignment;
|
|
21
|
-
private _calculateLeftAlignment;
|
|
22
|
-
private _calculateRightAlignment;
|
|
23
|
-
private _calculateCenterAlignment;
|
|
24
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { CALCULATOR_DIRECTIONS } from './relative_position_controller_constants.js';
|
|
3
3
|
|
|
4
|
-
var _PositionCalculator_direction, _PositionCalculator_relativeElementRect, _PositionCalculator_positionElementRect, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, _PositionCalculator_containerRect, _PositionCalculator_documentHeight, _PositionCalculator_shouldNotReposition
|
|
4
|
+
var _PositionCalculator_direction, _PositionCalculator_relativeElementRect, _PositionCalculator_positionElementRect, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, _PositionCalculator_containerRect, _PositionCalculator_documentHeight, _PositionCalculator_shouldNotReposition;
|
|
5
5
|
class PositionCalculator {
|
|
6
|
-
constructor({ direction, relativeElementRect, positionElementRect, container = document.body, nearestNonStaticElementFromElementToPositionRect,
|
|
6
|
+
constructor({ direction, relativeElementRect, positionElementRect, container = document.body, nearestNonStaticElementFromElementToPositionRect, shouldNotReposition }) {
|
|
7
7
|
_PositionCalculator_direction.set(this, void 0);
|
|
8
8
|
_PositionCalculator_relativeElementRect.set(this, void 0);
|
|
9
9
|
_PositionCalculator_positionElementRect.set(this, void 0);
|
|
@@ -11,22 +11,20 @@ class PositionCalculator {
|
|
|
11
11
|
_PositionCalculator_containerRect.set(this, void 0);
|
|
12
12
|
_PositionCalculator_documentHeight.set(this, void 0);
|
|
13
13
|
_PositionCalculator_shouldNotReposition.set(this, void 0);
|
|
14
|
-
_PositionCalculator_offset.set(this, void 0);
|
|
15
14
|
__classPrivateFieldSet(this, _PositionCalculator_direction, direction, "f");
|
|
16
15
|
__classPrivateFieldSet(this, _PositionCalculator_relativeElementRect, relativeElementRect, "f");
|
|
17
16
|
__classPrivateFieldSet(this, _PositionCalculator_positionElementRect, positionElementRect, "f");
|
|
18
17
|
__classPrivateFieldSet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, nearestNonStaticElementFromElementToPositionRect, "f");
|
|
19
18
|
__classPrivateFieldSet(this, _PositionCalculator_containerRect, container.getBoundingClientRect(), "f");
|
|
20
19
|
__classPrivateFieldSet(this, _PositionCalculator_shouldNotReposition, !!shouldNotReposition, "f");
|
|
21
|
-
__classPrivateFieldSet(this, _PositionCalculator_offset, offset, "f");
|
|
22
20
|
const body = document.body;
|
|
23
21
|
const documentElement = document.documentElement;
|
|
24
22
|
__classPrivateFieldSet(this, _PositionCalculator_documentHeight, Math.max(body.scrollHeight, body.offsetHeight, documentElement.clientHeight, documentElement.scrollHeight, documentElement.offsetHeight), "f");
|
|
25
23
|
}
|
|
26
24
|
calculatePosition() {
|
|
27
25
|
const [side, alignment = CALCULATOR_DIRECTIONS.center] = __classPrivateFieldGet(this, _PositionCalculator_direction, "f").split('-');
|
|
28
|
-
const sidePosition = this._calculateSidePosition(side
|
|
29
|
-
const alignmentPosition = this.calculateAlignmentPosition(alignment
|
|
26
|
+
const sidePosition = this._calculateSidePosition(side);
|
|
27
|
+
const alignmentPosition = this.calculateAlignmentPosition(alignment);
|
|
30
28
|
return {
|
|
31
29
|
...sidePosition,
|
|
32
30
|
...alignmentPosition,
|
|
@@ -44,188 +42,66 @@ class PositionCalculator {
|
|
|
44
42
|
_canFitCenter(centerPosition) {
|
|
45
43
|
return centerPosition + __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").height - window.scrollY < window.innerHeight && centerPosition - window.scrollY > 0;
|
|
46
44
|
}
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_canFitRightSide() {
|
|
52
|
-
const positionElementRightSide = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").right - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").left;
|
|
53
|
-
return positionElementRightSide + __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width <= __classPrivateFieldGet(this, _PositionCalculator_containerRect, "f").width;
|
|
54
|
-
}
|
|
55
|
-
_calculateSidePosition(side, alignment) {
|
|
56
|
-
const topSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").top -
|
|
57
|
-
__classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").top -
|
|
58
|
-
__classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").height -
|
|
59
|
-
__classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
60
|
-
const bottomSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").bottom - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").top + __classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
61
|
-
const leftSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").left -
|
|
62
|
-
__classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").left -
|
|
63
|
-
__classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width -
|
|
64
|
-
__classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
65
|
-
const rightSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").right - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").left + __classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
66
|
-
const verticalCenterOfRelativeElement = (topSideOfRelativeElement + bottomSideOfRelativeElement) / 2;
|
|
67
|
-
const horizontalCenterOfRelativeElement = (leftSideOfRelativeElement + rightSideOfRelativeElement) / 2;
|
|
45
|
+
_calculateSidePosition(side) {
|
|
46
|
+
const topSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").top - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").top - __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").height;
|
|
47
|
+
const bottomSideOfRelativeElement = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").bottom - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").top;
|
|
48
|
+
const centerOfRelativeElement = (topSideOfRelativeElement + bottomSideOfRelativeElement) / 2;
|
|
68
49
|
switch (side) {
|
|
69
50
|
case CALCULATOR_DIRECTIONS.top:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
51
|
+
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
52
|
+
return { top: topSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
53
|
+
if (!this._canFitTopSide() && !this._canFitBottomSide() && !this._canFitCenter(centerOfRelativeElement))
|
|
54
|
+
return { top: bottomSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.bottom, shrinkMode: true };
|
|
55
|
+
if (!this._canFitTopSide() && !this._canFitBottomSide())
|
|
56
|
+
return { top: centerOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
57
|
+
if (!this._canFitTopSide())
|
|
58
|
+
return { top: bottomSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
59
|
+
return { top: topSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
75
60
|
case CALCULATOR_DIRECTIONS.bottom:
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
62
|
+
return { top: bottomSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
63
|
+
if (!this._canFitTopSide() && !this._canFitBottomSide() && !this._canFitCenter(centerOfRelativeElement))
|
|
64
|
+
return { top: bottomSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.bottom, shrinkMode: true };
|
|
65
|
+
if (!this._canFitTopSide() && !this._canFitBottomSide())
|
|
66
|
+
return { top: centerOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
67
|
+
if (!this._canFitBottomSide())
|
|
68
|
+
return { top: topSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
69
|
+
return { top: bottomSideOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
81
70
|
case CALCULATOR_DIRECTIONS.center:
|
|
82
|
-
return
|
|
83
|
-
verticalCenter: verticalCenterOfRelativeElement,
|
|
84
|
-
horizontalCenter: horizontalCenterOfRelativeElement,
|
|
85
|
-
alignment
|
|
86
|
-
});
|
|
71
|
+
return { top: centerOfRelativeElement, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
87
72
|
case CALCULATOR_DIRECTIONS.left:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
rightSide: rightSideOfRelativeElement
|
|
91
|
-
});
|
|
73
|
+
// do zaimplementowania
|
|
74
|
+
return { top: 0 };
|
|
92
75
|
case CALCULATOR_DIRECTIONS.right:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
rightSide: rightSideOfRelativeElement
|
|
96
|
-
});
|
|
76
|
+
// do zaimplementowania
|
|
77
|
+
return { top: 0 };
|
|
97
78
|
default:
|
|
98
79
|
return { top: 0 };
|
|
99
80
|
}
|
|
100
81
|
}
|
|
101
|
-
|
|
102
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
103
|
-
return { top: topSide, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
104
|
-
if (!this._canFitTopSide() && !this._canFitBottomSide() && !this._canFitCenter(verticalCenter))
|
|
105
|
-
return { top: bottomSide, calculatedSide: CALCULATOR_DIRECTIONS.bottom, shrinkMode: true };
|
|
106
|
-
if (!this._canFitTopSide() && !this._canFitBottomSide())
|
|
107
|
-
return { top: verticalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
108
|
-
if (!this._canFitTopSide())
|
|
109
|
-
return { top: bottomSide, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
110
|
-
return { top: topSide, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
111
|
-
}
|
|
112
|
-
_calculateBottomSide({ topSide, bottomSide, verticalCenter }) {
|
|
113
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
114
|
-
return { top: bottomSide, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
115
|
-
if (!this._canFitTopSide() && !this._canFitBottomSide() && !this._canFitCenter(verticalCenter))
|
|
116
|
-
return { top: bottomSide, calculatedSide: CALCULATOR_DIRECTIONS.bottom, shrinkMode: true };
|
|
117
|
-
if (!this._canFitTopSide() && !this._canFitBottomSide())
|
|
118
|
-
return { top: verticalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
119
|
-
if (!this._canFitBottomSide())
|
|
120
|
-
return { top: topSide, calculatedSide: CALCULATOR_DIRECTIONS.top };
|
|
121
|
-
return { top: bottomSide, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
122
|
-
}
|
|
123
|
-
_calculateCenterSide({ verticalCenter, horizontalCenter, alignment }) {
|
|
124
|
-
if (alignment === CALCULATOR_DIRECTIONS.left || alignment === CALCULATOR_DIRECTIONS.right)
|
|
125
|
-
return { top: verticalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
126
|
-
return { left: horizontalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
127
|
-
}
|
|
128
|
-
_calculateLeftSide({ leftSide, rightSide }) {
|
|
129
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
130
|
-
return { left: leftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
131
|
-
if (!this._canFitLeftSide() && !this._canFitRightSide())
|
|
132
|
-
return { left: leftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
133
|
-
if (!this._canFitLeftSide())
|
|
134
|
-
return { left: rightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
135
|
-
return { left: leftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
136
|
-
}
|
|
137
|
-
_calculateRightSide({ leftSide, rightSide }) {
|
|
138
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
139
|
-
return { left: rightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
140
|
-
if (!this._canFitRightSide() && !this._canFitLeftSide())
|
|
141
|
-
return { left: rightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
142
|
-
if (!this._canFitRightSide())
|
|
143
|
-
return { left: leftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
144
|
-
return { left: rightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
145
|
-
}
|
|
146
|
-
calculateAlignmentPosition(alignment, side) {
|
|
82
|
+
calculateAlignmentPosition(side) {
|
|
147
83
|
const alignmentToLeftSide = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").left - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").left;
|
|
148
84
|
const alignmentToRightSide = __classPrivateFieldGet(this, _PositionCalculator_relativeElementRect, "f").right - __classPrivateFieldGet(this, _PositionCalculator_nearestNonStaticElementFromElementToPositionRect, "f").left - __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width;
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
case CALCULATOR_DIRECTIONS.left: {
|
|
162
|
-
return this._calculateLeftAlignment({
|
|
163
|
-
leftAlignment: alignmentToLeftSide,
|
|
164
|
-
rightAlignment: alignmentToRightSide,
|
|
165
|
-
isSideCenter
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
case CALCULATOR_DIRECTIONS.right: {
|
|
169
|
-
return this._calculateRightAlignment({
|
|
170
|
-
leftAlignment: alignmentToLeftSide,
|
|
171
|
-
rightAlignment: alignmentToRightSide,
|
|
172
|
-
isSideCenter
|
|
173
|
-
});
|
|
174
|
-
}
|
|
85
|
+
const alignmentToCenter = (alignmentToLeftSide + alignmentToRightSide) / 2;
|
|
86
|
+
switch (side) {
|
|
87
|
+
case CALCULATOR_DIRECTIONS.top:
|
|
88
|
+
// do zaimplementowania
|
|
89
|
+
return { left: 0 };
|
|
90
|
+
case CALCULATOR_DIRECTIONS.bottom:
|
|
91
|
+
// do zaimplementowania
|
|
92
|
+
return { left: 0 };
|
|
93
|
+
case CALCULATOR_DIRECTIONS.left:
|
|
94
|
+
return { left: alignmentToLeftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
95
|
+
case CALCULATOR_DIRECTIONS.right:
|
|
96
|
+
return { left: alignmentToRightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
175
97
|
case CALCULATOR_DIRECTIONS.center:
|
|
176
|
-
return
|
|
177
|
-
horizontalCenter: horizontalCenterOfRelativeElement,
|
|
178
|
-
verticalCenter: verticalCenterOfRelativeElement,
|
|
179
|
-
side
|
|
180
|
-
});
|
|
98
|
+
return { left: alignmentToCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
181
99
|
default:
|
|
182
100
|
return { left: 0 };
|
|
183
101
|
}
|
|
184
102
|
}
|
|
185
|
-
_calculateTopAlignment({ topAlignment, isSideCenter }) {
|
|
186
|
-
const alignmentToTop = isSideCenter ? topAlignment - __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").height - __classPrivateFieldGet(this, _PositionCalculator_offset, "f") : topAlignment;
|
|
187
|
-
return {
|
|
188
|
-
top: alignmentToTop,
|
|
189
|
-
calculatedSide: CALCULATOR_DIRECTIONS.top
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
_calculateBottomAlignment({ bottomAlignment, isSideCenter }) {
|
|
193
|
-
const alignmentToBottom = isSideCenter ? bottomAlignment + __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").height + __classPrivateFieldGet(this, _PositionCalculator_offset, "f") : bottomAlignment;
|
|
194
|
-
return { top: alignmentToBottom, calculatedSide: CALCULATOR_DIRECTIONS.bottom };
|
|
195
|
-
}
|
|
196
|
-
_calculateLeftAlignment({ leftAlignment, rightAlignment, isSideCenter }) {
|
|
197
|
-
const alignmentToLeftSide = isSideCenter ? leftAlignment - __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width : leftAlignment;
|
|
198
|
-
const alignmentToRightSide = rightAlignment + __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width + __classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
199
|
-
if (!isSideCenter)
|
|
200
|
-
return { left: alignmentToLeftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
201
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
202
|
-
return { left: alignmentToLeftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
203
|
-
if (!this._canFitLeftSide() && !this._canFitRightSide())
|
|
204
|
-
return { left: alignmentToLeftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
205
|
-
if (!this._canFitLeftSide())
|
|
206
|
-
return { left: alignmentToRightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
207
|
-
return { left: alignmentToLeftSide - __classPrivateFieldGet(this, _PositionCalculator_offset, "f"), calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
208
|
-
}
|
|
209
|
-
_calculateRightAlignment({ leftAlignment, rightAlignment, isSideCenter }) {
|
|
210
|
-
const alignmentToRightSide = isSideCenter ? rightAlignment + __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width : rightAlignment;
|
|
211
|
-
const alignmentToLeftSide = leftAlignment - __classPrivateFieldGet(this, _PositionCalculator_positionElementRect, "f").width - __classPrivateFieldGet(this, _PositionCalculator_offset, "f");
|
|
212
|
-
if (!isSideCenter)
|
|
213
|
-
return { left: alignmentToRightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
214
|
-
if (__classPrivateFieldGet(this, _PositionCalculator_shouldNotReposition, "f"))
|
|
215
|
-
return { left: alignmentToRightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
216
|
-
if (!this._canFitLeftSide() && !this._canFitRightSide())
|
|
217
|
-
return { left: alignmentToRightSide, calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
218
|
-
if (!this._canFitRightSide())
|
|
219
|
-
return { left: alignmentToLeftSide, calculatedSide: CALCULATOR_DIRECTIONS.left };
|
|
220
|
-
return { left: alignmentToRightSide + __classPrivateFieldGet(this, _PositionCalculator_offset, "f"), calculatedSide: CALCULATOR_DIRECTIONS.right };
|
|
221
|
-
}
|
|
222
|
-
_calculateCenterAlignment({ horizontalCenter, verticalCenter, side }) {
|
|
223
|
-
if (side === CALCULATOR_DIRECTIONS.top || side === CALCULATOR_DIRECTIONS.bottom)
|
|
224
|
-
return { left: horizontalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
225
|
-
return { top: verticalCenter, calculatedSide: CALCULATOR_DIRECTIONS.center };
|
|
226
|
-
}
|
|
227
103
|
}
|
|
228
|
-
_PositionCalculator_direction = new WeakMap(), _PositionCalculator_relativeElementRect = new WeakMap(), _PositionCalculator_positionElementRect = new WeakMap(), _PositionCalculator_nearestNonStaticElementFromElementToPositionRect = new WeakMap(), _PositionCalculator_containerRect = new WeakMap(), _PositionCalculator_documentHeight = new WeakMap(), _PositionCalculator_shouldNotReposition = new WeakMap()
|
|
104
|
+
_PositionCalculator_direction = new WeakMap(), _PositionCalculator_relativeElementRect = new WeakMap(), _PositionCalculator_positionElementRect = new WeakMap(), _PositionCalculator_nearestNonStaticElementFromElementToPositionRect = new WeakMap(), _PositionCalculator_containerRect = new WeakMap(), _PositionCalculator_documentHeight = new WeakMap(), _PositionCalculator_shouldNotReposition = new WeakMap();
|
|
229
105
|
|
|
230
106
|
export { PositionCalculator };
|
|
231
107
|
//# sourceMappingURL=relative_position_calculator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IRelativePositionController,
|
|
1
|
+
import { IRelativePositionController, TRelativePositionControllerConstructorOptions } from "./relative_position_controller_types";
|
|
2
2
|
export declare class RelativePositionController implements IRelativePositionController {
|
|
3
3
|
#private;
|
|
4
|
-
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition, portalElementsNames
|
|
4
|
+
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition, portalElementsNames }: TRelativePositionControllerConstructorOptions);
|
|
5
5
|
hostConnected(): void;
|
|
6
6
|
hostDisconnected(): void;
|
|
7
|
-
position(shouldNotReposition?: boolean):
|
|
7
|
+
position(shouldNotReposition?: boolean): void;
|
|
8
8
|
private _dispatchReenabledPositioningEvent;
|
|
9
9
|
private _findNearestScrollableElement;
|
|
10
10
|
private _findContainer;
|
|
@@ -5,9 +5,9 @@ import { RELATIVE_POSITION_CONTROLLER_EVENTS, OVERFLOW_SCROLL, OVERFLOW_AUTO, NO
|
|
|
5
5
|
import { PositionCalculator } from './relative_position_calculator.js';
|
|
6
6
|
import throttle_1 from '../../../../../external/lodash/throttle.js';
|
|
7
7
|
|
|
8
|
-
var _RelativePositionController_host, _RelativePositionController_container, _RelativePositionController_nearestNonStaticElementFromElementToPosition, _RelativePositionController_direction, _RelativePositionController_nearestScrollableElement, _RelativePositionController_relativeElement, _RelativePositionController_elementToPosition, _RelativePositionController_disablePositioningOnCondition, _RelativePositionController_portalElementsNames, _RelativePositionController_isInitiallyScrollable, _RelativePositionController_initialMaxHeight, _RelativePositionController_initialHeight, _RelativePositionController_calculatedDirection, _RelativePositionController_hasPositioningBeenDisabled, _RelativePositionController_doesCurrentlyHaveShrinkMode,
|
|
8
|
+
var _RelativePositionController_host, _RelativePositionController_container, _RelativePositionController_nearestNonStaticElementFromElementToPosition, _RelativePositionController_direction, _RelativePositionController_nearestScrollableElement, _RelativePositionController_relativeElement, _RelativePositionController_elementToPosition, _RelativePositionController_disablePositioningOnCondition, _RelativePositionController_portalElementsNames, _RelativePositionController_isInitiallyScrollable, _RelativePositionController_initialMaxHeight, _RelativePositionController_initialHeight, _RelativePositionController_calculatedDirection, _RelativePositionController_hasPositioningBeenDisabled, _RelativePositionController_doesCurrentlyHaveShrinkMode, _RelativePositionController_throttledReposition, _RelativePositionController_throttledRepositionForScroll;
|
|
9
9
|
class RelativePositionController {
|
|
10
|
-
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition = () => true, portalElementsNames = []
|
|
10
|
+
constructor({ host, container, direction, relativeElement, elementToPosition, disablePositioningOnCondition = () => true, portalElementsNames = [] }) {
|
|
11
11
|
_RelativePositionController_host.set(this, void 0);
|
|
12
12
|
_RelativePositionController_container.set(this, void 0);
|
|
13
13
|
_RelativePositionController_nearestNonStaticElementFromElementToPosition.set(this, void 0);
|
|
@@ -23,7 +23,6 @@ class RelativePositionController {
|
|
|
23
23
|
_RelativePositionController_calculatedDirection.set(this, void 0);
|
|
24
24
|
_RelativePositionController_hasPositioningBeenDisabled.set(this, void 0);
|
|
25
25
|
_RelativePositionController_doesCurrentlyHaveShrinkMode.set(this, void 0);
|
|
26
|
-
_RelativePositionController_offset.set(this, void 0);
|
|
27
26
|
_RelativePositionController_throttledReposition.set(this, throttle_1(() => {
|
|
28
27
|
if (__classPrivateFieldGet(this, _RelativePositionController_disablePositioningOnCondition, "f").call(this)) {
|
|
29
28
|
this.disableRelativePositioning();
|
|
@@ -49,7 +48,6 @@ class RelativePositionController {
|
|
|
49
48
|
__classPrivateFieldSet(this, _RelativePositionController_elementToPosition, elementToPosition, "f");
|
|
50
49
|
__classPrivateFieldSet(this, _RelativePositionController_disablePositioningOnCondition, disablePositioningOnCondition, "f");
|
|
51
50
|
__classPrivateFieldSet(this, _RelativePositionController_portalElementsNames, portalElementsNames, "f");
|
|
52
|
-
__classPrivateFieldSet(this, _RelativePositionController_offset, offset, "f");
|
|
53
51
|
__classPrivateFieldSet(this, _RelativePositionController_isInitiallyScrollable, elementToPosition.classList.contains(SCROLLABLE_CLASS_NAME), "f");
|
|
54
52
|
__classPrivateFieldSet(this, _RelativePositionController_initialMaxHeight, getComputedStyle(elementToPosition).maxHeight, "f");
|
|
55
53
|
__classPrivateFieldGet(this, _RelativePositionController_host, "f").addController(this);
|
|
@@ -82,21 +80,19 @@ class RelativePositionController {
|
|
|
82
80
|
positionElementRect,
|
|
83
81
|
nearestNonStaticElementFromElementToPositionRect: __classPrivateFieldGet(this, _RelativePositionController_nearestNonStaticElementFromElementToPosition, "f").getBoundingClientRect(),
|
|
84
82
|
container: __classPrivateFieldGet(this, _RelativePositionController_container, "f"),
|
|
85
|
-
shouldNotReposition
|
|
86
|
-
offset: __classPrivateFieldGet(this, _RelativePositionController_offset, "f")
|
|
83
|
+
shouldNotReposition
|
|
87
84
|
}).calculatePosition();
|
|
88
85
|
this._setElementPosition(position);
|
|
89
86
|
const isRepositioningDisabled = shouldNotReposition && __classPrivateFieldGet(this, _RelativePositionController_doesCurrentlyHaveShrinkMode, "f");
|
|
90
87
|
if (isRepositioningDisabled)
|
|
91
|
-
return
|
|
88
|
+
return;
|
|
92
89
|
__classPrivateFieldSet(this, _RelativePositionController_calculatedDirection, position.calculatedSide, "f");
|
|
93
90
|
__classPrivateFieldSet(this, _RelativePositionController_doesCurrentlyHaveShrinkMode, !!position.shrinkMode, "f");
|
|
94
91
|
if (!position.shrinkMode) {
|
|
95
92
|
this._disableShrinkMode();
|
|
96
|
-
return
|
|
93
|
+
return;
|
|
97
94
|
}
|
|
98
95
|
this._enableShrinkMode();
|
|
99
|
-
return position.calculatedSide;
|
|
100
96
|
}
|
|
101
97
|
_dispatchReenabledPositioningEvent() {
|
|
102
98
|
__classPrivateFieldSet(this, _RelativePositionController_hasPositioningBeenDisabled, false, "f");
|
|
@@ -155,7 +151,7 @@ class RelativePositionController {
|
|
|
155
151
|
elementStyle.transform = '';
|
|
156
152
|
}
|
|
157
153
|
}
|
|
158
|
-
_RelativePositionController_host = new WeakMap(), _RelativePositionController_container = new WeakMap(), _RelativePositionController_nearestNonStaticElementFromElementToPosition = new WeakMap(), _RelativePositionController_direction = new WeakMap(), _RelativePositionController_nearestScrollableElement = new WeakMap(), _RelativePositionController_relativeElement = new WeakMap(), _RelativePositionController_elementToPosition = new WeakMap(), _RelativePositionController_disablePositioningOnCondition = new WeakMap(), _RelativePositionController_portalElementsNames = new WeakMap(), _RelativePositionController_isInitiallyScrollable = new WeakMap(), _RelativePositionController_initialMaxHeight = new WeakMap(), _RelativePositionController_initialHeight = new WeakMap(), _RelativePositionController_calculatedDirection = new WeakMap(), _RelativePositionController_hasPositioningBeenDisabled = new WeakMap(), _RelativePositionController_doesCurrentlyHaveShrinkMode = new WeakMap(),
|
|
154
|
+
_RelativePositionController_host = new WeakMap(), _RelativePositionController_container = new WeakMap(), _RelativePositionController_nearestNonStaticElementFromElementToPosition = new WeakMap(), _RelativePositionController_direction = new WeakMap(), _RelativePositionController_nearestScrollableElement = new WeakMap(), _RelativePositionController_relativeElement = new WeakMap(), _RelativePositionController_elementToPosition = new WeakMap(), _RelativePositionController_disablePositioningOnCondition = new WeakMap(), _RelativePositionController_portalElementsNames = new WeakMap(), _RelativePositionController_isInitiallyScrollable = new WeakMap(), _RelativePositionController_initialMaxHeight = new WeakMap(), _RelativePositionController_initialHeight = new WeakMap(), _RelativePositionController_calculatedDirection = new WeakMap(), _RelativePositionController_hasPositioningBeenDisabled = new WeakMap(), _RelativePositionController_doesCurrentlyHaveShrinkMode = new WeakMap(), _RelativePositionController_throttledReposition = new WeakMap(), _RelativePositionController_throttledRepositionForScroll = new WeakMap();
|
|
159
155
|
|
|
160
156
|
export { RelativePositionController };
|
|
161
157
|
//# sourceMappingURL=relative_position_controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA,uBAAuB,4CAAgD;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { CALCULATOR_DIRECTIONS, DIRECTIONS } from "./relative_position_controller_constants";
|
|
1
2
|
import { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
3
|
import { Any } from 'ts-toolbelt';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare type TDirection = typeof DIRECTIONS[Any.Keys<typeof DIRECTIONS>];
|
|
4
|
+
export declare type TDirection = Any.Keys<typeof DIRECTIONS>;
|
|
5
|
+
export declare type TCalculatorDirection = Any.Keys<typeof CALCULATOR_DIRECTIONS>;
|
|
6
6
|
export declare type TRelativePositionControllerConstructorOptions = {
|
|
7
7
|
host: ReactiveControllerHost & HTMLElement;
|
|
8
8
|
direction: TDirection;
|
|
@@ -11,7 +11,6 @@ export declare type TRelativePositionControllerConstructorOptions = {
|
|
|
11
11
|
elementToPosition: HTMLElement;
|
|
12
12
|
disablePositioningOnCondition?: () => boolean;
|
|
13
13
|
portalElementsNames?: string[];
|
|
14
|
-
offset?: number;
|
|
15
14
|
};
|
|
16
15
|
export interface IRelativePositionController extends ReactiveController {
|
|
17
16
|
position(): void;
|
|
@@ -25,3 +24,11 @@ export declare type TRelativePositionControllerPositionData = {
|
|
|
25
24
|
export declare type TPartialPositionControllerPositionData = Omit<TRelativePositionControllerPositionData, 'calculatedSide'> & {
|
|
26
25
|
calculatedSide: TCalculatorDirection;
|
|
27
26
|
};
|
|
27
|
+
export declare type TRelativePositionCalculatorConstructorOptions = {
|
|
28
|
+
direction: TDirection;
|
|
29
|
+
relativeElementRect: DOMRect;
|
|
30
|
+
positionElementRect: DOMRect;
|
|
31
|
+
nearestNonStaticElementFromElementToPositionRect: DOMRect;
|
|
32
|
+
container?: HTMLElement;
|
|
33
|
+
shouldNotReposition?: boolean;
|
|
34
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import '@phoenixRoot/controllers/relative_position_controller/relative_position_controller_constants';
|
|
1
2
|
import 'lit';
|
|
2
3
|
import 'ts-toolbelt';
|
|
3
|
-
import '@phoenixRoot/controllers/relative_position_controller/relative_position_controller_constants';
|
|
4
|
-
import './relative_position_calculator_types';
|
|
5
4
|
//# sourceMappingURL=relative_position_controller_types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relative_position_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/controllers/relative_position_controller/relative_position_controller_types.ts"],"names":[],"mappings":"AAAA,OAA2D,KAAK,CAAC;AAEjE,OAAoB,aAAa,CAAC
|
|
1
|
+
{"version":3,"file":"relative_position_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/controllers/relative_position_controller/relative_position_controller_types.ts"],"names":[],"mappings":"AAAA,OAAkD,8FAA8F,CAAC;AACjJ,OAA2D,KAAK,CAAC;AAEjE,OAAoB,aAAa,CAAC"}
|