@shoper/phoenix_design_system 0.4.5 → 0.5.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 (45) hide show
  1. package/build/cjs/packages/phoenix/src/components/modal/modal.js +42 -35
  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 +2 -3
  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 +1 -2
  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 +1 -2
  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 +1 -2
  14. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  15. package/build/cjs/packages/phoenix/src/hello_button.js +1 -2
  16. package/build/cjs/packages/phoenix/src/hello_button.js.map +1 -1
  17. package/build/cjs/packages/star_core/build/esm/external/tslib/tslib.es6.js +1 -1
  18. package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +2 -2
  19. package/build/esm/packages/phoenix/src/components/modal/modal.js +43 -36
  20. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
  21. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +3 -4
  22. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -1
  23. package/build/esm/packages/phoenix/src/components/modal/modal_body.js +2 -2
  24. package/build/esm/packages/phoenix/src/components/modal/modal_close.js +2 -2
  25. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +2 -2
  26. package/build/esm/packages/phoenix/src/components/modal/modal_header.js +2 -2
  27. package/build/esm/packages/phoenix/src/components/modal/modal_opener.js +2 -3
  28. package/build/esm/packages/phoenix/src/components/modal/modal_opener.js.map +1 -1
  29. package/build/esm/packages/phoenix/src/components/portal/portal.js +2 -3
  30. package/build/esm/packages/phoenix/src/components/portal/portal.js.map +1 -1
  31. package/build/esm/packages/phoenix/src/components/portal/portal_target.js +2 -3
  32. package/build/esm/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  33. package/build/esm/packages/phoenix/src/hello_button.js +2 -3
  34. package/build/esm/packages/phoenix/src/hello_button.js.map +1 -1
  35. package/build/esm/packages/phoenix/src/index.d.ts +0 -1
  36. package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js +1 -1
  37. package/package.json +1 -1
  38. package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js +0 -58
  39. package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
  40. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.d.ts +0 -21
  41. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js +0 -54
  42. package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
  43. package/build/esm/packages/phoenix/src/global_types.d.ts +0 -25
  44. package/build/esm/packages/phoenix/src/global_types.js +0 -2
  45. package/build/esm/packages/phoenix/src/global_types.js.map +0 -1
@@ -6,7 +6,6 @@ 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');
10
9
  var portal_constants = require('../portal/portal_constants.js');
11
10
  var modal_constants = require('./modal_constants.js');
12
11
  var ref = require('../../../../../external/lit-html/directives/ref.js');
@@ -126,24 +125,28 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
126
125
  this._propsChangeStrategies[modal_constants.MODAL_OPENED_PROP][String(this[modal_constants.MODAL_OPENED_PROP])]();
127
126
  }
128
127
  }
129
- open() {
130
- 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
- }, transitionDuration);
145
- });
146
- }
128
+ async open() {
129
+ return new Promise((resolve) => {
130
+ 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();
149
+ });
147
150
  }
148
151
  _dispatchModalOpenedEvent() {
149
152
  const openModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.opened, {
@@ -151,21 +154,25 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
151
154
  });
152
155
  this.dispatchEvent(openModalEvent);
153
156
  }
154
- close() {
155
- if (this[modal_constants.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_constants.MODAL_OPENED_PROP] = false;
165
- this._dispatchModalClosedEvent();
166
- }, transitionDuration);
167
- });
168
- }
157
+ async close() {
158
+ 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();
175
+ });
169
176
  }
170
177
  _dispatchModalClosedEvent() {
171
178
  const closeModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.closed, {
@@ -213,7 +220,7 @@ tslib_es6.__decorate([
213
220
  tslib_es6.__metadata("design:type", Object)
214
221
  ], exports.HModal.prototype, "_lastFocusableElement", void 0);
215
222
  exports.HModal = HModal_1 = tslib_es6.__decorate([
216
- phoenix_custom_element.phoenixCustomElement('h-modal'),
223
+ decorators.customElement('h-modal'),
217
224
  tslib_es6.__metadata("design:paramtypes", [])
218
225
  ], exports.HModal);
219
226
  //# 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;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;"}
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;"}
@@ -6,7 +6,6 @@ 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');
10
9
  var modal_constants = require('./modal_constants.js');
11
10
  var modal = require('./modal.js');
12
11
 
@@ -53,7 +52,7 @@ exports.HModalBackdrop = class HModalBackdrop extends phoenix_light_lit_element.
53
52
  document.body.style.removeProperty('padding-right');
54
53
  }
55
54
  render() {
56
- return lit.html ` <div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
55
+ return lit.html `<div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
57
56
  }
58
57
  };
59
58
  tslib_es6.__decorate([
@@ -61,6 +60,6 @@ tslib_es6.__decorate([
61
60
  tslib_es6.__metadata("design:type", Object)
62
61
  ], exports.HModalBackdrop.prototype, "visible", void 0);
63
62
  exports.HModalBackdrop = tslib_es6.__decorate([
64
- phoenix_custom_element.phoenixCustomElement('h-modal-backdrop')
63
+ decorators.customElement('h-modal-backdrop')
65
64
  ], exports.HModalBackdrop);
66
65
  //# 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;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;"}
@@ -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');
6
7
  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
- phoenix_custom_element.phoenixCustomElement('h-modal-body'),
17
+ decorators.customElement('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');
6
7
  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
- phoenix_custom_element.phoenixCustomElement('h-modal-close'),
38
+ decorators.customElement('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');
6
7
  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
- phoenix_custom_element.phoenixCustomElement('h-modal-footer'),
17
+ decorators.customElement('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');
6
7
  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
- phoenix_custom_element.phoenixCustomElement('h-modal-header'),
17
+ decorators.customElement('h-modal-header'),
18
18
  tslib_es6.__metadata("design:paramtypes", [])
19
19
  ], exports.HModalHeader);
20
20
  //# sourceMappingURL=modal_header.js.map
@@ -5,7 +5,6 @@ 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');
9
8
 
10
9
  exports.HModalOpener = class HModalOpener extends phoenix_light_lit_element.PhoenixLightLitElement {
11
10
  constructor() {
@@ -38,7 +37,7 @@ tslib_es6.__decorate([
38
37
  tslib_es6.__metadata("design:type", Object)
39
38
  ], exports.HModalOpener.prototype, "name", void 0);
40
39
  exports.HModalOpener = tslib_es6.__decorate([
41
- phoenix_custom_element.phoenixCustomElement('h-modal-opener'),
40
+ decorators.customElement('h-modal-opener'),
42
41
  tslib_es6.__metadata("design:paramtypes", [])
43
42
  ], exports.HModalOpener);
44
43
  //# 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;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;"}
@@ -5,7 +5,6 @@ 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');
9
8
  var portal_constants = require('./portal_constants.js');
10
9
  var v4 = require('../../../../../external/uuid/dist/esm-browser/v4.js');
11
10
 
@@ -80,7 +79,7 @@ tslib_es6.__decorate([
80
79
  tslib_es6.__metadata("design:type", Object)
81
80
  ], exports.HPortal.prototype, "disabled", void 0);
82
81
  exports.HPortal = tslib_es6.__decorate([
83
- phoenix_custom_element.phoenixCustomElement('h-portal'),
82
+ decorators.customElement('h-portal'),
84
83
  tslib_es6.__metadata("design:paramtypes", [])
85
84
  ], exports.HPortal);
86
85
  //# 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;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,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,7 +5,6 @@ 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');
9
8
  var portal_target_error = require('./portal_target_error.js');
10
9
  var portal_constants = require('./portal_constants.js');
11
10
 
@@ -72,6 +71,6 @@ tslib_es6.__decorate([
72
71
  tslib_es6.__metadata("design:type", Object)
73
72
  ], exports.HPortalTarget.prototype, "_portalElementsMap", void 0);
74
73
  exports.HPortalTarget = HPortalTarget_1 = tslib_es6.__decorate([
75
- phoenix_custom_element.phoenixCustomElement('h-portal-target')
74
+ decorators.customElement('h-portal-target')
76
75
  ], exports.HPortalTarget);
77
76
  //# 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;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;"}
@@ -5,7 +5,6 @@ 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');
9
8
 
10
9
  exports.HelloButton = class HelloButton extends lit.LitElement {
11
10
  constructor() {
@@ -47,6 +46,6 @@ tslib_es6.__decorate([
47
46
  tslib_es6.__metadata("design:type", Object)
48
47
  ], exports.HelloButton.prototype, "planet", void 0);
49
48
  exports.HelloButton = tslib_es6.__decorate([
50
- phoenix_custom_element.phoenixCustomElement('hello-button')
49
+ decorators.customElement('hello-button')
51
50
  ], exports.HelloButton);
52
51
  //# 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;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;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- /******************************************************************************
5
+ /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation.
7
7
 
8
8
  Permission to use, copy, modify, and/or distribute this software for any
@@ -23,9 +23,9 @@ export declare class HModal extends PhoenixLightLitElement {
23
23
  private _keepFocusWithinModal;
24
24
  private _handleCloseFromCloseComponent;
25
25
  private _bindCloseOnEsc;
26
- open(): void;
26
+ open(): Promise<void>;
27
27
  private _dispatchModalOpenedEvent;
28
- close(): void;
28
+ close(): Promise<void>;
29
29
  private _dispatchModalClosedEvent;
30
30
  render(): TemplateResult<1>;
31
31
  }
@@ -1,8 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import { html } from 'lit';
3
- import { property, state } from 'lit/decorators';
3
+ import { property, state, customElement } from 'lit/decorators';
4
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
6
5
  import { PORTAL_TARGET_NAME_PROP } from '../portal/portal_constants.js';
7
6
  import { MODAL_OPENED_PROP, FOCUSABLE_ELEMENTS_WITHIN_MODAL, MODALS_PORTAL_NAME, MODAL_EVENTS } from './modal_constants.js';
8
7
  import { createRef as e, ref as n } from '../../../../../external/lit-html/directives/ref.js';
@@ -122,24 +121,28 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
122
121
  this._propsChangeStrategies[MODAL_OPENED_PROP][String(this[MODAL_OPENED_PROP])]();
123
122
  }
124
123
  }
125
- open() {
126
- 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
- }, transitionDuration);
141
- });
142
- }
124
+ async open() {
125
+ return new Promise((resolve) => {
126
+ 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();
145
+ });
143
146
  }
144
147
  _dispatchModalOpenedEvent() {
145
148
  const openModalEvent = new CustomEvent(MODAL_EVENTS.opened, {
@@ -147,21 +150,25 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
147
150
  });
148
151
  this.dispatchEvent(openModalEvent);
149
152
  }
150
- close() {
151
- if (this[MODAL_OPENED_PROP]) {
152
- const transitionDuration = parseFloat(getComputedStyle(this._contentRef.value || this).transitionDuration) * 1000;
153
- window.requestAnimationFrame(() => {
154
- var _a, _b;
155
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`);
156
- (_b = this._contentRef.value) === null || _b === void 0 ? void 0 : _b.classList.add(`modal_hide-${this.transition}-end`);
157
- setTimeout(() => {
158
- var _a;
159
- (_a = this._contentRef.value) === null || _a === void 0 ? void 0 : _a.classList.remove(`modal_hide-${this.transition}-start`, `modal_hide-${this.transition}-end`);
160
- this[MODAL_OPENED_PROP] = false;
161
- this._dispatchModalClosedEvent();
162
- }, transitionDuration);
163
- });
164
- }
153
+ async close() {
154
+ 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();
171
+ });
165
172
  }
166
173
  _dispatchModalClosedEvent() {
167
174
  const closeModalEvent = new CustomEvent(MODAL_EVENTS.closed, {
@@ -209,7 +216,7 @@ __decorate([
209
216
  __metadata("design:type", Object)
210
217
  ], HModal.prototype, "_lastFocusableElement", void 0);
211
218
  HModal = HModal_1 = __decorate([
212
- phoenixCustomElement('h-modal'),
219
+ customElement('h-modal'),
213
220
  __metadata("design:paramtypes", [])
214
221
  ], HModal);
215
222
 
@@ -1 +1 @@
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;"}
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,8 +1,7 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
2
  import { html } from 'lit';
3
- import { property } from 'lit/decorators';
3
+ import { property, customElement } from 'lit/decorators';
4
4
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
6
5
  import { MODAL_EVENTS } from './modal_constants.js';
7
6
  import { HModal } from './modal.js';
8
7
 
@@ -49,7 +48,7 @@ let HModalBackdrop = class HModalBackdrop extends PhoenixLightLitElement {
49
48
  document.body.style.removeProperty('padding-right');
50
49
  }
51
50
  render() {
52
- return html ` <div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
51
+ return html `<div aria-hidden="true" ?hidden="${!this.visible}" class="modal-backdrop"></div>`;
53
52
  }
54
53
  };
55
54
  __decorate([
@@ -57,7 +56,7 @@ __decorate([
57
56
  __metadata("design:type", Object)
58
57
  ], HModalBackdrop.prototype, "visible", void 0);
59
58
  HModalBackdrop = __decorate([
60
- phoenixCustomElement('h-modal-backdrop')
59
+ customElement('h-modal-backdrop')
61
60
  ], HModalBackdrop);
62
61
 
63
62
  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;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;"}
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
+ import { customElement } from 'lit/decorators';
2
3
  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
- phoenixCustomElement('h-modal-body'),
13
+ customElement('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';
2
3
  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
- phoenixCustomElement('h-modal-close'),
34
+ customElement('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';
2
3
  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
- phoenixCustomElement('h-modal-footer'),
13
+ customElement('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';
2
3
  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
- phoenixCustomElement('h-modal-header'),
13
+ customElement('h-modal-header'),
14
14
  __metadata("design:paramtypes", [])
15
15
  ], HModalHeader);
16
16
 
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { property } from 'lit/decorators';
2
+ import { property, customElement } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
4
 
6
5
  let HModalOpener = class HModalOpener extends PhoenixLightLitElement {
7
6
  constructor() {
@@ -34,7 +33,7 @@ __decorate([
34
33
  __metadata("design:type", Object)
35
34
  ], HModalOpener.prototype, "name", void 0);
36
35
  HModalOpener = __decorate([
37
- phoenixCustomElement('h-modal-opener'),
36
+ customElement('h-modal-opener'),
38
37
  __metadata("design:paramtypes", [])
39
38
  ], HModalOpener);
40
39
 
@@ -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;"}
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,7 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { state, property } from 'lit/decorators';
2
+ import { state, property, customElement } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
4
  import { PORTAL_EVENTS } from './portal_constants.js';
6
5
  import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
7
6
 
@@ -76,7 +75,7 @@ __decorate([
76
75
  __metadata("design:type", Object)
77
76
  ], HPortal.prototype, "disabled", void 0);
78
77
  HPortal = __decorate([
79
- phoenixCustomElement('h-portal'),
78
+ customElement('h-portal'),
80
79
  __metadata("design:paramtypes", [])
81
80
  ], HPortal);
82
81
 
@@ -1 +1 @@
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
+ {"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,7 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { property, state } from 'lit/decorators';
2
+ import { property, state, customElement } from 'lit/decorators';
3
3
  import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
- import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
4
  import { PortalTargetError } from './portal_target_error.js';
6
5
  import { PORTAL_EVENTS, PORTAL_TARGET_NAME_PROP } from './portal_constants.js';
7
6
 
@@ -68,7 +67,7 @@ __decorate([
68
67
  __metadata("design:type", Object)
69
68
  ], HPortalTarget.prototype, "_portalElementsMap", void 0);
70
69
  HPortalTarget = HPortalTarget_1 = __decorate([
71
- phoenixCustomElement('h-portal-target')
70
+ customElement('h-portal-target')
72
71
  ], HPortalTarget);
73
72
 
74
73
  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;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;"}
@@ -1,7 +1,6 @@
1
1
  import { __decorate, __metadata } from '../../../external/tslib/tslib.es6.js';
2
2
  import { LitElement, html, css } from 'lit';
3
- import { state } from 'lit/decorators';
4
- import { phoenixCustomElement } from './core/decorators/phoenix_custom_element.js';
3
+ import { state, customElement } from 'lit/decorators';
5
4
 
6
5
  let HelloButton = class HelloButton extends LitElement {
7
6
  constructor() {
@@ -43,7 +42,7 @@ __decorate([
43
42
  __metadata("design:type", Object)
44
43
  ], HelloButton.prototype, "planet", void 0);
45
44
  HelloButton = __decorate([
46
- phoenixCustomElement('hello-button')
45
+ customElement('hello-button')
47
46
  ], HelloButton);
48
47
 
49
48
  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;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;"}
@@ -1,4 +1,3 @@
1
- export { IPhoenixWebComponentClass } from "./global_types";
2
1
  export { ContextProviderController } from "./core/context/context_provider_controller";
3
2
  export { ContextConsumerController } from "./core/context/context_consumer_controller";
4
3
  export { PhoenixLightLitElement } from "./core/phoenix_light_lit_element";
@@ -1,4 +1,4 @@
1
- /******************************************************************************
1
+ /*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
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.4.5",
5
+ "version": "0.5.0",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",
@@ -1,58 +0,0 @@
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
@@ -1 +0,0 @@
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;"}
@@ -1,21 +0,0 @@
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 {};
@@ -1,54 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,25 +0,0 @@
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
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=global_types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global_types.js","sourceRoot":"","sources":["../../../../../src/global_types.ts"],"names":[],"mappings":""}