@shoper/phoenix_design_system 0.4.3 → 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.
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +41 -33
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/cjs/packages/phoenix/src/hello_button.js +1 -2
- package/build/cjs/packages/phoenix/src/hello_button.js.map +1 -1
- package/build/cjs/packages/star_core/build/esm/external/tslib/tslib.es6.js +1 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +2 -2
- package/build/esm/packages/phoenix/src/components/modal/modal.js +41 -33
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -1
- package/build/esm/packages/phoenix/src/hello_button.js +2 -3
- package/build/esm/packages/phoenix/src/hello_button.js.map +1 -1
- package/build/esm/packages/phoenix/src/index.d.ts +0 -1
- package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js +1 -1
- package/package.json +1 -1
- package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js +0 -50
- package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.d.ts +0 -21
- package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js +0 -46
- package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
- package/build/esm/packages/phoenix/src/global_types.d.ts +0 -20
- package/build/esm/packages/phoenix/src/global_types.js +0 -2
- package/build/esm/packages/phoenix/src/global_types.js.map +0 -1
|
@@ -125,24 +125,28 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
|
|
|
125
125
|
this._propsChangeStrategies[modal_constants.MODAL_OPENED_PROP][String(this[modal_constants.MODAL_OPENED_PROP])]();
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
open() {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this[modal_constants.MODAL_OPENED_PROP]
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
+
});
|
|
146
150
|
}
|
|
147
151
|
_dispatchModalOpenedEvent() {
|
|
148
152
|
const openModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.opened, {
|
|
@@ -150,21 +154,25 @@ exports.HModal = HModal_1 = class HModal extends phoenix_light_lit_element.Phoen
|
|
|
150
154
|
});
|
|
151
155
|
this.dispatchEvent(openModalEvent);
|
|
152
156
|
}
|
|
153
|
-
close() {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
+
});
|
|
168
176
|
}
|
|
169
177
|
_dispatchModalClosedEvent() {
|
|
170
178
|
const closeModalEvent = new CustomEvent(modal_constants.MODAL_EVENTS.closed, {
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -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
|
-
|
|
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;
|
|
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
|
}
|
|
@@ -121,24 +121,28 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
|
|
|
121
121
|
this._propsChangeStrategies[MODAL_OPENED_PROP][String(this[MODAL_OPENED_PROP])]();
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
open() {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
this[MODAL_OPENED_PROP]
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
+
});
|
|
142
146
|
}
|
|
143
147
|
_dispatchModalOpenedEvent() {
|
|
144
148
|
const openModalEvent = new CustomEvent(MODAL_EVENTS.opened, {
|
|
@@ -146,21 +150,25 @@ let HModal = HModal_1 = class HModal extends PhoenixLightLitElement {
|
|
|
146
150
|
});
|
|
147
151
|
this.dispatchEvent(openModalEvent);
|
|
148
152
|
}
|
|
149
|
-
close() {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
+
});
|
|
164
172
|
}
|
|
165
173
|
_dispatchModalClosedEvent() {
|
|
166
174
|
const closeModalEvent = new CustomEvent(MODAL_EVENTS.closed, {
|
|
@@ -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;"}
|
|
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,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
|
-
|
|
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;
|
|
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 { IPhoenixComponentClass } 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
|
@@ -1,50 +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
|
-
window.customElements.define(tagName, clazz);
|
|
10
|
-
// Cast as any because TS doesn't recognize the return type as being a
|
|
11
|
-
// subtype of the decorated class when clazz is typed as
|
|
12
|
-
// `Constructor<HTMLElement>` for some reason.
|
|
13
|
-
// `Constructor<HTMLElement>` is helpful to make sure the decorator is
|
|
14
|
-
// applied to elements however.
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
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
|
-
window.customElements.define(tagName, clazz);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Class decorator factory that defines the decorated class as a custom element.
|
|
33
|
-
*
|
|
34
|
-
* ```js
|
|
35
|
-
* @customElement('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
|
-
|
|
49
|
-
exports.phoenixCustomElement = phoenixCustomElement;
|
|
50
|
-
//# 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;"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Allow for custom element classes with private constructors
|
|
3
|
-
*/
|
|
4
|
-
import { ClassDescriptor, IPhoenixComponentClass } from "../../global_types";
|
|
5
|
-
declare type CustomElementClass = Omit<typeof HTMLElement, 'new'> & IPhoenixComponentClass;
|
|
6
|
-
/**
|
|
7
|
-
* Class decorator factory that defines the decorated class as a custom element.
|
|
8
|
-
*
|
|
9
|
-
* ```js
|
|
10
|
-
* @customElement('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,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Allow for custom element classes with private constructors
|
|
3
|
-
*/
|
|
4
|
-
const legacyCustomElement = (tagName, clazz) => {
|
|
5
|
-
window.customElements.define(tagName, clazz);
|
|
6
|
-
// Cast as any because TS doesn't recognize the return type as being a
|
|
7
|
-
// subtype of the decorated class when clazz is typed as
|
|
8
|
-
// `Constructor<HTMLElement>` for some reason.
|
|
9
|
-
// `Constructor<HTMLElement>` is helpful to make sure the decorator is
|
|
10
|
-
// applied to elements however.
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
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
|
-
window.customElements.define(tagName, clazz);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Class decorator factory that defines the decorated class as a custom element.
|
|
29
|
-
*
|
|
30
|
-
* ```js
|
|
31
|
-
* @customElement('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
|
-
|
|
45
|
-
export { phoenixCustomElement };
|
|
46
|
-
//# 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;"}
|
|
@@ -1,20 +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 IPhoenixComponentClass {
|
|
19
|
-
__componentName__?: string;
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global_types.js","sourceRoot":"","sources":["../../../../../src/global_types.ts"],"names":[],"mappings":""}
|