@shoper/phoenix_design_system 0.5.0 → 0.6.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 (51) hide show
  1. package/build/cjs/packages/phoenix/src/components/modal/modal.js +34 -39
  2. package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
  3. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +3 -2
  4. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -1
  5. package/build/cjs/packages/phoenix/src/components/modal/modal_body.js +2 -2
  6. package/build/cjs/packages/phoenix/src/components/modal/modal_close.js +2 -2
  7. package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js +2 -2
  8. package/build/cjs/packages/phoenix/src/components/modal/modal_header.js +2 -2
  9. package/build/cjs/packages/phoenix/src/components/modal/modal_opener.js +2 -1
  10. package/build/cjs/packages/phoenix/src/components/modal/modal_opener.js.map +1 -1
  11. package/build/cjs/packages/phoenix/src/components/portal/portal.js +2 -1
  12. package/build/cjs/packages/phoenix/src/components/portal/portal.js.map +1 -1
  13. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js +2 -1
  14. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  15. package/build/cjs/packages/phoenix/src/controllers/btn_controller.js +28 -0
  16. package/build/cjs/packages/phoenix/src/controllers/btn_controller.js.map +1 -0
  17. package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js +58 -0
  18. package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +1 -0
  19. package/build/cjs/packages/phoenix/src/hello_button.js +2 -1
  20. package/build/cjs/packages/phoenix/src/hello_button.js.map +1 -1
  21. package/build/cjs/packages/phoenix/src/index.js +2 -0
  22. package/build/cjs/packages/phoenix/src/index.js.map +1 -1
  23. package/build/esm/packages/phoenix/src/components/modal/modal.js +35 -40
  24. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
  25. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +4 -3
  26. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -1
  27. package/build/esm/packages/phoenix/src/components/modal/modal_body.js +2 -2
  28. package/build/esm/packages/phoenix/src/components/modal/modal_close.js +2 -2
  29. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +2 -2
  30. package/build/esm/packages/phoenix/src/components/modal/modal_header.js +2 -2
  31. package/build/esm/packages/phoenix/src/components/modal/modal_opener.js +3 -2
  32. package/build/esm/packages/phoenix/src/components/modal/modal_opener.js.map +1 -1
  33. package/build/esm/packages/phoenix/src/components/portal/portal.js +3 -2
  34. package/build/esm/packages/phoenix/src/components/portal/portal.js.map +1 -1
  35. package/build/esm/packages/phoenix/src/components/portal/portal_target.js +3 -2
  36. package/build/esm/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  37. package/build/esm/packages/phoenix/src/controllers/btn_controller.d.ts +8 -0
  38. package/build/esm/packages/phoenix/src/controllers/btn_controller.js +24 -0
  39. package/build/esm/packages/phoenix/src/controllers/btn_controller.js.map +1 -0
  40. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.d.ts +21 -0
  41. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js +54 -0
  42. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +1 -0
  43. package/build/esm/packages/phoenix/src/global_types.d.ts +25 -0
  44. package/build/esm/packages/phoenix/src/global_types.js +2 -0
  45. package/build/esm/packages/phoenix/src/global_types.js.map +1 -0
  46. package/build/esm/packages/phoenix/src/hello_button.js +3 -2
  47. package/build/esm/packages/phoenix/src/hello_button.js.map +1 -1
  48. package/build/esm/packages/phoenix/src/index.d.ts +2 -0
  49. package/build/esm/packages/phoenix/src/index.js +1 -0
  50. package/build/esm/packages/phoenix/src/index.js.map +1 -1
  51. package/package.json +1 -1
@@ -6,6 +6,7 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  var lit = require('lit');
7
7
  var decorators = require('lit/decorators');
8
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');
9
10
  var portal_constants = require('../portal/portal_constants.js');
10
11
  var modal_constants = require('./modal_constants.js');
11
12
  var ref = require('../../../../../external/lit-html/directives/ref.js');
@@ -58,14 +59,14 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
58
59
  }
59
60
  }
60
61
  };
61
- this._handleCloseFromCloseComponent = (ev) => {
62
+ this._handleCloseFromCloseComponent = async (ev) => {
62
63
  var _a;
63
64
  ev.stopPropagation();
64
65
  if ((_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.contains(ev.target)) {
65
- this.close();
66
+ await this.close();
66
67
  }
67
68
  };
68
- this._bindCloseOnEsc = (ev) => {
69
+ this._bindCloseOnEsc = async (ev) => {
69
70
  ev.stopImmediatePropagation();
70
71
  const $target = ev.target;
71
72
  const closeConditions = [
@@ -78,7 +79,7 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
78
79
  const shouldCloseModal = closeConditions.every((condition) => condition);
79
80
  if (shouldCloseModal) {
80
81
  const [modalToClose] = HModal_1.openModals.slice(-1);
81
- modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close();
82
+ await (modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close());
82
83
  }
83
84
  };
84
85
  this.hidden = true;
@@ -128,24 +129,21 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
128
129
  async open() {
129
130
  return new Promise((resolve) => {
130
131
  var _a;
131
- if (!this[modal_constants.MODAL_OPENED_PROP]) {
132
- this[modal_constants.MODAL_OPENED_PROP] = true;
133
- this._dispatchModalOpenedEvent();
134
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_visible`, `modal_show-${this.transition}-start`);
135
- window.requestAnimationFrame(() => {
136
- setTimeout(() => {
137
- var _a;
138
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_show-${this.transition}-end`);
139
- }, 0);
140
- const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
141
- setTimeout(() => {
142
- var _a;
143
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
144
- resolve();
145
- }, transitionDuration);
146
- });
147
- }
148
- resolve();
132
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_visible`, `modal_show-${this.transition}-start`);
133
+ window.requestAnimationFrame(() => {
134
+ setTimeout(() => {
135
+ var _a;
136
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_show-${this.transition}-end`);
137
+ }, 0);
138
+ const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
139
+ setTimeout(() => {
140
+ var _a;
141
+ this[modal_constants.MODAL_OPENED_PROP] = true;
142
+ this._dispatchModalOpenedEvent();
143
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
144
+ resolve();
145
+ }, transitionDuration);
146
+ });
149
147
  });
150
148
  }
151
149
  _dispatchModalOpenedEvent() {
@@ -156,22 +154,19 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
156
154
  }
157
155
  async close() {
158
156
  return new Promise((resolve) => {
159
- if (this[modal_constants.MODAL_OPENED_PROP]) {
160
- const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
161
- window.requestAnimationFrame(() => {
162
- var _a, _b;
163
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
164
- (_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
165
- setTimeout(() => {
166
- var _a;
167
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
168
- this[modal_constants.MODAL_OPENED_PROP] = false;
169
- this._dispatchModalClosedEvent();
170
- resolve();
171
- }, transitionDuration);
172
- });
173
- }
174
- resolve();
157
+ const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
158
+ window.requestAnimationFrame(() => {
159
+ var _a, _b;
160
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
161
+ (_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
162
+ setTimeout(() => {
163
+ var _a;
164
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
165
+ this[modal_constants.MODAL_OPENED_PROP] = false;
166
+ this._dispatchModalClosedEvent();
167
+ resolve();
168
+ }, transitionDuration);
169
+ });
175
170
  });
176
171
  }
177
172
  _dispatchModalClosedEvent() {
@@ -220,7 +215,7 @@ tslib_es6.__decorate([
220
215
  tslib_es6.__metadata("design:type", Object)
221
216
  ], exports.HModal.prototype, "_lastFocusableElement", void 0);
222
217
  exports.HModal = HModal_1 = tslib_es6.__decorate([
223
- decorators.customElement('h-modal'),
218
+ phoenix_custom_element.phoenixCustomElement('h-modal'),
224
219
  tslib_es6.__metadata("design:paramtypes", [])
225
220
  ], exports.HModal);
226
221
  //# sourceMappingURL=modal.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,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;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;"}
@@ -6,6 +6,7 @@ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  var lit = require('lit');
7
7
  var decorators = require('lit/decorators');
8
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');
9
10
  var modal_constants = require('./modal_constants.js');
10
11
  var modal = require('./modal.js');
11
12
 
@@ -52,7 +53,7 @@ exports.HModalBackdrop = class HModalBackdrop extends phoenix_light_lit_element.
52
53
  document.body.style.removeProperty('padding-right');
53
54
  }
54
55
  render() {
55
- return lit.html `<div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
56
+ return lit.html ` <div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
56
57
  }
57
58
  };
58
59
  tslib_es6.__decorate([
@@ -60,6 +61,6 @@ tslib_es6.__decorate([
60
61
  tslib_es6.__metadata("design:type", Object)
61
62
  ], exports.HModalBackdrop.prototype, "visible", void 0);
62
63
  exports.HModalBackdrop = tslib_es6.__decorate([
63
- decorators.customElement('h-modal-backdrop')
64
+ phoenix_custom_element.phoenixCustomElement('h-modal-backdrop')
64
65
  ], exports.HModalBackdrop);
65
66
  //# sourceMappingURL=modal_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;"}
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;"}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var decorators = require('lit/decorators');
7
6
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
8
 
9
9
  exports.HModalBody = class HModalBody extends phoenix_light_lit_element.PhoenixLightLitElement {
10
10
  constructor() {
@@ -14,7 +14,7 @@ exports.HModalBody = class HModalBody extends phoenix_light_lit_element.PhoenixL
14
14
  }
15
15
  };
16
16
  exports.HModalBody = tslib_es6.__decorate([
17
- decorators.customElement('h-modal-body'),
17
+ phoenix_custom_element.phoenixCustomElement('h-modal-body'),
18
18
  tslib_es6.__metadata("design:paramtypes", [])
19
19
  ], exports.HModalBody);
20
20
  //# sourceMappingURL=modal_body.js.map
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var decorators = require('lit/decorators');
7
6
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
8
  var modal_constants = require('./modal_constants.js');
9
9
 
10
10
  exports.HModalClose = class HModalClose extends phoenix_light_lit_element.PhoenixLightLitElement {
@@ -35,7 +35,7 @@ exports.HModalClose = class HModalClose extends phoenix_light_lit_element.Phoeni
35
35
  }
36
36
  };
37
37
  exports.HModalClose = tslib_es6.__decorate([
38
- decorators.customElement('h-modal-close'),
38
+ phoenix_custom_element.phoenixCustomElement('h-modal-close'),
39
39
  tslib_es6.__metadata("design:paramtypes", [])
40
40
  ], exports.HModalClose);
41
41
  //# sourceMappingURL=modal_close.js.map
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var decorators = require('lit/decorators');
7
6
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
8
 
9
9
  exports.HModalFooter = class HModalFooter extends phoenix_light_lit_element.PhoenixLightLitElement {
10
10
  constructor() {
@@ -14,7 +14,7 @@ exports.HModalFooter = class HModalFooter extends phoenix_light_lit_element.Phoe
14
14
  }
15
15
  };
16
16
  exports.HModalFooter = tslib_es6.__decorate([
17
- decorators.customElement('h-modal-footer'),
17
+ phoenix_custom_element.phoenixCustomElement('h-modal-footer'),
18
18
  tslib_es6.__metadata("design:paramtypes", [])
19
19
  ], exports.HModalFooter);
20
20
  //# sourceMappingURL=modal_footer.js.map
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
- var decorators = require('lit/decorators');
7
6
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
7
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
8
 
9
9
  exports.HModalHeader = class HModalHeader extends phoenix_light_lit_element.PhoenixLightLitElement {
10
10
  constructor() {
@@ -14,7 +14,7 @@ exports.HModalHeader = class HModalHeader extends phoenix_light_lit_element.Phoe
14
14
  }
15
15
  };
16
16
  exports.HModalHeader = tslib_es6.__decorate([
17
- decorators.customElement('h-modal-header'),
17
+ phoenix_custom_element.phoenixCustomElement('h-modal-header'),
18
18
  tslib_es6.__metadata("design:paramtypes", [])
19
19
  ], exports.HModalHeader);
20
20
  //# sourceMappingURL=modal_header.js.map
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  var decorators = require('lit/decorators');
7
7
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
9
 
9
10
  exports.HModalOpener = class HModalOpener extends phoenix_light_lit_element.PhoenixLightLitElement {
10
11
  constructor() {
@@ -37,7 +38,7 @@ tslib_es6.__decorate([
37
38
  tslib_es6.__metadata("design:type", Object)
38
39
  ], exports.HModalOpener.prototype, "name", void 0);
39
40
  exports.HModalOpener = tslib_es6.__decorate([
40
- decorators.customElement('h-modal-opener'),
41
+ phoenix_custom_element.phoenixCustomElement('h-modal-opener'),
41
42
  tslib_es6.__metadata("design:paramtypes", [])
42
43
  ], exports.HModalOpener);
43
44
  //# sourceMappingURL=modal_opener.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;"}
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;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  var decorators = require('lit/decorators');
7
7
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
9
  var portal_constants = require('./portal_constants.js');
9
10
  var v4 = require('../../../../../external/uuid/dist/esm-browser/v4.js');
10
11
 
@@ -79,7 +80,7 @@ tslib_es6.__decorate([
79
80
  tslib_es6.__metadata("design:type", Object)
80
81
  ], exports.HPortal.prototype, "disabled", void 0);
81
82
  exports.HPortal = tslib_es6.__decorate([
82
- decorators.customElement('h-portal'),
83
+ phoenix_custom_element.phoenixCustomElement('h-portal'),
83
84
  tslib_es6.__metadata("design:paramtypes", [])
84
85
  ], exports.HPortal);
85
86
  //# sourceMappingURL=portal.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,iBAAiB,qDAAyD;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;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;AACxE;AACA;AACA;AACA;AACA,iBAAiB,qDAAyD;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;"}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
6
  var decorators = require('lit/decorators');
7
7
  var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element.js');
8
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
8
9
  var portal_target_error = require('./portal_target_error.js');
9
10
  var portal_constants = require('./portal_constants.js');
10
11
 
@@ -71,6 +72,6 @@ tslib_es6.__decorate([
71
72
  tslib_es6.__metadata("design:type", Object)
72
73
  ], exports.HPortalTarget.prototype, "_portalElementsMap", void 0);
73
74
  exports.HPortalTarget = HPortalTarget_1 = tslib_es6.__decorate([
74
- decorators.customElement('h-portal-target')
75
+ phoenix_custom_element.phoenixCustomElement('h-portal-target')
75
76
  ], exports.HPortalTarget);
76
77
  //# sourceMappingURL=portal_target.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;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;"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('lit');
6
+
7
+ class BtnController {
8
+ constructor(host, callback) {
9
+ (this.host = host).addController(this);
10
+ this.host.tabIndex = 0;
11
+ this.host.setAttribute('role', 'button');
12
+ this.callback = (ev) => {
13
+ const isEnterOrSpacebarPressed = ev.code === 'Enter' || ev.code === 'Space';
14
+ if (isEnterOrSpacebarPressed) {
15
+ callback();
16
+ }
17
+ };
18
+ }
19
+ hostConnected() {
20
+ this.host.addEventListener('keydown', this.callback);
21
+ }
22
+ hostDisconnected() {
23
+ this.host.removeEventListener('keydown', this.callback);
24
+ }
25
+ }
26
+
27
+ exports.BtnController = BtnController;
28
+ //# sourceMappingURL=btn_controller.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ /**
6
+ * Allow for custom element classes with private constructors
7
+ */
8
+ const legacyCustomElement = (tagName, clazz) => {
9
+ // Cast as any because TS doesn't recognize the return type as being a
10
+ // subtype of the decorated class when clazz is typed as
11
+ // `Constructor<HTMLElement>` for some reason.
12
+ // `Constructor<HTMLElement>` is helpful to make sure the decorator is
13
+ // applied to elements however.
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ defineComponent(tagName, clazz);
16
+ clazz.__componentName__ = tagName;
17
+ return clazz;
18
+ };
19
+ const standardCustomElement = (tagName, descriptor) => {
20
+ const { kind, elements } = descriptor;
21
+ return {
22
+ kind,
23
+ elements,
24
+ // This callback is called once the class is otherwise fully defined
25
+ finisher(clazz) {
26
+ clazz.__componentName__ = tagName;
27
+ defineComponent(tagName, clazz);
28
+ }
29
+ };
30
+ };
31
+ /**
32
+ * Class decorator factory that defines the decorated class as a custom element.
33
+ *
34
+ * ```js
35
+ * @phoenixCustomElement('my-element')
36
+ * class MyElement extends LitElement {
37
+ * render() {
38
+ * return html``;
39
+ * }
40
+ * }
41
+ * ```
42
+ * @category Decorator
43
+ * @param tagName The tag name of the custom element to define.
44
+ */
45
+ const phoenixCustomElement = (tagName) => (classOrDescriptor) => typeof classOrDescriptor === 'function'
46
+ ? legacyCustomElement(tagName, classOrDescriptor)
47
+ : standardCustomElement(tagName, classOrDescriptor);
48
+ const defineComponent = (tagName, componentClass) => {
49
+ const isCustomElementAlreadyDefined = customElements.get(tagName);
50
+ if (!isCustomElementAlreadyDefined)
51
+ window.customElements.define(tagName, componentClass);
52
+ if (isCustomElementAlreadyDefined && window.__debug_mode__) {
53
+ console.warn(`Custom element ${tagName} is already defined.`);
54
+ }
55
+ };
56
+
57
+ exports.phoenixCustomElement = phoenixCustomElement;
58
+ //# sourceMappingURL=phoenix_custom_element.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,6 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib_es6 = require('../../../external/tslib/tslib.es6.js');
6
6
  var lit = require('lit');
7
7
  var decorators = require('lit/decorators');
8
+ var phoenix_custom_element = require('./core/decorators/phoenix_custom_element.js');
8
9
 
9
10
  exports.HelloButton = class HelloButton extends lit.LitElement {
10
11
  constructor() {
@@ -46,6 +47,6 @@ tslib_es6.__decorate([
46
47
  tslib_es6.__metadata("design:type", Object)
47
48
  ], exports.HelloButton.prototype, "planet", void 0);
48
49
  exports.HelloButton = tslib_es6.__decorate([
49
- decorators.customElement('hello-button')
50
+ phoenix_custom_element.phoenixCustomElement('hello-button')
50
51
  ], exports.HelloButton);
51
52
  //# sourceMappingURL=hello_button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,sCAA0C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,sCAA0C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -15,6 +15,7 @@ var modal_body = require('./components/modal/modal_body.js');
15
15
  var modal_footer = require('./components/modal/modal_footer.js');
16
16
  var modal_header = require('./components/modal/modal_header.js');
17
17
  var modal_close = require('./components/modal/modal_close.js');
18
+ var btn_controller = require('./controllers/btn_controller.js');
18
19
 
19
20
 
20
21
 
@@ -81,4 +82,5 @@ Object.defineProperty(exports, 'HModalClose', {
81
82
  return modal_close.HModalClose;
82
83
  }
83
84
  });
85
+ exports.BtnController = btn_controller.BtnController;
84
86
  //# sourceMappingURL=index.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,7 +1,8 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import { html } from 'lit';
3
- import { property, state, customElement } from 'lit/decorators';
3
+ import { property, state } from 'lit/decorators';
4
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
6
  import { PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
6
7
  import { MODAL_OPENED_PROP, FOCUSABLE_ELEMENTS_WITHIN_MODAL, MODALS_PORTAL_NAME, MODAL_EVENTS } from './modal_constants.js';
7
8
  import { createRef as e, ref as n } from '../../../../../external/lit-html/directives/ref.js';
@@ -54,14 +55,14 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
54
55
  }
55
56
  }
56
57
  };
57
- this._handleCloseFromCloseComponent = (ev) => {
58
+ this._handleCloseFromCloseComponent = async (ev) => {
58
59
  var _a;
59
60
  ev.stopPropagation();
60
61
  if ((_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.contains(ev.target)) {
61
- this.close();
62
+ await this.close();
62
63
  }
63
64
  };
64
- this._bindCloseOnEsc = (ev) => {
65
+ this._bindCloseOnEsc = async (ev) => {
65
66
  ev.stopImmediatePropagation();
66
67
  const $target = ev.target;
67
68
  const closeConditions = [
@@ -74,7 +75,7 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
74
75
  const shouldCloseModal = closeConditions.every((condition) => condition);
75
76
  if (shouldCloseModal) {
76
77
  const [modalToClose] = HModal_1.openModals.slice(-1);
77
- modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close();
78
+ await (modalToClose === null || modalToClose === void 0 ? void 0 : modalToClose.close());
78
79
  }
79
80
  };
80
81
  this.hidden = true;
@@ -124,24 +125,21 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
124
125
  async open() {
125
126
  return new Promise((resolve) => {
126
127
  var _a;
127
- if (!this[MODAL_OPENED_PROP]) {
128
- this[MODAL_OPENED_PROP] = true;
129
- this._dispatchModalOpenedEvent();
130
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_visible`, `modal_show-${this.transition}-start`);
131
- window.requestAnimationFrame(() => {
132
- setTimeout(() => {
133
- var _a;
134
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_show-${this.transition}-end`);
135
- }, 0);
136
- const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
137
- setTimeout(() => {
138
- var _a;
139
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
140
- resolve();
141
- }, transitionDuration);
142
- });
143
- }
144
- resolve();
128
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_visible`, `modal_show-${this.transition}-start`);
129
+ window.requestAnimationFrame(() => {
130
+ setTimeout(() => {
131
+ var _a;
132
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.add(`modal_show-${this.transition}-end`);
133
+ }, 0);
134
+ const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
135
+ setTimeout(() => {
136
+ var _a;
137
+ this[MODAL_OPENED_PROP] = true;
138
+ this._dispatchModalOpenedEvent();
139
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_show-${this.transition}-start`, `modal_show-${this.transition}-end`);
140
+ resolve();
141
+ }, transitionDuration);
142
+ });
145
143
  });
146
144
  }
147
145
  _dispatchModalOpenedEvent() {
@@ -152,22 +150,19 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
152
150
  }
153
151
  async close() {
154
152
  return new Promise((resolve) => {
155
- if (this[MODAL_OPENED_PROP]) {
156
- const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
157
- window.requestAnimationFrame(() => {
158
- var _a, _b;
159
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
160
- (_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
161
- setTimeout(() => {
162
- var _a;
163
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
164
- this[MODAL_OPENED_PROP] = false;
165
- this._dispatchModalClosedEvent();
166
- resolve();
167
- }, transitionDuration);
168
- });
169
- }
170
- resolve();
153
+ const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
154
+ window.requestAnimationFrame(() => {
155
+ var _a, _b;
156
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
157
+ (_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
158
+ setTimeout(() => {
159
+ var _a;
160
+ (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
161
+ this[MODAL_OPENED_PROP] = false;
162
+ this._dispatchModalClosedEvent();
163
+ resolve();
164
+ }, transitionDuration);
165
+ });
171
166
  });
172
167
  }
173
168
  _dispatchModalClosedEvent() {
@@ -216,7 +211,7 @@ __decorate([
216
211
  __metadata("design:type", Object)
217
212
  ], HModal.prototype, "_lastFocusableElement", void 0);
218
213
  HModal = HModal_1 = __decorate([
219
- customElement('h-modal'),
214
+ phoenixCustomElement('h-modal'),
220
215
  __metadata("design:paramtypes", [])
221
216
  ], HModal);
222
217
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA,yCAAyC,oDAAwD;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,yCAAyC,oDAAwD;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,7 +1,8 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import { html } from 'lit';
3
- import { property, customElement } from 'lit/decorators';
3
+ import { property } from 'lit/decorators';
4
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
6
  import { MODAL_EVENTS } from './modal_constants.js';
6
7
  import { HModal } from './modal.js';
7
8
 
@@ -48,7 +49,7 @@ let HModalBackdrop = class HModalBackdrop extends PhoenixLightLitElement {
48
49
  document.body.style.removeProperty('padding-right');
49
50
  }
50
51
  render() {
51
- return html `<div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
52
+ return html ` <div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
52
53
  }
53
54
  };
54
55
  __decorate([
@@ -56,7 +57,7 @@ __decorate([
56
57
  __metadata("design:type", Object)
57
58
  ], HModalBackdrop.prototype, "visible", void 0);
58
59
  HModalBackdrop = __decorate([
59
- customElement('h-modal-backdrop')
60
+ phoenixCustomElement('h-modal-backdrop')
60
61
  ], HModalBackdrop);
61
62
 
62
63
  export { HModalBackdrop };
@@ -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;"}
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,6 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { customElement } from 'lit/decorators';
3
2
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
4
 
5
5
  let HModalBody = class HModalBody extends PhoenixLightLitElement {
6
6
  constructor() {
@@ -10,7 +10,7 @@ let HModalBody = class HModalBody extends PhoenixLightLitElement {
10
10
  }
11
11
  };
12
12
  HModalBody = __decorate([
13
- customElement('h-modal-body'),
13
+ phoenixCustomElement('h-modal-body'),
14
14
  __metadata("design:paramtypes", [])
15
15
  ], HModalBody);
16
16
 
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { customElement } from 'lit/decorators';
3
2
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
4
  import { MODAL_EVENTS } from './modal_constants.js';
5
5
 
6
6
  let HModalClose = class HModalClose extends PhoenixLightLitElement {
@@ -31,7 +31,7 @@ let HModalClose = class HModalClose extends PhoenixLightLitElement {
31
31
  }
32
32
  };
33
33
  HModalClose = __decorate([
34
- customElement('h-modal-close'),
34
+ phoenixCustomElement('h-modal-close'),
35
35
  __metadata("design:paramtypes", [])
36
36
  ], HModalClose);
37
37
 
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { customElement } from 'lit/decorators';
3
2
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
4
 
5
5
  let HModalFooter = class HModalFooter extends PhoenixLightLitElement {
6
6
  constructor() {
@@ -10,7 +10,7 @@ let HModalFooter = class HModalFooter extends PhoenixLightLitElement {
10
10
  }
11
11
  };
12
12
  HModalFooter = __decorate([
13
- customElement('h-modal-footer'),
13
+ phoenixCustomElement('h-modal-footer'),
14
14
  __metadata("design:paramtypes", [])
15
15
  ], HModalFooter);
16
16
 
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { customElement } from 'lit/decorators';
3
2
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
4
 
5
5
  let HModalHeader = class HModalHeader extends PhoenixLightLitElement {
6
6
  constructor() {
@@ -10,7 +10,7 @@ let HModalHeader = class HModalHeader extends PhoenixLightLitElement {
10
10
  }
11
11
  };
12
12
  HModalHeader = __decorate([
13
- customElement('h-modal-header'),
13
+ phoenixCustomElement('h-modal-header'),
14
14
  __metadata("design:paramtypes", [])
15
15
  ], HModalHeader);
16
16
 
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { property, customElement } from 'lit/decorators';
2
+ import { property } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
5
 
5
6
  let HModalOpener = class HModalOpener extends PhoenixLightLitElement {
6
7
  constructor() {
@@ -33,7 +34,7 @@ __decorate([
33
34
  __metadata("design:type", Object)
34
35
  ], HModalOpener.prototype, "name", void 0);
35
36
  HModalOpener = __decorate([
36
- customElement('h-modal-opener'),
37
+ phoenixCustomElement('h-modal-opener'),
37
38
  __metadata("design:paramtypes", [])
38
39
  ], HModalOpener);
39
40
 
@@ -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;"}
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;"}
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { state, property, customElement } from 'lit/decorators';
2
+ import { state, property } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
5
  import { PORTAL_EVENTS } from './portal_constants.js';
5
6
  import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
6
7
 
@@ -75,7 +76,7 @@ __decorate([
75
76
  __metadata("design:type", Object)
76
77
  ], HPortal.prototype, "disabled", void 0);
77
78
  HPortal = __decorate([
78
- customElement('h-portal'),
79
+ phoenixCustomElement('h-portal'),
79
80
  __metadata("design:paramtypes", [])
80
81
  ], HPortal);
81
82
 
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA,eAAe,qDAAyD;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;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA,eAAe,qDAAyD;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;"}
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { property, state, customElement } from 'lit/decorators';
2
+ import { property, state } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
4
5
  import { PortalTargetError } from './portal_target_error.js';
5
6
  import { PORTAL_EVENTS, PORTAL_TARGET_NAME_PROP } from './portal_constants.js';
6
7
 
@@ -67,7 +68,7 @@ __decorate([
67
68
  __metadata("design:type", Object)
68
69
  ], HPortalTarget.prototype, "_portalElementsMap", void 0);
69
70
  HPortalTarget = HPortalTarget_1 = __decorate([
70
- customElement('h-portal-target')
71
+ phoenixCustomElement('h-portal-target')
71
72
  ], HPortalTarget);
72
73
 
73
74
  export { HPortalTarget };
@@ -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;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;"}
@@ -0,0 +1,8 @@
1
+ import { ReactiveController, ReactiveControllerHost } from 'lit';
2
+ export declare class BtnController implements ReactiveController {
3
+ host: ReactiveControllerHost & HTMLElement;
4
+ callback: (ev: KeyboardEvent) => void;
5
+ constructor(host: ReactiveControllerHost & HTMLElement, callback: () => void);
6
+ hostConnected(): void;
7
+ hostDisconnected(): void;
8
+ }
@@ -0,0 +1,24 @@
1
+ import 'lit';
2
+
3
+ class BtnController {
4
+ constructor(host, callback) {
5
+ (this.host = host).addController(this);
6
+ this.host.tabIndex = 0;
7
+ this.host.setAttribute('role', 'button');
8
+ this.callback = (ev) => {
9
+ const isEnterOrSpacebarPressed = ev.code === 'Enter' || ev.code === 'Space';
10
+ if (isEnterOrSpacebarPressed) {
11
+ callback();
12
+ }
13
+ };
14
+ }
15
+ hostConnected() {
16
+ this.host.addEventListener('keydown', this.callback);
17
+ }
18
+ hostDisconnected() {
19
+ this.host.removeEventListener('keydown', this.callback);
20
+ }
21
+ }
22
+
23
+ export { BtnController };
24
+ //# sourceMappingURL=btn_controller.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Allow for custom element classes with private constructors
3
+ */
4
+ import { ClassDescriptor, IPhoenixWebComponentClass } from "../../global_types";
5
+ declare type CustomElementClass = Omit<typeof HTMLElement, 'new'> & IPhoenixWebComponentClass;
6
+ /**
7
+ * Class decorator factory that defines the decorated class as a custom element.
8
+ *
9
+ * ```js
10
+ * @phoenixCustomElement('my-element')
11
+ * class MyElement extends LitElement {
12
+ * render() {
13
+ * return html``;
14
+ * }
15
+ * }
16
+ * ```
17
+ * @category Decorator
18
+ * @param tagName The tag name of the custom element to define.
19
+ */
20
+ export declare const phoenixCustomElement: (tagName: string) => (classOrDescriptor: CustomElementClass | ClassDescriptor) => any;
21
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Allow for custom element classes with private constructors
3
+ */
4
+ const legacyCustomElement = (tagName, clazz) => {
5
+ // Cast as any because TS doesn't recognize the return type as being a
6
+ // subtype of the decorated class when clazz is typed as
7
+ // `Constructor<HTMLElement>` for some reason.
8
+ // `Constructor<HTMLElement>` is helpful to make sure the decorator is
9
+ // applied to elements however.
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ defineComponent(tagName, clazz);
12
+ clazz.__componentName__ = tagName;
13
+ return clazz;
14
+ };
15
+ const standardCustomElement = (tagName, descriptor) => {
16
+ const { kind, elements } = descriptor;
17
+ return {
18
+ kind,
19
+ elements,
20
+ // This callback is called once the class is otherwise fully defined
21
+ finisher(clazz) {
22
+ clazz.__componentName__ = tagName;
23
+ defineComponent(tagName, clazz);
24
+ }
25
+ };
26
+ };
27
+ /**
28
+ * Class decorator factory that defines the decorated class as a custom element.
29
+ *
30
+ * ```js
31
+ * @phoenixCustomElement('my-element')
32
+ * class MyElement extends LitElement {
33
+ * render() {
34
+ * return html``;
35
+ * }
36
+ * }
37
+ * ```
38
+ * @category Decorator
39
+ * @param tagName The tag name of the custom element to define.
40
+ */
41
+ const phoenixCustomElement = (tagName) => (classOrDescriptor) => typeof classOrDescriptor === 'function'
42
+ ? legacyCustomElement(tagName, classOrDescriptor)
43
+ : standardCustomElement(tagName, classOrDescriptor);
44
+ const defineComponent = (tagName, componentClass) => {
45
+ const isCustomElementAlreadyDefined = customElements.get(tagName);
46
+ if (!isCustomElementAlreadyDefined)
47
+ window.customElements.define(tagName, componentClass);
48
+ if (isCustomElementAlreadyDefined && window.__debug_mode__) {
49
+ console.warn(`Custom element ${tagName} is already defined.`);
50
+ }
51
+ };
52
+
53
+ export { phoenixCustomElement };
54
+ //# sourceMappingURL=phoenix_custom_element.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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,25 @@
1
+ export declare type Constructor<T> = {
2
+ new (...args: any[]): T;
3
+ };
4
+ export interface ClassDescriptor {
5
+ kind: 'class';
6
+ elements: ClassElement[];
7
+ finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;
8
+ }
9
+ export interface ClassElement {
10
+ kind: 'field' | 'method';
11
+ key: PropertyKey;
12
+ placement: 'static' | 'prototype' | 'own';
13
+ initializer?: Function;
14
+ extras?: ClassElement[];
15
+ finisher?: <T>(clazz: Constructor<T>) => void | Constructor<T>;
16
+ descriptor?: PropertyDescriptor;
17
+ }
18
+ export interface IPhoenixWebComponentClass {
19
+ __componentName__?: string;
20
+ }
21
+ declare global {
22
+ interface Window {
23
+ __debug_mode__?: boolean;
24
+ }
25
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=global_types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global_types.js","sourceRoot":"","sources":["../../../../../src/global_types.ts"],"names":[],"mappings":""}
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../external/tslib/tslib.es6.js';
2
2
  import { LitElement, html, css } from 'lit';
3
- import { state, customElement } from 'lit/decorators';
3
+ import { state } from 'lit/decorators';
4
+ import { phoenixCustomElement } from './core/decorators/phoenix_custom_element.js';
4
5
 
5
6
  let HelloButton = class HelloButton extends LitElement {
6
7
  constructor() {
@@ -42,7 +43,7 @@ __decorate([
42
43
  __metadata("design:type", Object)
43
44
  ], HelloButton.prototype, "planet", void 0);
44
45
  HelloButton = __decorate([
45
- customElement('hello-button')
46
+ phoenixCustomElement('hello-button')
46
47
  ], HelloButton);
47
48
 
48
49
  export { HelloButton };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,sCAA0C;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,sCAA0C;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,3 +1,4 @@
1
+ export { IPhoenixWebComponentClass } from "./global_types";
1
2
  export { ContextProviderController } from "./core/context/context_provider_controller";
2
3
  export { ContextConsumerController } from "./core/context/context_consumer_controller";
3
4
  export { PhoenixLightLitElement } from "./core/phoenix_light_lit_element";
@@ -11,3 +12,4 @@ export { HModalBody } from './components/modal/modal_body';
11
12
  export { HModalFooter } from './components/modal/modal_footer';
12
13
  export { HModalHeader } from './components/modal/modal_header';
13
14
  export { HModalClose } from './components/modal/modal_close';
15
+ export { BtnController } from './controllers/btn_controller';
@@ -11,4 +11,5 @@ export { HModalBody } from './components/modal/modal_body.js';
11
11
  export { HModalFooter } from './components/modal/modal_footer.js';
12
12
  export { HModalHeader } from './components/modal/modal_header.js';
13
13
  export { HModalClose } from './components/modal/modal_close.js';
14
+ export { BtnController } from './controllers/btn_controller.js';
14
15
  //# sourceMappingURL=index.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;"}
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;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "0.5.0",
5
+ "version": "0.6.0",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",