@shoper/phoenix_design_system 0.7.3 → 0.8.3-0

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.
Files changed (50) hide show
  1. package/build/cjs/packages/phoenix/src/components/backdrop/backdrop.js +91 -0
  2. package/build/cjs/packages/phoenix/src/components/{modal/modal_backdrop.js.map → backdrop/backdrop.js.map} +1 -1
  3. package/build/cjs/packages/phoenix/src/components/backdrop/backdrop_constants.js +17 -0
  4. package/build/cjs/packages/phoenix/src/components/backdrop/backdrop_constants.js.map +1 -0
  5. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js +102 -21
  6. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
  7. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_constants.js +9 -1
  8. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_constants.js.map +1 -1
  9. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js +1 -0
  10. package/build/cjs/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
  11. package/build/cjs/packages/phoenix/src/components/modal/modal.js +13 -10
  12. package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
  13. package/build/cjs/packages/phoenix/src/controllers/click_outside_controller/click_outside_controller.js +4 -2
  14. package/build/cjs/packages/phoenix/src/controllers/click_outside_controller/click_outside_controller.js.map +1 -1
  15. package/build/cjs/packages/phoenix/src/global_constants.js +15 -0
  16. package/build/cjs/packages/phoenix/src/global_constants.js.map +1 -0
  17. package/build/cjs/packages/phoenix/src/index.js +7 -7
  18. package/build/esm/packages/phoenix/src/components/backdrop/backdrop.d.ts +17 -0
  19. package/build/esm/packages/phoenix/src/components/backdrop/backdrop.js +89 -0
  20. package/build/esm/packages/phoenix/src/components/{modal/modal_backdrop.js.map → backdrop/backdrop.js.map} +1 -1
  21. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_constants.d.ts +7 -0
  22. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_constants.js +11 -0
  23. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_constants.js.map +1 -0
  24. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_types.d.ts +3 -0
  25. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_types.js +2 -0
  26. package/build/esm/packages/phoenix/src/components/backdrop/backdrop_types.js.map +1 -0
  27. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.d.ts +9 -3
  28. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js +103 -22
  29. package/build/esm/packages/phoenix/src/components/dropdown/dropdown.js.map +1 -1
  30. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.d.ts +5 -0
  31. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.js +6 -2
  32. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_constants.js.map +1 -1
  33. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_content.d.ts +1 -1
  34. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js +2 -1
  35. package/build/esm/packages/phoenix/src/components/dropdown/dropdown_toggler.js.map +1 -1
  36. package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +1 -2
  37. package/build/esm/packages/phoenix/src/components/modal/modal.js +13 -10
  38. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
  39. package/build/esm/packages/phoenix/src/controllers/click_outside_controller/click_outside_controller.js +4 -2
  40. package/build/esm/packages/phoenix/src/controllers/click_outside_controller/click_outside_controller.js.map +1 -1
  41. package/build/esm/packages/phoenix/src/controllers/click_outside_controller/click_outside_controller_types.d.ts +4 -0
  42. package/build/esm/packages/phoenix/src/global_constants.d.ts +8 -0
  43. package/build/esm/packages/phoenix/src/global_constants.js +11 -0
  44. package/build/esm/packages/phoenix/src/global_constants.js.map +1 -0
  45. package/build/esm/packages/phoenix/src/index.d.ts +1 -1
  46. package/build/esm/packages/phoenix/src/index.js +1 -1
  47. package/package.json +1 -1
  48. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +0 -66
  49. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.d.ts +0 -12
  50. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +0 -64
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var lit = require('lit');
7
+ var decorators = require('lit/decorators');
8
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
9
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
10
+ var backdrop_constants = require('./backdrop_constants.js');
11
+
12
+ exports.HBackdrop = class HBackdrop extends phoenix_light_lit_element.PhoenixLightLitElement {
13
+ constructor() {
14
+ super();
15
+ this.visible = false;
16
+ this.onClickArray = [];
17
+ this._backdropLayerCounter = 0;
18
+ this._appendBackdrop = () => {
19
+ const $backdrop = document.querySelector(backdrop_constants.BACKDROP_NAME);
20
+ if (!$backdrop) {
21
+ const $newBackdrop = document.createElement(backdrop_constants.BACKDROP_NAME);
22
+ document.body.appendChild($newBackdrop);
23
+ }
24
+ };
25
+ this._show = () => {
26
+ this._backdropLayerCounter += 1;
27
+ this.visible = true;
28
+ };
29
+ this._hide = () => {
30
+ this._backdropLayerCounter -= 1;
31
+ if (this._backdropLayerCounter !== 0)
32
+ return;
33
+ this.visible = false;
34
+ };
35
+ this._dispatchBackdropClickedEvent = () => {
36
+ const backdropClickedEvent = new CustomEvent(backdrop_constants.BACKDROP_EVENTS.clicked, {
37
+ bubbles: true
38
+ });
39
+ document.dispatchEvent(backdropClickedEvent);
40
+ };
41
+ this._appendBackdrop();
42
+ document.addEventListener(backdrop_constants.BACKDROP_EVENTS.show, this._show);
43
+ document.addEventListener(backdrop_constants.BACKDROP_EVENTS.hide, this._hide);
44
+ }
45
+ disconnectedCallback() {
46
+ super.disconnectedCallback();
47
+ document.removeEventListener(backdrop_constants.BACKDROP_EVENTS.show, this._show);
48
+ document.removeEventListener(backdrop_constants.BACKDROP_EVENTS.hide, this._hide);
49
+ }
50
+ updated() {
51
+ if (this.visible) {
52
+ this._disableScrolling();
53
+ }
54
+ else {
55
+ this._enableScrolling();
56
+ }
57
+ }
58
+ _disableScrolling() {
59
+ document.body.style.overflow = 'hidden';
60
+ document.body.style.paddingRight = '15px';
61
+ }
62
+ _enableScrolling() {
63
+ document.body.style.removeProperty('overflow');
64
+ document.body.style.removeProperty('padding-right');
65
+ }
66
+ render() {
67
+ return lit.html ` <div
68
+ aria-hidden="true"
69
+ ?hidden="${!this.visible}"
70
+ @click="${this._dispatchBackdropClickedEvent}"
71
+ class="${backdrop_constants.BACKDROP_CLASS}"
72
+ ></div>`;
73
+ }
74
+ };
75
+ tslib_es6.__decorate([
76
+ decorators.property({ type: Boolean }),
77
+ tslib_es6.__metadata("design:type", Object)
78
+ ], exports.HBackdrop.prototype, "visible", void 0);
79
+ tslib_es6.__decorate([
80
+ decorators.state(),
81
+ tslib_es6.__metadata("design:type", Array)
82
+ ], exports.HBackdrop.prototype, "onClickArray", void 0);
83
+ tslib_es6.__decorate([
84
+ decorators.state(),
85
+ tslib_es6.__metadata("design:type", Object)
86
+ ], exports.HBackdrop.prototype, "_backdropLayerCounter", void 0);
87
+ exports.HBackdrop = tslib_es6.__decorate([
88
+ phoenix_custom_element.phoenixCustomElement('h-backdrop'),
89
+ tslib_es6.__metadata("design:paramtypes", [])
90
+ ], exports.HBackdrop);
91
+ //# sourceMappingURL=backdrop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const BACKDROP_NAME = 'h-backdrop';
6
+ const BACKDROP_CLASS = 'backdrop';
7
+ const BACKDROP_EVENT = 'backdrop';
8
+ const BACKDROP_EVENTS = {
9
+ show: `${BACKDROP_EVENT}.show`,
10
+ hide: `${BACKDROP_EVENT}.hide`,
11
+ clicked: `${BACKDROP_EVENT}.clicked`
12
+ };
13
+
14
+ exports.BACKDROP_CLASS = BACKDROP_CLASS;
15
+ exports.BACKDROP_EVENTS = BACKDROP_EVENTS;
16
+ exports.BACKDROP_NAME = BACKDROP_NAME;
17
+ //# sourceMappingURL=backdrop_constants.js.map
@@ -0,0 +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;"}
@@ -8,7 +8,9 @@ var decorators = require('lit/decorators');
8
8
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
9
9
  var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
10
10
  var portal_constants = require('../portal/portal_constants.js');
11
+ var backdrop_constants = require('../backdrop/backdrop_constants.js');
11
12
  var dropdown_constants = require('./dropdown_constants.js');
13
+ var global_constants = require('../../global_constants.js');
12
14
  var click_outside_controller_messages = require('../../controllers/click_outside_controller/click_outside_controller_messages.js');
13
15
  var click_outside_controller = require('../../controllers/click_outside_controller/click_outside_controller.js');
14
16
  var relative_position_controller_constants = require('../../controllers/relative_position_controller/relative_position_controller_constants.js');
@@ -21,23 +23,86 @@ exports.HDropdown = class HDropdown extends phoenix_light_lit_element.PhoenixLig
21
23
  this.direction = relative_position_controller_constants.DIRECTIONS.bottomCenter;
22
24
  this.toggleOnHover = false;
23
25
  this.name = '';
26
+ this.transition = 'direction';
24
27
  this.portalTarget = dropdown_constants.DEFAULT_DROPDOWN_PORTAL_NAME;
25
28
  this.toggle = () => {
26
29
  this.opened ? this.hide() : this.show();
27
30
  };
28
- this.show = () => {
29
- this.opened = true;
31
+ this.show = async () => {
32
+ return new Promise((resolve) => {
33
+ var _a;
34
+ (_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.add(dropdown_constants.DROPDOWN_CONTENT_VISIBLE_CLASS, `${dropdown_constants.DROPDOWN_CONTENT_SHOW}-${this.transition}-start`);
35
+ window.requestAnimationFrame(() => {
36
+ setTimeout(() => {
37
+ var _a;
38
+ (_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.add(`${dropdown_constants.DROPDOWN_CONTENT_SHOW}-${this.transition}-end`);
39
+ }, 0);
40
+ const transitionDuration = parseFloat(getComputedStyle(this.$dropdownContent || this).transitionDuration) * 1000;
41
+ setTimeout(() => {
42
+ var _a;
43
+ this.opened = true;
44
+ this._dispatchShowDropdownEvent();
45
+ (_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.remove(`${dropdown_constants.DROPDOWN_CONTENT_SHOW}-${this.transition}-start`, `${dropdown_constants.DROPDOWN_CONTENT_SHOW}-${this.transition}-end`);
46
+ resolve();
47
+ }, transitionDuration);
48
+ });
49
+ });
50
+ };
51
+ this._dispatchShowDropdownEvent = () => {
30
52
  const showDropdownEvent = new Event(dropdown_constants.DROPDOWN_EVENTS.show, {
31
53
  bubbles: true
32
54
  });
33
55
  this.dispatchEvent(showDropdownEvent);
56
+ if (window.innerWidth >= global_constants.BREAKPOINTS.xs)
57
+ return;
58
+ const showBackdropEvent = new Event(backdrop_constants.BACKDROP_EVENTS.show, {
59
+ bubbles: true
60
+ });
61
+ document.dispatchEvent(showBackdropEvent);
34
62
  };
35
- this.hide = () => {
36
- this.opened = false;
63
+ this.hide = async () => new Promise((resolve) => {
64
+ const transitionDuration = parseFloat(getComputedStyle(this.$dropdownContent || this).transitionDuration) * 1000;
65
+ window.requestAnimationFrame(() => {
66
+ var _a, _b;
67
+ (_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.remove(`${dropdown_constants.DROPDOWN_CONTENT_HIDE}-${this.transition}-start`);
68
+ (_b = this.$dropdownContent) === null || _b === void 0 ? void 0 : _b.classList.add(`${dropdown_constants.DROPDOWN_CONTENT_HIDE}-${this.transition}-end`);
69
+ setTimeout(() => {
70
+ var _a;
71
+ (_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.classList.remove(`${dropdown_constants.DROPDOWN_CONTENT_HIDE}-${this.transition}-start`, `${dropdown_constants.DROPDOWN_CONTENT_HIDE}-${this.transition}-end`);
72
+ this.opened = false;
73
+ this._dispatchHideDropdownEvent();
74
+ resolve();
75
+ }, transitionDuration);
76
+ });
77
+ });
78
+ this._dispatchHideDropdownEvent = () => {
37
79
  const hideDropdownEvent = new Event(dropdown_constants.DROPDOWN_EVENTS.hide, {
38
80
  bubbles: true
39
81
  });
40
82
  this.dispatchEvent(hideDropdownEvent);
83
+ if (window.innerWidth >= global_constants.BREAKPOINTS.xs)
84
+ return;
85
+ const hideBackdropEvent = new Event(backdrop_constants.BACKDROP_EVENTS.hide, {
86
+ bubbles: true
87
+ });
88
+ document.dispatchEvent(hideBackdropEvent);
89
+ };
90
+ this._hoverToggle = async (ev) => {
91
+ if (window.innerWidth < global_constants.BREAKPOINTS.xs)
92
+ return;
93
+ if (!ev.target) {
94
+ await this.hide();
95
+ return;
96
+ }
97
+ const isHoveredWithinDropdown = this._isHoveredWithinDropdown(ev.target);
98
+ if (isHoveredWithinDropdown && !this.opened) {
99
+ await this.show();
100
+ return;
101
+ }
102
+ if (!isHoveredWithinDropdown && this.opened) {
103
+ await this.hide();
104
+ return;
105
+ }
41
106
  };
42
107
  this._positionDropdownContent = () => {
43
108
  requestAnimationFrame(() => {
@@ -52,6 +117,9 @@ exports.HDropdown = class HDropdown extends phoenix_light_lit_element.PhoenixLig
52
117
  this.$dropdownContent = this.querySelector(dropdown_constants.DROPDOWN_CONTENT_NAME);
53
118
  if (!this.$dropdownToggler)
54
119
  this.$dropdownToggler = this.querySelector(dropdown_constants.DROPDOWN_TOGGLER_NAME);
120
+ const nestedDropdown = this.$dropdownContent.querySelector(dropdown_constants.DROPDOWN_CONTAINER_NAME);
121
+ if (nestedDropdown)
122
+ this.$nestedDropdownContent = nestedDropdown.querySelector(dropdown_constants.DROPDOWN_CONTENT_NAME);
55
123
  if (!this._positionController)
56
124
  this._positionController = new relative_position_controller.RelativePositionController({
57
125
  host: this,
@@ -67,15 +135,6 @@ exports.HDropdown = class HDropdown extends phoenix_light_lit_element.PhoenixLig
67
135
  });
68
136
  this._setupListeners();
69
137
  }
70
- _setupListeners() {
71
- var _a, _b, _c;
72
- this.addEventListener(click_outside_controller_messages.CLICK_OUTSIDE_CONTROLLER_MESSAGES.clickedOutside, this._handleClickOutside);
73
- (_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.addEventListener('toggle', this.toggle);
74
- if (this.toggleOnHover) {
75
- (_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.addEventListener('mouseenter', this.show);
76
- (_c = this.$dropdownToggler) === null || _c === void 0 ? void 0 : _c.addEventListener('mouseleave', this.hide);
77
- }
78
- }
79
138
  _appendDropdownPortal() {
80
139
  const $dropdownPortalTarget = document.querySelector(`[name="${dropdown_constants.DEFAULT_DROPDOWN_PORTAL_NAME}"]`);
81
140
  if (!$dropdownPortalTarget) {
@@ -84,22 +143,40 @@ exports.HDropdown = class HDropdown extends phoenix_light_lit_element.PhoenixLig
84
143
  document.body.appendChild($portalTarget);
85
144
  }
86
145
  }
87
- _handleClickOutside() {
146
+ _setupListeners() {
88
147
  var _a;
148
+ this.addEventListener(click_outside_controller_messages.CLICK_OUTSIDE_CONTROLLER_MESSAGES.clickedOutside, this._handleClickOutside);
149
+ (_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.addEventListener('toggle', this.toggle);
150
+ if (this.toggleOnHover)
151
+ document.addEventListener('mouseover', this._hoverToggle);
152
+ }
153
+ _handleClickOutside(ev) {
154
+ var _a, _b;
89
155
  if (!this.opened)
90
156
  return;
91
- this.hide();
92
- (_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.setAttribute('aria-expanded', 'false');
157
+ const target = ev.detail.target;
158
+ const clickedWithinNestedDropdown = this.$nestedDropdownContent && this.$nestedDropdownContent.contains(target);
159
+ const shouldHideElements = !((_a = this.$dropdownContent) === null || _a === void 0 ? void 0 : _a.contains(target)) && !this.contains(target) && !clickedWithinNestedDropdown;
160
+ if (shouldHideElements) {
161
+ this.hide();
162
+ (_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.setAttribute('aria-expanded', 'false');
163
+ }
164
+ }
165
+ _isHoveredWithinDropdown(element) {
166
+ const isDescendantOfDropdown = element.closest(`${dropdown_constants.DROPDOWN_CONTAINER_NAME}[name="${this.name}"]`) !== null;
167
+ const isDescendantOfContent = this.$dropdownContent && element.closest(`${dropdown_constants.DROPDOWN_CONTENT_NAME}[name="${this.name}"]`) !== null;
168
+ return isDescendantOfDropdown || isDescendantOfContent || element === this || element === this.$dropdownContent;
93
169
  }
94
170
  disconnectedCallback() {
95
- var _a, _b, _c;
171
+ var _a;
96
172
  super.disconnectedCallback();
97
173
  (_a = this.$dropdownToggler) === null || _a === void 0 ? void 0 : _a.removeEventListener('toggle', this.toggle);
98
- if (this.toggleOnHover) {
99
- (_b = this.$dropdownToggler) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseenter', this.show);
100
- (_c = this.$dropdownToggler) === null || _c === void 0 ? void 0 : _c.removeEventListener('mouseleave', this.hide);
174
+ if (this.toggleOnHover)
175
+ document.removeEventListener('mouseover', this._hoverToggle);
176
+ if (this.opened) {
177
+ this.opened = false;
178
+ this._dispatchHideDropdownEvent();
101
179
  }
102
- this.opened = false;
103
180
  }
104
181
  render() {
105
182
  super.render();
@@ -127,6 +204,10 @@ tslib_es6.__decorate([
127
204
  decorators.property({ type: String }),
128
205
  tslib_es6.__metadata("design:type", Object)
129
206
  ], exports.HDropdown.prototype, "name", void 0);
207
+ tslib_es6.__decorate([
208
+ decorators.property({ type: String }),
209
+ tslib_es6.__metadata("design:type", Object)
210
+ ], exports.HDropdown.prototype, "transition", void 0);
130
211
  tslib_es6.__decorate([
131
212
  decorators.property({ type: String }),
132
213
  tslib_es6.__metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -14,15 +14,23 @@ const DROPDOWN_EVENTS = {
14
14
  };
15
15
  const DROPDOWN_OPENED_ATTRIBUTE_NAME = 'opened';
16
16
  const DROPDOWN_CLASS = 'dropdown';
17
- const DROPDOWN_CONTENT_CLASS = `${DROPDOWN_CLASS}__content`;
17
+ const DROPDOWN_CONTENT_CLASS = `${DROPDOWN_CLASS}__content`;
18
+ const DROPDOWN_TOGGLER_CLASS = `${DROPDOWN_CLASS}__toggler`;
19
+ const DROPDOWN_CONTENT_VISIBLE_CLASS = `${DROPDOWN_CONTENT_CLASS}_visible`;
20
+ const DROPDOWN_CONTENT_SHOW = `${DROPDOWN_CONTENT_CLASS}_show`;
21
+ const DROPDOWN_CONTENT_HIDE = `${DROPDOWN_CONTENT_CLASS}_hide`;
18
22
 
19
23
  exports.DEFAULT_DROPDOWN_PORTAL_NAME = DEFAULT_DROPDOWN_PORTAL_NAME;
20
24
  exports.DROPDOWN_CLASS = DROPDOWN_CLASS;
21
25
  exports.DROPDOWN_CONTAINER_NAME = DROPDOWN_CONTAINER_NAME;
22
26
  exports.DROPDOWN_CONTENT_CLASS = DROPDOWN_CONTENT_CLASS;
27
+ exports.DROPDOWN_CONTENT_HIDE = DROPDOWN_CONTENT_HIDE;
23
28
  exports.DROPDOWN_CONTENT_NAME = DROPDOWN_CONTENT_NAME;
29
+ exports.DROPDOWN_CONTENT_SHOW = DROPDOWN_CONTENT_SHOW;
30
+ exports.DROPDOWN_CONTENT_VISIBLE_CLASS = DROPDOWN_CONTENT_VISIBLE_CLASS;
24
31
  exports.DROPDOWN_EVENTS = DROPDOWN_EVENTS;
25
32
  exports.DROPDOWN_NAME = DROPDOWN_NAME;
26
33
  exports.DROPDOWN_OPENED_ATTRIBUTE_NAME = DROPDOWN_OPENED_ATTRIBUTE_NAME;
34
+ exports.DROPDOWN_TOGGLER_CLASS = DROPDOWN_TOGGLER_CLASS;
27
35
  exports.DROPDOWN_TOGGLER_NAME = DROPDOWN_TOGGLER_NAME;
28
36
  //# sourceMappingURL=dropdown_constants.js.map
@@ -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;"}
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;"}
@@ -23,6 +23,7 @@ exports.HDropdownToggler = class HDropdownToggler extends phoenix_light_lit_elem
23
23
  this._toggleElementAriaController.toggleAriaExpandedAttribute();
24
24
  };
25
25
  this.slot = this.hasAttribute('slot') ? this.slot : 'toggler';
26
+ this.className = `${dropdown_constants.DROPDOWN_TOGGLER_CLASS} ${this.className}`;
26
27
  }
27
28
  connectedCallback() {
28
29
  super.connectedCallback();
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -10,6 +10,7 @@ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_eleme
10
10
  var portal_constants = require('../portal/portal_constants.js');
11
11
  var modal_constants = require('./modal_constants.js');
12
12
  var ref = require('../../../../../external/lit-html/directives/ref.js');
13
+ var backdrop_constants = require('../backdrop/backdrop_constants.js');
13
14
 
14
15
  var HModal_1;
15
16
  exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.PhoenixLightLitElement {
@@ -93,26 +94,21 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
93
94
  document.body.appendChild($portalTarget);
94
95
  }
95
96
  }
96
- static _appendModalsBackdrop() {
97
- const $modalsBackdrop = document.querySelector('h-modal-backdrop');
98
- if (!$modalsBackdrop) {
99
- const $backdrop = document.createElement('h-modal-backdrop');
100
- document.body.appendChild($backdrop);
101
- }
102
- }
103
97
  static isSomeModalOpen() {
104
98
  return HModal_1.openModals.some((modal) => modal.opened);
105
99
  }
106
100
  connectedCallback() {
107
101
  super.connectedCallback();
108
102
  HModal_1._appendModalsPortal();
109
- HModal_1._appendModalsBackdrop();
110
103
  document.addEventListener('keydown', this._keepFocusWithinModal);
111
104
  document.addEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
112
105
  }
113
106
  disconnectedCallback() {
114
107
  super.disconnectedCallback();
115
- this[modal_constants.MODAL_OPENED_PROP] = false;
108
+ if (this[modal_constants.MODAL_OPENED_PROP]) {
109
+ this[modal_constants.MODAL_OPENED_PROP] = false;
110
+ this._dispatchModalClosedEvent();
111
+ }
116
112
  document.removeEventListener(modal_constants.MODAL_EVENTS.close, this._handleCloseFromCloseComponent);
117
113
  document.removeEventListener('keydown', this._bindCloseOnEsc);
118
114
  }
@@ -139,7 +135,6 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
139
135
  setTimeout(() => {
140
136
  var _a;
141
137
  this[modal_constants.MODAL_OPENED_PROP] = true;
142
- this._dispatchModalOpenedEvent();
143
138
  (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
144
139
  resolve();
145
140
  }, transitionDuration);
@@ -151,6 +146,10 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
151
146
  bubbles: true
152
147
  });
153
148
  this.dispatchEvent(openModalEvent);
149
+ const openBackdropEvent = new CustomEvent(backdrop_constants.BACKDROP_EVENTS.show, {
150
+ bubbles: true
151
+ });
152
+ document.dispatchEvent(openBackdropEvent);
154
153
  }
155
154
  async close() {
156
155
  return new Promise((resolve) => {
@@ -174,6 +173,10 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
174
173
  bubbles: true
175
174
  });
176
175
  this.dispatchEvent(closeModalEvent);
176
+ const closeBackdropEvent = new CustomEvent(backdrop_constants.BACKDROP_EVENTS.hide, {
177
+ bubbles: true
178
+ });
179
+ document.dispatchEvent(closeBackdropEvent);
177
180
  }
178
181
  render() {
179
182
  return lit.html `
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oDAAwD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,oDAAwD;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -19,8 +19,10 @@ class ClickOutsideController {
19
19
  name: this._name
20
20
  }
21
21
  });
22
- const { target } = ev;
23
- if (target.contains(tslib_es6.__classPrivateFieldGet(this, _ClickOutsideController_container, "f"))) {
22
+ const target = ev.target;
23
+ const isContainerWithinTarget = target.contains(tslib_es6.__classPrivateFieldGet(this, _ClickOutsideController_container, "f")) && target !== tslib_es6.__classPrivateFieldGet(this, _ClickOutsideController_container, "f");
24
+ const isTargetWithinContainer = tslib_es6.__classPrivateFieldGet(this, _ClickOutsideController_container, "f").contains(target);
25
+ if (isContainerWithinTarget || !isTargetWithinContainer) {
24
26
  tslib_es6.__classPrivateFieldGet(this, _ClickOutsideController_host, "f").dispatchEvent(clickedOutsideEvent);
25
27
  }
26
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const BREAKPOINTS = {
6
+ xs: 576,
7
+ sm: 768,
8
+ md: 1000,
9
+ lg: 1200,
10
+ xl: 1440,
11
+ xxl: 1920
12
+ };
13
+
14
+ exports.BREAKPOINTS = BREAKPOINTS;
15
+ //# sourceMappingURL=global_constants.js.map
@@ -0,0 +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;"}
@@ -10,7 +10,6 @@ var portal_target = require('./components/portal/portal_target.js');
10
10
  var portal = require('./components/portal/portal.js');
11
11
  var modal = require('./components/modal/modal.js');
12
12
  var modal_opener = require('./components/modal/modal_opener.js');
13
- var modal_backdrop = require('./components/modal/modal_backdrop.js');
14
13
  var modal_body = require('./components/modal/modal_body.js');
15
14
  var modal_footer = require('./components/modal/modal_footer.js');
16
15
  var modal_header = require('./components/modal/modal_header.js');
@@ -23,6 +22,7 @@ var dropdown = require('./components/dropdown/dropdown.js');
23
22
  var toggle_element_aria_controller = require('./controllers/toggle_element_aria_controller/toggle_element_aria_controller.js');
24
23
  var dropdown_toggler = require('./components/dropdown/dropdown_toggler.js');
25
24
  var dropdown_content = require('./components/dropdown/dropdown_content.js');
25
+ var backdrop = require('./components/backdrop/backdrop.js');
26
26
 
27
27
 
28
28
 
@@ -59,12 +59,6 @@ Object.defineProperty(exports, 'HModalOpener', {
59
59
  return modal_opener.HModalOpener;
60
60
  }
61
61
  });
62
- Object.defineProperty(exports, 'HModalBackdrop', {
63
- enumerable: true,
64
- get: function () {
65
- return modal_backdrop.HModalBackdrop;
66
- }
67
- });
68
62
  Object.defineProperty(exports, 'HModalBody', {
69
63
  enumerable: true,
70
64
  get: function () {
@@ -112,4 +106,10 @@ Object.defineProperty(exports, 'HDropdownContent', {
112
106
  return dropdown_content.HDropdownContent;
113
107
  }
114
108
  });
109
+ Object.defineProperty(exports, 'HBackdrop', {
110
+ enumerable: true,
111
+ get: function () {
112
+ return backdrop.HBackdrop;
113
+ }
114
+ });
115
115
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,17 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element";
3
+ export declare class HBackdrop extends PhoenixLightLitElement {
4
+ visible: boolean;
5
+ onClickArray: (() => void)[];
6
+ private _backdropLayerCounter;
7
+ constructor();
8
+ disconnectedCallback(): void;
9
+ private _appendBackdrop;
10
+ private _show;
11
+ private _hide;
12
+ protected updated(): void;
13
+ private _disableScrolling;
14
+ private _enableScrolling;
15
+ private _dispatchBackdropClickedEvent;
16
+ protected render(): TemplateResult;
17
+ }
@@ -0,0 +1,89 @@
1
+ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
+ import { html } from 'lit';
3
+ import { property, state } from 'lit/decorators';
4
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
6
+ import { BACKDROP_NAME, BACKDROP_EVENTS, BACKDROP_CLASS } from './backdrop_constants.js';
7
+
8
+ let HBackdrop = class HBackdrop extends PhoenixLightLitElement {
9
+ constructor() {
10
+ super();
11
+ this.visible = false;
12
+ this.onClickArray = [];
13
+ this._backdropLayerCounter = 0;
14
+ this._appendBackdrop = () => {
15
+ const $backdrop = document.querySelector(BACKDROP_NAME);
16
+ if (!$backdrop) {
17
+ const $newBackdrop = document.createElement(BACKDROP_NAME);
18
+ document.body.appendChild($newBackdrop);
19
+ }
20
+ };
21
+ this._show = () => {
22
+ this._backdropLayerCounter += 1;
23
+ this.visible = true;
24
+ };
25
+ this._hide = () => {
26
+ this._backdropLayerCounter -= 1;
27
+ if (this._backdropLayerCounter !== 0)
28
+ return;
29
+ this.visible = false;
30
+ };
31
+ this._dispatchBackdropClickedEvent = () => {
32
+ const backdropClickedEvent = new CustomEvent(BACKDROP_EVENTS.clicked, {
33
+ bubbles: true
34
+ });
35
+ document.dispatchEvent(backdropClickedEvent);
36
+ };
37
+ this._appendBackdrop();
38
+ document.addEventListener(BACKDROP_EVENTS.show, this._show);
39
+ document.addEventListener(BACKDROP_EVENTS.hide, this._hide);
40
+ }
41
+ disconnectedCallback() {
42
+ super.disconnectedCallback();
43
+ document.removeEventListener(BACKDROP_EVENTS.show, this._show);
44
+ document.removeEventListener(BACKDROP_EVENTS.hide, this._hide);
45
+ }
46
+ updated() {
47
+ if (this.visible) {
48
+ this._disableScrolling();
49
+ }
50
+ else {
51
+ this._enableScrolling();
52
+ }
53
+ }
54
+ _disableScrolling() {
55
+ document.body.style.overflow = 'hidden';
56
+ document.body.style.paddingRight = '15px';
57
+ }
58
+ _enableScrolling() {
59
+ document.body.style.removeProperty('overflow');
60
+ document.body.style.removeProperty('padding-right');
61
+ }
62
+ render() {
63
+ return html ` <div
64
+ aria-hidden="true"
65
+ ?hidden="${!this.visible}"
66
+ @click="${this._dispatchBackdropClickedEvent}"
67
+ class="${BACKDROP_CLASS}"
68
+ ></div>`;
69
+ }
70
+ };
71
+ __decorate([
72
+ property({ type: Boolean }),
73
+ __metadata("design:type", Object)
74
+ ], HBackdrop.prototype, "visible", void 0);
75
+ __decorate([
76
+ state(),
77
+ __metadata("design:type", Array)
78
+ ], HBackdrop.prototype, "onClickArray", void 0);
79
+ __decorate([
80
+ state(),
81
+ __metadata("design:type", Object)
82
+ ], HBackdrop.prototype, "_backdropLayerCounter", void 0);
83
+ HBackdrop = __decorate([
84
+ phoenixCustomElement('h-backdrop'),
85
+ __metadata("design:paramtypes", [])
86
+ ], HBackdrop);
87
+
88
+ export { HBackdrop };
89
+ //# sourceMappingURL=backdrop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,7 @@
1
+ export declare const BACKDROP_NAME = "h-backdrop";
2
+ export declare const BACKDROP_CLASS = "backdrop";
3
+ export declare const BACKDROP_EVENTS: {
4
+ show: string;
5
+ hide: string;
6
+ clicked: string;
7
+ };
@@ -0,0 +1,11 @@
1
+ const BACKDROP_NAME = 'h-backdrop';
2
+ const BACKDROP_CLASS = 'backdrop';
3
+ const BACKDROP_EVENT = 'backdrop';
4
+ const BACKDROP_EVENTS = {
5
+ show: `${BACKDROP_EVENT}.show`,
6
+ hide: `${BACKDROP_EVENT}.hide`,
7
+ clicked: `${BACKDROP_EVENT}.clicked`
8
+ };
9
+
10
+ export { BACKDROP_CLASS, BACKDROP_EVENTS, BACKDROP_NAME };
11
+ //# sourceMappingURL=backdrop_constants.js.map