ednl-liftstatus-web-components 1.0.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 (65) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -0
  3. package/dist/cjs/ednl-liftstatus-web-components.cjs.js +19 -0
  4. package/dist/cjs/index-844f384e.js +1073 -0
  5. package/dist/cjs/index.cjs.js +2 -0
  6. package/dist/cjs/loader.cjs.js +21 -0
  7. package/dist/cjs/ls-3d-scene_8.cjs.entry.js +10130 -0
  8. package/dist/collection/collection-manifest.json +19 -0
  9. package/dist/collection/components/ls-3d-scene/ls-3d-scene.css +4 -0
  10. package/dist/collection/components/ls-3d-scene/ls-3d-scene.js +17 -0
  11. package/dist/collection/components/ls-counters/ls-counters.css +4 -0
  12. package/dist/collection/components/ls-counters/ls-counters.js +17 -0
  13. package/dist/collection/components/ls-data/ls-data.css +4 -0
  14. package/dist/collection/components/ls-data/ls-data.js +51 -0
  15. package/dist/collection/components/ls-history/ls-history.css +4 -0
  16. package/dist/collection/components/ls-history/ls-history.js +17 -0
  17. package/dist/collection/components/ls-status/ls-status.css +4 -0
  18. package/dist/collection/components/ls-status/ls-status.js +24 -0
  19. package/dist/collection/components/ls-status-history/ls-status-history.css +4 -0
  20. package/dist/collection/components/ls-status-history/ls-status-history.js +17 -0
  21. package/dist/collection/components/ls-status-item/ls-status-item.css +19 -0
  22. package/dist/collection/components/ls-status-item/ls-status-item.js +68 -0
  23. package/dist/collection/components/ls-swimlane/ls-swimlane.css +4 -0
  24. package/dist/collection/components/ls-swimlane/ls-swimlane.js +17 -0
  25. package/dist/collection/index.js +1 -0
  26. package/dist/collection/utils/utils.js +3 -0
  27. package/dist/custom-elements/index.d.ts +87 -0
  28. package/dist/custom-elements/index.js +10163 -0
  29. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.css +1 -0
  30. package/dist/ednl-liftstatus-web-components/ednl-liftstatus-web-components.esm.js +1 -0
  31. package/dist/ednl-liftstatus-web-components/index.esm.js +0 -0
  32. package/dist/ednl-liftstatus-web-components/p-7b9ecd22.js +1 -0
  33. package/dist/ednl-liftstatus-web-components/p-db25283a.entry.js +2 -0
  34. package/dist/esm/ednl-liftstatus-web-components.js +17 -0
  35. package/dist/esm/index-01d5c148.js +1047 -0
  36. package/dist/esm/index.js +1 -0
  37. package/dist/esm/loader.js +17 -0
  38. package/dist/esm/ls-3d-scene_8.entry.js +10119 -0
  39. package/dist/esm/polyfills/core-js.js +11 -0
  40. package/dist/esm/polyfills/css-shim.js +1 -0
  41. package/dist/esm/polyfills/dom.js +79 -0
  42. package/dist/esm/polyfills/es5-html-element.js +1 -0
  43. package/dist/esm/polyfills/index.js +34 -0
  44. package/dist/esm/polyfills/system.js +6 -0
  45. package/dist/index.cjs.js +1 -0
  46. package/dist/index.js +1 -0
  47. package/dist/types/components/ls-3d-scene/ls-3d-scene.d.ts +3 -0
  48. package/dist/types/components/ls-counters/ls-counters.d.ts +3 -0
  49. package/dist/types/components/ls-data/ls-data.d.ts +10 -0
  50. package/dist/types/components/ls-history/ls-history.d.ts +3 -0
  51. package/dist/types/components/ls-status/ls-status.d.ts +3 -0
  52. package/dist/types/components/ls-status-history/ls-status-history.d.ts +3 -0
  53. package/dist/types/components/ls-status-item/ls-status-item.d.ts +26 -0
  54. package/dist/types/components/ls-swimlane/ls-swimlane.d.ts +3 -0
  55. package/dist/types/components.d.ts +144 -0
  56. package/dist/types/index.d.ts +1 -0
  57. package/dist/types/stencil-public-runtime.d.ts +1563 -0
  58. package/dist/types/utils/utils.d.ts +1 -0
  59. package/loader/cdn.js +3 -0
  60. package/loader/index.cjs.js +3 -0
  61. package/loader/index.d.ts +13 -0
  62. package/loader/index.es2017.js +3 -0
  63. package/loader/index.js +4 -0
  64. package/loader/package.json +10 -0
  65. package/package.json +76 -0
@@ -0,0 +1,19 @@
1
+ {
2
+ "entries": [
3
+ "./components/ls-3d-scene/ls-3d-scene.js",
4
+ "./components/ls-counters/ls-counters.js",
5
+ "./components/ls-data/ls-data.js",
6
+ "./components/ls-history/ls-history.js",
7
+ "./components/ls-status/ls-status.js",
8
+ "./components/ls-status-history/ls-status-history.js",
9
+ "./components/ls-status-item/ls-status-item.js",
10
+ "./components/ls-swimlane/ls-swimlane.js"
11
+ ],
12
+ "compiler": {
13
+ "name": "@stencil/core",
14
+ "version": "2.8.1",
15
+ "typescriptVersion": "4.2.3"
16
+ },
17
+ "collections": [],
18
+ "bundles": []
19
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, Host, h } from "@stencil/core";
2
+ export class Ls3dScene {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-3d-scene")),
7
+ h("slot", null)));
8
+ }
9
+ static get is() { return "ls-3d-scene"; }
10
+ static get encapsulation() { return "shadow"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["ls-3d-scene.css"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["ls-3d-scene.css"]
16
+ }; }
17
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, Host, h } from '@stencil/core';
2
+ export class LsCounters {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-counters")),
7
+ h("slot", null)));
8
+ }
9
+ static get is() { return "ls-counters"; }
10
+ static get encapsulation() { return "shadow"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["ls-counters.css"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["ls-counters.css"]
16
+ }; }
17
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,51 @@
1
+ import { Component, Host, h, State } from "@stencil/core";
2
+ import PubSub from "pubsub-js";
3
+ import io, { Socket } from "socket.io-client";
4
+ export class LsData {
5
+ componentWillLoad() {
6
+ const socket = io("https://api.liftstatus.nl/", {
7
+ transports: ["websocket"],
8
+ path: "/liftstatus/socket.io",
9
+ reconnectionAttempts: 5,
10
+ query: {
11
+ access_token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmciOiJFRE5MIiwib2lkIjoibGlmdHN0YXR1cy1taS0zMTkwMSIsIm90eXBlIjoiZXh0IiwiY21kcyI6dHJ1ZSwiaWF0IjoxNjMzNjg1MTI3LCJleHAiOjE2MzM3NzE1MjcsImF1ZCI6ImVkbmwtbGlmdHN0YXR1cy1hcGkiLCJpc3MiOiJFRE5MIiwic3ViIjoiNTY1In0.q6SZQ1H1n23MwxJZnorVZ16gnVYefpknYKba9hqsZfI",
12
+ },
13
+ });
14
+ socket.emit("getSensorData", {}, (_error, data) => {
15
+ this.data = data;
16
+ PubSub.publish("LS-DATA", this.data);
17
+ });
18
+ socket.on("connect", () => {
19
+ this.socketID = socket.id;
20
+ });
21
+ socket.emit("listen", {});
22
+ socket.on("module", (data) => {
23
+ const dataData = data["message"]["data"];
24
+ const dataKey = Object.keys(dataData)[0];
25
+ const dataValue = Object.values(dataData)[0];
26
+ this.data.values[dataKey] = dataValue;
27
+ PubSub.publish("LS-DATA", this.data);
28
+ });
29
+ }
30
+ render() {
31
+ return (h(Host, null,
32
+ h("fieldset", null,
33
+ h("legend", null, "ls-data")),
34
+ h("slot", null)));
35
+ }
36
+ disconnectedCallback() {
37
+ Socket.close();
38
+ }
39
+ static get is() { return "ls-data"; }
40
+ static get encapsulation() { return "shadow"; }
41
+ static get originalStyleUrls() { return {
42
+ "$": ["ls-data.css"]
43
+ }; }
44
+ static get styleUrls() { return {
45
+ "$": ["ls-data.css"]
46
+ }; }
47
+ static get states() { return {
48
+ "data": {},
49
+ "socketID": {}
50
+ }; }
51
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, Host, h } from '@stencil/core';
2
+ export class LsHistory {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-history")),
7
+ h("slot", null)));
8
+ }
9
+ static get is() { return "ls-history"; }
10
+ static get encapsulation() { return "shadow"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["ls-history.css"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["ls-history.css"]
16
+ }; }
17
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,24 @@
1
+ import { Component, Host, h } from "@stencil/core";
2
+ export class LsStatus {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-status"),
7
+ h("ls-status-item", { "sensor-id": "500", "data-label": "Status lift" }),
8
+ h("ls-status-item", { "sensor-id": "501", "data-label": "Current stop" }),
9
+ h("ls-status-item", { "sensor-id": "502", "data-label": "Front door" }),
10
+ h("ls-status-item", { "sensor-id": "503", "data-label": "Rear door" }),
11
+ h("ls-status-item", { "sensor-id": "513", "data-label": "Status" }),
12
+ h("ls-status-item", { "sensor-id": "514", "data-label": "Last passed stopping point" }),
13
+ h("ls-status-item", { "sensor-id": "515", "data-label": "Current stop" })),
14
+ h("slot", null)));
15
+ }
16
+ static get is() { return "ls-status"; }
17
+ static get encapsulation() { return "shadow"; }
18
+ static get originalStyleUrls() { return {
19
+ "$": ["ls-status.css"]
20
+ }; }
21
+ static get styleUrls() { return {
22
+ "$": ["ls-status.css"]
23
+ }; }
24
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, Host, h } from "@stencil/core";
2
+ export class LsStatusHistory {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-status-history")),
7
+ h("slot", null)));
8
+ }
9
+ static get is() { return "ls-status-history"; }
10
+ static get encapsulation() { return "shadow"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["ls-status-history.css"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["ls-status-history.css"]
16
+ }; }
17
+ }
@@ -0,0 +1,19 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ color: var(--ls-font-primary-color);
5
+ }
6
+
7
+ div.ls-label {
8
+ text-transform: uppercase;
9
+ letter-spacing: 0.05rem;
10
+ font-weight: 600;
11
+ color: #71717A;
12
+ }
13
+
14
+ div.ls-value {
15
+ font-size: 2rem;
16
+ margin-top: -0.5rem;
17
+ padding-bottom: 1rem;
18
+ height: 2.75rem;
19
+ }
@@ -0,0 +1,68 @@
1
+ import { Component, Host, h, Prop, State } from "@stencil/core";
2
+ import PubSub from "pubsub-js";
3
+ export class LsStatusItem {
4
+ constructor() {
5
+ this.updateData = (_msg, data) => {
6
+ this.sensorData = data["values"][this.sensorId];
7
+ };
8
+ }
9
+ componentWillLoad() {
10
+ this.token = PubSub.subscribe("LS-DATA", this.updateData);
11
+ }
12
+ render() {
13
+ return (h(Host, null,
14
+ h("div", { class: "ls-label" }, this.dataLabel || "Sensor data"),
15
+ h("div", { class: "ls-value" }, this.sensorData || "-"),
16
+ h("slot", null)));
17
+ }
18
+ disconnectedCallback() {
19
+ PubSub.unsubscribe(this.token);
20
+ }
21
+ static get is() { return "ls-status-item"; }
22
+ static get encapsulation() { return "shadow"; }
23
+ static get originalStyleUrls() { return {
24
+ "$": ["ls-status-item.css"]
25
+ }; }
26
+ static get styleUrls() { return {
27
+ "$": ["ls-status-item.css"]
28
+ }; }
29
+ static get properties() { return {
30
+ "sensorId": {
31
+ "type": "number",
32
+ "mutable": false,
33
+ "complexType": {
34
+ "original": "number",
35
+ "resolved": "number",
36
+ "references": {}
37
+ },
38
+ "required": false,
39
+ "optional": false,
40
+ "docs": {
41
+ "tags": [],
42
+ "text": "The ID of the sensor item that is to be displayed.\nThis ID can be found in the supplied document."
43
+ },
44
+ "attribute": "sensor-id",
45
+ "reflect": false
46
+ },
47
+ "dataLabel": {
48
+ "type": "string",
49
+ "mutable": false,
50
+ "complexType": {
51
+ "original": "string",
52
+ "resolved": "string",
53
+ "references": {}
54
+ },
55
+ "required": false,
56
+ "optional": false,
57
+ "docs": {
58
+ "tags": [],
59
+ "text": "(Optional)\nThe label for the data that is to be displayed."
60
+ },
61
+ "attribute": "data-label",
62
+ "reflect": false
63
+ }
64
+ }; }
65
+ static get states() { return {
66
+ "sensorData": {}
67
+ }; }
68
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ display: block;
3
+ font-family: var(--ls-font-family);
4
+ }
@@ -0,0 +1,17 @@
1
+ import { Component, Host, h } from "@stencil/core";
2
+ export class LsSwimlane {
3
+ render() {
4
+ return (h(Host, null,
5
+ h("fieldset", null,
6
+ h("legend", null, "ls-swimlane")),
7
+ h("slot", null)));
8
+ }
9
+ static get is() { return "ls-swimlane"; }
10
+ static get encapsulation() { return "shadow"; }
11
+ static get originalStyleUrls() { return {
12
+ "$": ["ls-swimlane.css"]
13
+ }; }
14
+ static get styleUrls() { return {
15
+ "$": ["ls-swimlane.css"]
16
+ }; }
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export function format(first, middle, last) {
2
+ return (first || '') + (middle !== '' ? ` ${middle}` : '') + (last !== '' ? ` ${last}` : '');
3
+ }
@@ -0,0 +1,87 @@
1
+ /* EdnlLiftstatusWebComponents custom elements bundle */
2
+
3
+ import type { Components, JSX } from "../types/components";
4
+
5
+ interface Ls3dScene extends Components.Ls3dScene, HTMLElement {}
6
+ export const Ls3dScene: {
7
+ prototype: Ls3dScene;
8
+ new (): Ls3dScene;
9
+ };
10
+
11
+ interface LsCounters extends Components.LsCounters, HTMLElement {}
12
+ export const LsCounters: {
13
+ prototype: LsCounters;
14
+ new (): LsCounters;
15
+ };
16
+
17
+ interface LsData extends Components.LsData, HTMLElement {}
18
+ export const LsData: {
19
+ prototype: LsData;
20
+ new (): LsData;
21
+ };
22
+
23
+ interface LsHistory extends Components.LsHistory, HTMLElement {}
24
+ export const LsHistory: {
25
+ prototype: LsHistory;
26
+ new (): LsHistory;
27
+ };
28
+
29
+ interface LsStatus extends Components.LsStatus, HTMLElement {}
30
+ export const LsStatus: {
31
+ prototype: LsStatus;
32
+ new (): LsStatus;
33
+ };
34
+
35
+ interface LsStatusHistory extends Components.LsStatusHistory, HTMLElement {}
36
+ export const LsStatusHistory: {
37
+ prototype: LsStatusHistory;
38
+ new (): LsStatusHistory;
39
+ };
40
+
41
+ interface LsStatusItem extends Components.LsStatusItem, HTMLElement {}
42
+ export const LsStatusItem: {
43
+ prototype: LsStatusItem;
44
+ new (): LsStatusItem;
45
+ };
46
+
47
+ interface LsSwimlane extends Components.LsSwimlane, HTMLElement {}
48
+ export const LsSwimlane: {
49
+ prototype: LsSwimlane;
50
+ new (): LsSwimlane;
51
+ };
52
+
53
+ /**
54
+ * Utility to define all custom elements within this package using the tag name provided in the component's source.
55
+ * When defining each custom element, it will also check it's safe to define by:
56
+ *
57
+ * 1. Ensuring the "customElements" registry is available in the global context (window).
58
+ * 2. The component tag name is not already defined.
59
+ *
60
+ * Use the standard [customElements.define()](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define)
61
+ * method instead to define custom elements individually, or to provide a different tag name.
62
+ */
63
+ export declare const defineCustomElements: (opts?: any) => void;
64
+
65
+ /**
66
+ * Used to manually set the base path where assets can be found.
67
+ * If the script is used as "module", it's recommended to use "import.meta.url",
68
+ * such as "setAssetPath(import.meta.url)". Other options include
69
+ * "setAssetPath(document.currentScript.src)", or using a bundler's replace plugin to
70
+ * dynamically set the path at build time, such as "setAssetPath(process.env.ASSET_PATH)".
71
+ * But do note that this configuration depends on how your script is bundled, or lack of
72
+ * bunding, and where your assets can be loaded from. Additionally custom bundling
73
+ * will have to ensure the static assets are copied to its build directory.
74
+ */
75
+ export declare const setAssetPath: (path: string) => void;
76
+
77
+ export interface SetPlatformOptions {
78
+ raf?: (c: FrameRequestCallback) => number;
79
+ ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
80
+ rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
81
+ ce?: (eventName: string, opts?: any) => CustomEvent;
82
+ }
83
+ export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
84
+
85
+ export type { Components, JSX };
86
+
87
+ export * from '../types';