@shoper/phoenix_design_system 0.5.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/build/cjs/external/lit-html/async-directive.js +0 -16
- package/build/cjs/external/lit-html/async-directive.js.map +0 -1
- package/build/cjs/external/lit-html/directive-helpers.js +0 -14
- package/build/cjs/external/lit-html/directive-helpers.js.map +0 -1
- package/build/cjs/external/lit-html/directive.js +0 -15
- package/build/cjs/external/lit-html/directive.js.map +0 -1
- package/build/cjs/external/lit-html/directives/ref.js +0 -17
- package/build/cjs/external/lit-html/directives/ref.js.map +0 -1
- package/build/cjs/external/lit-html/lit-html.js +0 -14
- package/build/cjs/external/lit-html/lit-html.js.map +0 -1
- package/build/cjs/external/tslib/tslib.es6.js +0 -48
- package/build/cjs/external/tslib/tslib.es6.js.map +0 -1
- package/build/cjs/external/uuid/dist/esm-browser/regex.js +0 -8
- package/build/cjs/external/uuid/dist/esm-browser/regex.js.map +0 -1
- package/build/cjs/external/uuid/dist/esm-browser/rng.js +0 -26
- package/build/cjs/external/uuid/dist/esm-browser/rng.js.map +0 -1
- package/build/cjs/external/uuid/dist/esm-browser/stringify.js +0 -36
- package/build/cjs/external/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/build/cjs/external/uuid/dist/esm-browser/v4.js +0 -29
- package/build/cjs/external/uuid/dist/esm-browser/v4.js.map +0 -1
- package/build/cjs/external/uuid/dist/esm-browser/validate.js +0 -12
- package/build/cjs/external/uuid/dist/esm-browser/validate.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal.js +0 -221
- package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +0 -66
- package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_body.js +0 -20
- package/build/cjs/packages/phoenix/src/components/modal/modal_body.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_close.js +0 -41
- package/build/cjs/packages/phoenix/src/components/modal/modal_close.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js +0 -19
- package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js +0 -20
- package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_header.js +0 -20
- package/build/cjs/packages/phoenix/src/components/modal/modal_header.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/modal/modal_opener.js +0 -44
- package/build/cjs/packages/phoenix/src/components/modal/modal_opener.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal.js +0 -86
- package/build/cjs/packages/phoenix/src/components/portal/portal.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js +0 -13
- package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_target.js +0 -77
- package/build/cjs/packages/phoenix/src/components/portal/portal_target.js.map +0 -1
- package/build/cjs/packages/phoenix/src/components/portal/portal_target_error.js +0 -9
- package/build/cjs/packages/phoenix/src/components/portal/portal_target_error.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/context/context_consumer_controller.js +0 -33
- package/build/cjs/packages/phoenix/src/core/context/context_consumer_controller.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/context/context_consumer_messages_names.js +0 -10
- package/build/cjs/packages/phoenix/src/core/context/context_consumer_messages_names.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/context/context_provider_controller.js +0 -39
- package/build/cjs/packages/phoenix/src/core/context/context_provider_controller.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js +0 -58
- package/build/cjs/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js +0 -47
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js.map +0 -1
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +0 -8
- package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +0 -1
- package/build/cjs/packages/phoenix/src/hello_button.js +0 -52
- package/build/cjs/packages/phoenix/src/hello_button.js.map +0 -1
- package/build/cjs/packages/phoenix/src/index.js +0 -84
- package/build/cjs/packages/phoenix/src/index.js.map +0 -1
- package/build/cjs/packages/star_core/build/esm/external/tslib/tslib.es6.js +0 -35
- package/build/cjs/packages/star_core/build/esm/external/tslib/tslib.es6.js.map +0 -1
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js +0 -66
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js.map +0 -1
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js +0 -11
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js.map +0 -1
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js +0 -20
- package/build/cjs/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js.map +0 -1
- package/build/esm/external/lit-html/async-directive.js +0 -12
- package/build/esm/external/lit-html/async-directive.js.map +0 -1
- package/build/esm/external/lit-html/directive-helpers.js +0 -10
- package/build/esm/external/lit-html/directive-helpers.js.map +0 -1
- package/build/esm/external/lit-html/directive.js +0 -9
- package/build/esm/external/lit-html/directive.js.map +0 -1
- package/build/esm/external/lit-html/directives/ref.js +0 -12
- package/build/esm/external/lit-html/directives/ref.js.map +0 -1
- package/build/esm/external/lit-html/lit-html.js +0 -9
- package/build/esm/external/lit-html/lit-html.js.map +0 -1
- package/build/esm/external/tslib/tslib.es6.js +0 -41
- package/build/esm/external/tslib/tslib.es6.js.map +0 -1
- package/build/esm/external/uuid/dist/esm-browser/regex.js +0 -4
- package/build/esm/external/uuid/dist/esm-browser/regex.js.map +0 -1
- package/build/esm/external/uuid/dist/esm-browser/rng.js +0 -22
- package/build/esm/external/uuid/dist/esm-browser/rng.js.map +0 -1
- package/build/esm/external/uuid/dist/esm-browser/stringify.js +0 -32
- package/build/esm/external/uuid/dist/esm-browser/stringify.js.map +0 -1
- package/build/esm/external/uuid/dist/esm-browser/v4.js +0 -25
- package/build/esm/external/uuid/dist/esm-browser/v4.js.map +0 -1
- package/build/esm/external/uuid/dist/esm-browser/validate.js +0 -8
- package/build/esm/external/uuid/dist/esm-browser/validate.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +0 -31
- package/build/esm/packages/phoenix/src/components/modal/modal.js +0 -219
- package/build/esm/packages/phoenix/src/components/modal/modal.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.d.ts +0 -12
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +0 -64
- package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_body.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/modal/modal_body.js +0 -18
- package/build/esm/packages/phoenix/src/components/modal/modal_body.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_close.d.ts +0 -8
- package/build/esm/packages/phoenix/src/components/modal/modal_close.js +0 -39
- package/build/esm/packages/phoenix/src/components/modal/modal_close.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.d.ts +0 -9
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js +0 -12
- package/build/esm/packages/phoenix/src/components/modal/modal_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +0 -18
- package/build/esm/packages/phoenix/src/components/modal/modal_footer.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_header.d.ts +0 -4
- package/build/esm/packages/phoenix/src/components/modal/modal_header.js +0 -18
- package/build/esm/packages/phoenix/src/components/modal/modal_header.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/modal/modal_opener.d.ts +0 -9
- package/build/esm/packages/phoenix/src/components/modal/modal_opener.js +0 -42
- package/build/esm/packages/phoenix/src/components/modal/modal_opener.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/portal/portal.d.ts +0 -13
- package/build/esm/packages/phoenix/src/components/portal/portal.js +0 -84
- package/build/esm/packages/phoenix/src/components/portal/portal.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.d.ts +0 -13
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js +0 -8
- package/build/esm/packages/phoenix/src/components/portal/portal_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_target.d.ts +0 -13
- package/build/esm/packages/phoenix/src/components/portal/portal_target.js +0 -75
- package/build/esm/packages/phoenix/src/components/portal/portal_target.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_target_error.d.ts +0 -2
- package/build/esm/packages/phoenix/src/components/portal/portal_target_error.js +0 -5
- package/build/esm/packages/phoenix/src/components/portal/portal_target_error.js.map +0 -1
- package/build/esm/packages/phoenix/src/components/portal/portal_types.d.ts +0 -5
- package/build/esm/packages/phoenix/src/components/portal/portal_types.js +0 -2
- package/build/esm/packages/phoenix/src/components/portal/portal_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/context/context_consumer_controller.d.ts +0 -8
- package/build/esm/packages/phoenix/src/core/context/context_consumer_controller.js +0 -29
- package/build/esm/packages/phoenix/src/core/context/context_consumer_controller.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/context/context_consumer_messages_names.d.ts +0 -3
- package/build/esm/packages/phoenix/src/core/context/context_consumer_messages_names.js +0 -6
- package/build/esm/packages/phoenix/src/core/context/context_consumer_messages_names.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/context/context_controller_types.d.ts +0 -6
- package/build/esm/packages/phoenix/src/core/context/context_controller_types.js +0 -2
- package/build/esm/packages/phoenix/src/core/context/context_controller_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/context/context_provider_controller.d.ts +0 -9
- package/build/esm/packages/phoenix/src/core/context/context_provider_controller.js +0 -35
- package/build/esm/packages/phoenix/src/core/context/context_provider_controller.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 -54
- package/build/esm/packages/phoenix/src/core/decorators/phoenix_custom_element.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.d.ts +0 -9
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js +0 -43
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js.map +0 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.d.ts +0 -1
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +0 -4
- package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +0 -1
- package/build/esm/packages/phoenix/src/global_types.d.ts +0 -25
- package/build/esm/packages/phoenix/src/global_types.js +0 -2
- package/build/esm/packages/phoenix/src/global_types.js.map +0 -1
- package/build/esm/packages/phoenix/src/hello_button.d.ts +0 -9
- package/build/esm/packages/phoenix/src/hello_button.js +0 -50
- package/build/esm/packages/phoenix/src/hello_button.js.map +0 -1
- package/build/esm/packages/phoenix/src/index.d.ts +0 -14
- package/build/esm/packages/phoenix/src/index.js +0 -14
- package/build/esm/packages/phoenix/src/index.js.map +0 -1
- package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js +0 -30
- package/build/esm/packages/star_core/build/esm/external/tslib/tslib.es6.js.map +0 -1
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js +0 -62
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js.map +0 -1
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js +0 -7
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/values_container/values_container_error.js.map +0 -1
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js +0 -16
- package/build/esm/packages/star_core/build/esm/packages/star_core/src/core/errors/app_error.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element";
|
|
2
|
-
import { TPortalEventData } from './portal_types';
|
|
3
|
-
export declare class HPortalTarget extends PhoenixLightLitElement {
|
|
4
|
-
static portalTargetsNames: Set<string>;
|
|
5
|
-
name: string;
|
|
6
|
-
_portalElementsMap: Record<string, HTMLElement[]>;
|
|
7
|
-
connectedCallback(): void;
|
|
8
|
-
disconnectedCallback(): void;
|
|
9
|
-
portalElements: ({ detail: { portalId, content, to } }: CustomEvent<TPortalEventData>) => void;
|
|
10
|
-
removeTeleportedItems: ({ detail: { portalId, to } }: CustomEvent<TPortalEventData>) => void;
|
|
11
|
-
doesDestinationMatch(destination: string): boolean;
|
|
12
|
-
allowOnlyOnePortalTargetWithName(): void;
|
|
13
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { property, state } from 'lit/decorators';
|
|
3
|
-
import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
|
|
4
|
-
import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
|
|
5
|
-
import { PortalTargetError } from './portal_target_error.js';
|
|
6
|
-
import { PORTAL_EVENTS, PORTAL_TARGET_NAME_PROP } from './portal_constants.js';
|
|
7
|
-
|
|
8
|
-
var HPortalTarget_1;
|
|
9
|
-
let HPortalTarget = HPortalTarget_1 = class HPortalTarget extends PhoenixLightLitElement {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this.name = '';
|
|
13
|
-
this._portalElementsMap = {};
|
|
14
|
-
this.portalElements = ({ detail: { portalId, content, to } }) => {
|
|
15
|
-
var _a;
|
|
16
|
-
if (!this.doesDestinationMatch(to))
|
|
17
|
-
return;
|
|
18
|
-
const newPortalElements = [...content].map((el) => this.appendChild(el));
|
|
19
|
-
const elementsInProtal = (_a = this._portalElementsMap[portalId]) !== null && _a !== void 0 ? _a : [];
|
|
20
|
-
this._portalElementsMap[portalId] = [...newPortalElements, ...elementsInProtal];
|
|
21
|
-
};
|
|
22
|
-
this.removeTeleportedItems = ({ detail: { portalId, to } }) => {
|
|
23
|
-
var _a;
|
|
24
|
-
if (!this.doesDestinationMatch(to))
|
|
25
|
-
return;
|
|
26
|
-
(_a = this._portalElementsMap[portalId]) === null || _a === void 0 ? void 0 : _a.forEach((el) => {
|
|
27
|
-
if (el.parentElement === this) {
|
|
28
|
-
this.removeChild(el);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
this._portalElementsMap[portalId] = [];
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
connectedCallback() {
|
|
35
|
-
super.connectedCallback();
|
|
36
|
-
this.allowOnlyOnePortalTargetWithName();
|
|
37
|
-
document.addEventListener(PORTAL_EVENTS.open, this.portalElements, {
|
|
38
|
-
capture: true
|
|
39
|
-
});
|
|
40
|
-
document.addEventListener(PORTAL_EVENTS.close, this.removeTeleportedItems, {
|
|
41
|
-
capture: true
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
disconnectedCallback() {
|
|
45
|
-
super.disconnectedCallback();
|
|
46
|
-
document.removeEventListener(PORTAL_EVENTS.open, this.portalElements);
|
|
47
|
-
document.removeEventListener(PORTAL_EVENTS.close, this.removeTeleportedItems);
|
|
48
|
-
HPortalTarget_1.portalTargetsNames.delete(this[PORTAL_TARGET_NAME_PROP]);
|
|
49
|
-
}
|
|
50
|
-
doesDestinationMatch(destination) {
|
|
51
|
-
return destination === this[PORTAL_TARGET_NAME_PROP];
|
|
52
|
-
}
|
|
53
|
-
allowOnlyOnePortalTargetWithName() {
|
|
54
|
-
if (HPortalTarget_1.portalTargetsNames.has(this[PORTAL_TARGET_NAME_PROP])) {
|
|
55
|
-
this.remove();
|
|
56
|
-
throw new PortalTargetError(`Portal target with name "${this[PORTAL_TARGET_NAME_PROP]}" already exists.`);
|
|
57
|
-
}
|
|
58
|
-
HPortalTarget_1.portalTargetsNames.add(this[PORTAL_TARGET_NAME_PROP]);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
HPortalTarget.portalTargetsNames = new Set();
|
|
62
|
-
__decorate([
|
|
63
|
-
property({ type: String }),
|
|
64
|
-
__metadata("design:type", Object)
|
|
65
|
-
], HPortalTarget.prototype, "name", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
state(),
|
|
68
|
-
__metadata("design:type", Object)
|
|
69
|
-
], HPortalTarget.prototype, "_portalElementsMap", void 0);
|
|
70
|
-
HPortalTarget = HPortalTarget_1 = __decorate([
|
|
71
|
-
phoenixCustomElement('h-portal-target')
|
|
72
|
-
], HPortalTarget);
|
|
73
|
-
|
|
74
|
-
export { HPortalTarget };
|
|
75
|
-
//# sourceMappingURL=portal_target.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"portal_types.js","sourceRoot":"","sources":["../../../../../../../src/components/portal/portal_types.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactiveController } from 'lit';
|
|
2
|
-
import { TContextValueKey, TWebComponentsContextControllerHost } from "./context_controller_types";
|
|
3
|
-
export declare class ContextConsumerController<TValue> implements ReactiveController {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(host: TWebComponentsContextControllerHost);
|
|
6
|
-
consume(key: TContextValueKey): TValue;
|
|
7
|
-
hostConnected(): void;
|
|
8
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import 'lit';
|
|
3
|
-
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
4
|
-
|
|
5
|
-
var _ContextConsumerController_host;
|
|
6
|
-
class ContextConsumerController {
|
|
7
|
-
constructor(host) {
|
|
8
|
-
_ContextConsumerController_host.set(this, void 0);
|
|
9
|
-
__classPrivateFieldSet(this, _ContextConsumerController_host, host, "f");
|
|
10
|
-
__classPrivateFieldGet(this, _ContextConsumerController_host, "f").addController(this);
|
|
11
|
-
}
|
|
12
|
-
consume(key) {
|
|
13
|
-
const consumeEvent = new CustomEvent(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, {
|
|
14
|
-
bubbles: true,
|
|
15
|
-
cancelable: true,
|
|
16
|
-
composed: true,
|
|
17
|
-
detail: { key }
|
|
18
|
-
});
|
|
19
|
-
__classPrivateFieldGet(this, _ContextConsumerController_host, "f").dispatchEvent(consumeEvent);
|
|
20
|
-
return consumeEvent.detail[key];
|
|
21
|
-
}
|
|
22
|
-
// Added to fix typescript error
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
24
|
-
hostConnected() { }
|
|
25
|
-
}
|
|
26
|
-
_ContextConsumerController_host = new WeakMap();
|
|
27
|
-
|
|
28
|
-
export { ContextConsumerController };
|
|
29
|
-
//# sourceMappingURL=context_consumer_controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ReactiveControllerHost } from 'lit';
|
|
2
|
-
export declare type TWebComponentsContextControllerHost = ReactiveControllerHost & Element;
|
|
3
|
-
export declare type TConsumerEventDetails<TValue> = {
|
|
4
|
-
[key: string]: TValue | TContextValueKey;
|
|
5
|
-
};
|
|
6
|
-
export declare type TContextValueKey = string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context_controller_types.js","sourceRoot":"","sources":["../../../../../../../src/core/context/context_controller_types.ts"],"names":[],"mappings":"AAAA,OAAuC,KAAK,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ReactiveController } from 'lit';
|
|
2
|
-
import { TContextValueKey, TWebComponentsContextControllerHost } from "./context_controller_types";
|
|
3
|
-
export declare class ContextProviderController<TValue> implements ReactiveController {
|
|
4
|
-
#private;
|
|
5
|
-
constructor(host: TWebComponentsContextControllerHost);
|
|
6
|
-
provide(key: TContextValueKey, value: TValue): void;
|
|
7
|
-
hostConnected(): void;
|
|
8
|
-
hostDisconnected(): void;
|
|
9
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { __classPrivateFieldGet, __classPrivateFieldSet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import 'lit';
|
|
3
|
-
import { WEB_COMPONENT_CONTEXT_EVENTS } from './context_consumer_messages_names.js';
|
|
4
|
-
import { ValuesContainer } from '../../../../star_core/build/esm/packages/star_core/src/classes/values_container/values_container.js';
|
|
5
|
-
|
|
6
|
-
var _ContextProviderController_host, _ContextProviderController_contextValues, _ContextProviderController_handleRequestedValue;
|
|
7
|
-
class ContextProviderController {
|
|
8
|
-
constructor(host) {
|
|
9
|
-
_ContextProviderController_host.set(this, void 0);
|
|
10
|
-
_ContextProviderController_contextValues.set(this, new ValuesContainer());
|
|
11
|
-
_ContextProviderController_handleRequestedValue.set(this, (event) => {
|
|
12
|
-
const customEvent = event;
|
|
13
|
-
const valueKey = customEvent.detail.key;
|
|
14
|
-
if (!__classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").has(valueKey))
|
|
15
|
-
return;
|
|
16
|
-
customEvent.detail[valueKey] = __classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").get(valueKey);
|
|
17
|
-
event.stopPropagation();
|
|
18
|
-
});
|
|
19
|
-
__classPrivateFieldSet(this, _ContextProviderController_host, host, "f");
|
|
20
|
-
__classPrivateFieldGet(this, _ContextProviderController_host, "f").addController(this);
|
|
21
|
-
}
|
|
22
|
-
provide(key, value) {
|
|
23
|
-
__classPrivateFieldGet(this, _ContextProviderController_contextValues, "f").add(key, value);
|
|
24
|
-
}
|
|
25
|
-
hostConnected() {
|
|
26
|
-
__classPrivateFieldGet(this, _ContextProviderController_host, "f").addEventListener(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, __classPrivateFieldGet(this, _ContextProviderController_handleRequestedValue, "f"));
|
|
27
|
-
}
|
|
28
|
-
hostDisconnected() {
|
|
29
|
-
__classPrivateFieldGet(this, _ContextProviderController_host, "f").removeEventListener(WEB_COMPONENT_CONTEXT_EVENTS.valueRequested, __classPrivateFieldGet(this, _ContextProviderController_handleRequestedValue, "f"));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
_ContextProviderController_host = new WeakMap(), _ContextProviderController_contextValues = new WeakMap(), _ContextProviderController_handleRequestedValue = new WeakMap();
|
|
33
|
-
|
|
34
|
-
export { ContextProviderController };
|
|
35
|
-
//# sourceMappingURL=context_provider_controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,+DAA+D,4CAAgD;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -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,9 +0,0 @@
|
|
|
1
|
-
import { LitElement, TemplateResult, nothing } from 'lit';
|
|
2
|
-
export declare class PhoenixLightLitElement extends LitElement {
|
|
3
|
-
_slots: Record<string, TemplateResult[]>;
|
|
4
|
-
constructor();
|
|
5
|
-
firstUpdated(): void;
|
|
6
|
-
private _assignSlots;
|
|
7
|
-
getSlot(name: string): TemplateResult[] | typeof nothing;
|
|
8
|
-
createRenderRoot(): PhoenixLightLitElement;
|
|
9
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from '../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { LitElement, html, nothing } from 'lit';
|
|
3
|
-
import { DEFAULT_SLOT_NAME } from './phoenix_light_lit_elements_constants.js';
|
|
4
|
-
import { state } from 'lit/decorators';
|
|
5
|
-
|
|
6
|
-
class PhoenixLightLitElement extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this._slots = {};
|
|
10
|
-
}
|
|
11
|
-
firstUpdated() {
|
|
12
|
-
this._slots = this._assignSlots();
|
|
13
|
-
this.requestUpdate();
|
|
14
|
-
}
|
|
15
|
-
_assignSlots() {
|
|
16
|
-
return [...this.querySelectorAll(':scope > [slot]')].reduce((acc, $el) => {
|
|
17
|
-
var _a;
|
|
18
|
-
const slotName = $el.slot || DEFAULT_SLOT_NAME;
|
|
19
|
-
acc[slotName] = acc[slotName] || [];
|
|
20
|
-
acc[slotName].push(html `${$el}`);
|
|
21
|
-
(_a = $el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild($el);
|
|
22
|
-
$el.removeAttribute('slot');
|
|
23
|
-
return acc;
|
|
24
|
-
}, this._slots);
|
|
25
|
-
}
|
|
26
|
-
getSlot(name) {
|
|
27
|
-
try {
|
|
28
|
-
return this._slots[name];
|
|
29
|
-
}
|
|
30
|
-
catch (_a) { }
|
|
31
|
-
return nothing;
|
|
32
|
-
}
|
|
33
|
-
createRenderRoot() {
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
__decorate([
|
|
38
|
-
state(),
|
|
39
|
-
__metadata("design:type", Object)
|
|
40
|
-
], PhoenixLightLitElement.prototype, "_slots", void 0);
|
|
41
|
-
|
|
42
|
-
export { PhoenixLightLitElement };
|
|
43
|
-
//# sourceMappingURL=phoenix_light_lit_element.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,yCAA6C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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 +0,0 @@
|
|
|
1
|
-
export declare const DEFAULT_SLOT_NAME = "default";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"global_types.js","sourceRoot":"","sources":["../../../../../src/global_types.ts"],"names":[],"mappings":""}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
export declare class HelloButton extends LitElement {
|
|
3
|
-
static moduleName: string;
|
|
4
|
-
static styles: import("lit").CSSResult;
|
|
5
|
-
greeting: string;
|
|
6
|
-
planet: string;
|
|
7
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
8
|
-
togglePlanet(): void;
|
|
9
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from '../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { LitElement, html, css } from 'lit';
|
|
3
|
-
import { state } from 'lit/decorators';
|
|
4
|
-
import { phoenixCustomElement } from './core/decorators/phoenix_custom_element.js';
|
|
5
|
-
|
|
6
|
-
let HelloButton = class HelloButton extends LitElement {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.greeting = 'Hello';
|
|
10
|
-
this.planet = 'World';
|
|
11
|
-
}
|
|
12
|
-
render() {
|
|
13
|
-
super.render();
|
|
14
|
-
return html `
|
|
15
|
-
<span @click="${this.togglePlanet}"
|
|
16
|
-
>${this.greeting}
|
|
17
|
-
<span class="planet">${this.planet}</span>
|
|
18
|
-
<slot></slot>
|
|
19
|
-
</span>
|
|
20
|
-
`;
|
|
21
|
-
}
|
|
22
|
-
togglePlanet() {
|
|
23
|
-
this.planet = this.planet === 'World' ? 'Mars' : 'World';
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
HelloButton.moduleName = 'my-element';
|
|
27
|
-
HelloButton.styles = css `
|
|
28
|
-
:host {
|
|
29
|
-
display: inline-block;
|
|
30
|
-
padding: 10px;
|
|
31
|
-
background: lightgray;
|
|
32
|
-
}
|
|
33
|
-
.planet {
|
|
34
|
-
color: var(--planet-color, blue);
|
|
35
|
-
}
|
|
36
|
-
`;
|
|
37
|
-
__decorate([
|
|
38
|
-
state(),
|
|
39
|
-
__metadata("design:type", Object)
|
|
40
|
-
], HelloButton.prototype, "greeting", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
state(),
|
|
43
|
-
__metadata("design:type", Object)
|
|
44
|
-
], HelloButton.prototype, "planet", void 0);
|
|
45
|
-
HelloButton = __decorate([
|
|
46
|
-
phoenixCustomElement('hello-button')
|
|
47
|
-
], HelloButton);
|
|
48
|
-
|
|
49
|
-
export { HelloButton };
|
|
50
|
-
//# sourceMappingURL=hello_button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
export { IPhoenixWebComponentClass } from "./global_types";
|
|
2
|
-
export { ContextProviderController } from "./core/context/context_provider_controller";
|
|
3
|
-
export { ContextConsumerController } from "./core/context/context_consumer_controller";
|
|
4
|
-
export { PhoenixLightLitElement } from "./core/phoenix_light_lit_element";
|
|
5
|
-
export { HelloButton } from './hello_button';
|
|
6
|
-
export { HPortal } from './components/portal/portal';
|
|
7
|
-
export { HPortalTarget } from './components/portal/portal_target';
|
|
8
|
-
export { HModal } from './components/modal/modal';
|
|
9
|
-
export { HModalOpener } from './components/modal/modal_opener';
|
|
10
|
-
export { HModalBackdrop } from './components/modal/modal_backdrop';
|
|
11
|
-
export { HModalBody } from './components/modal/modal_body';
|
|
12
|
-
export { HModalFooter } from './components/modal/modal_footer';
|
|
13
|
-
export { HModalHeader } from './components/modal/modal_header';
|
|
14
|
-
export { HModalClose } from './components/modal/modal_close';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { ContextProviderController } from './core/context/context_provider_controller.js';
|
|
2
|
-
export { ContextConsumerController } from './core/context/context_consumer_controller.js';
|
|
3
|
-
export { PhoenixLightLitElement } from './core/phoenix_light_lit_element.js';
|
|
4
|
-
export { HelloButton } from './hello_button.js';
|
|
5
|
-
export { HPortalTarget } from './components/portal/portal_target.js';
|
|
6
|
-
export { HPortal } from './components/portal/portal.js';
|
|
7
|
-
export { HModal } from './components/modal/modal.js';
|
|
8
|
-
export { HModalOpener } from './components/modal/modal_opener.js';
|
|
9
|
-
export { HModalBackdrop } from './components/modal/modal_backdrop.js';
|
|
10
|
-
export { HModalBody } from './components/modal/modal_body.js';
|
|
11
|
-
export { HModalFooter } from './components/modal/modal_footer.js';
|
|
12
|
-
export { HModalHeader } from './components/modal/modal_header.js';
|
|
13
|
-
export { HModalClose } from './components/modal/modal_close.js';
|
|
14
|
-
//# sourceMappingURL=index.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;"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation.
|
|
3
|
-
|
|
4
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
-
purpose with or without fee is hereby granted.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
8
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
9
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
10
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
11
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
13
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
17
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
23
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
24
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
25
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
26
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { __classPrivateFieldGet, __classPrivateFieldSet };
|
|
30
|
-
//# sourceMappingURL=tslib.es6.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;"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from '../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { ValuesContainerError } from './values_container_error.js';
|
|
3
|
-
|
|
4
|
-
var _ValuesContainer_valuesContainer, _ValuesContainer_settings;
|
|
5
|
-
class ValuesContainer {
|
|
6
|
-
constructor(settings = {}) {
|
|
7
|
-
_ValuesContainer_valuesContainer.set(this, {});
|
|
8
|
-
_ValuesContainer_settings.set(this, {
|
|
9
|
-
silentMode: true,
|
|
10
|
-
allowOverwrite: false
|
|
11
|
-
});
|
|
12
|
-
__classPrivateFieldSet(this, _ValuesContainer_settings, {
|
|
13
|
-
...__classPrivateFieldGet(this, _ValuesContainer_settings, "f"),
|
|
14
|
-
...settings
|
|
15
|
-
}, "f");
|
|
16
|
-
}
|
|
17
|
-
add(key, value) {
|
|
18
|
-
if (this.has(key) && !__classPrivateFieldGet(this, _ValuesContainer_settings, "f").allowOverwrite)
|
|
19
|
-
this._handleError(new ValuesContainerError(`value under key [${key}] already exists`));
|
|
20
|
-
__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key] = value;
|
|
21
|
-
}
|
|
22
|
-
update(key, value) {
|
|
23
|
-
if (!this.has(key))
|
|
24
|
-
this._handleError(new ValuesContainerError(`value under key [${key}] doesn't exist`));
|
|
25
|
-
__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key] = value;
|
|
26
|
-
}
|
|
27
|
-
remove(key) {
|
|
28
|
-
if (!this.has(key))
|
|
29
|
-
this._handleError(new ValuesContainerError(`${key} doesn't exist, cannot be removed`));
|
|
30
|
-
delete __classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key];
|
|
31
|
-
}
|
|
32
|
-
has(key) {
|
|
33
|
-
return this.get(key) !== undefined;
|
|
34
|
-
}
|
|
35
|
-
get(key) {
|
|
36
|
-
return __classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f")[key];
|
|
37
|
-
}
|
|
38
|
-
keys() {
|
|
39
|
-
return Object.keys(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
40
|
-
}
|
|
41
|
-
values() {
|
|
42
|
-
return Object.values(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
43
|
-
}
|
|
44
|
-
entries() {
|
|
45
|
-
return Object.entries(__classPrivateFieldGet(this, _ValuesContainer_valuesContainer, "f"));
|
|
46
|
-
}
|
|
47
|
-
clear() {
|
|
48
|
-
__classPrivateFieldSet(this, _ValuesContainer_valuesContainer, {}, "f");
|
|
49
|
-
}
|
|
50
|
-
size() {
|
|
51
|
-
return this.keys().length;
|
|
52
|
-
}
|
|
53
|
-
_handleError(error) {
|
|
54
|
-
if (__classPrivateFieldGet(this, _ValuesContainer_settings, "f").silentMode)
|
|
55
|
-
return;
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
_ValuesContainer_valuesContainer = new WeakMap(), _ValuesContainer_settings = new WeakMap();
|
|
60
|
-
|
|
61
|
-
export { ValuesContainer };
|
|
62
|
-
//# sourceMappingURL=values_container.js.map
|