@things-factory/operato-ecs 7.0.2 → 7.0.4

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 (33) hide show
  1. package/assets/javascript/wellstek-gantt.js +19758 -0
  2. package/dist-client/bootstrap.d.ts +6 -0
  3. package/dist-client/bootstrap.js +255 -0
  4. package/dist-client/bootstrap.js.map +1 -0
  5. package/dist-client/index.js +2 -0
  6. package/dist-client/index.js.map +1 -0
  7. package/dist-client/pages/api/api-sandbox.d.ts +1 -0
  8. package/dist-client/pages/api/api-sandbox.js +42 -0
  9. package/dist-client/pages/api/api-sandbox.js.map +1 -0
  10. package/dist-client/pages/resource-gantt/data.d.ts +2477 -0
  11. package/dist-client/pages/resource-gantt/data.js +207030 -0
  12. package/dist-client/pages/resource-gantt/data.js.map +1 -0
  13. package/dist-client/pages/resource-gantt/resource-gantt.d.ts +29 -0
  14. package/dist-client/pages/resource-gantt/resource-gantt.js +192 -0
  15. package/dist-client/pages/resource-gantt/resource-gantt.js.map +1 -0
  16. package/dist-client/route.d.ts +1 -0
  17. package/dist-client/route.js +13 -0
  18. package/dist-client/route.js.map +1 -0
  19. package/dist-client/tsconfig.tsbuildinfo +1 -0
  20. package/package.json +18 -14
  21. package/schema.graphql +1 -1
  22. package/things-factory.config.js +5 -10
  23. package/translations/en.json +4 -1
  24. package/translations/ja.json +4 -1
  25. package/translations/ko.json +4 -1
  26. package/translations/ms.json +4 -1
  27. package/translations/zh.json +4 -1
  28. package/client/bootstrap.js +0 -286
  29. package/client/pages/api/api-sandbox.js +0 -45
  30. package/client/route.js +0 -10
  31. /package/{client/index.js → dist-client/index.d.ts} +0 -0
  32. /package/{client → dist-client}/themes/dark.css +0 -0
  33. /package/{client → dist-client}/themes/light.css +0 -0
@@ -0,0 +1,29 @@
1
+ import { PropertyValues } from 'lit';
2
+ import { PageView } from '@operato/shell';
3
+ declare const ResourceGantt_base: (new (...args: any[]) => {
4
+ _storeUnsubscribe: import("redux").Unsubscribe;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ stateChanged(_state: unknown): void;
8
+ readonly isConnected: boolean;
9
+ }) & typeof PageView;
10
+ export declare class ResourceGantt extends ResourceGantt_base {
11
+ static styles: import("lit").CSSResult[];
12
+ itemId?: string;
13
+ params: any;
14
+ container: HTMLDivElement;
15
+ get context(): {
16
+ title: string;
17
+ help: string;
18
+ };
19
+ render(): import("lit-html").TemplateResult<1>;
20
+ updated(changes: PropertyValues<this>): void;
21
+ stateChanged(state: any): void;
22
+ pageInitialized(lifecycle: any): void;
23
+ loadScript(src: string): Promise<void>;
24
+ initializeGantt(): void;
25
+ pageUpdated(changes: any, lifecycle: any, before: any): void;
26
+ pageDisposed(lifecycle: any): void;
27
+ save(): void;
28
+ }
29
+ export {};
@@ -0,0 +1,192 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { html, css } from 'lit';
3
+ import { customElement, property, query } from 'lit/decorators.js';
4
+ import { connect } from 'pwa-helpers/connect-mixin.js';
5
+ import { store, PageView } from '@operato/shell';
6
+ import { i18next } from '@operato/i18n';
7
+ import { ScrollbarStyles } from '@operato/styles';
8
+ import { OxPrompt } from '@operato/popup/ox-prompt.js';
9
+ import { data } from './data';
10
+ const wellstekGantt = new URL('/assets/javascript/wellstek-gantt.js', import.meta.url).href;
11
+ let ResourceGantt = class ResourceGantt extends connect(store)(PageView) {
12
+ get context() {
13
+ return {
14
+ title: i18next.t('title.resource-gantt'),
15
+ help: 'operato-ecs/resource-gantt'
16
+ // actions: [
17
+ // {
18
+ // title: i18next.t('button.back'),
19
+ // action: () => {
20
+ // history.back()
21
+ // },
22
+ // ...CommonButtonStyles.back
23
+ // }
24
+ // ]
25
+ };
26
+ }
27
+ render() {
28
+ return html ` <div id="gantt"></div> `;
29
+ }
30
+ updated(changes) {
31
+ /*
32
+ * If this page properties are changed, this callback will be invoked.
33
+ * This callback will be called back only when this page is activated.
34
+ */
35
+ if (changes.has('itemId') || changes.has('params')) {
36
+ /* do something */
37
+ }
38
+ }
39
+ stateChanged(state) {
40
+ /*
41
+ * application wide state changed
42
+ *
43
+ */
44
+ }
45
+ /*
46
+ * page lifecycle
47
+ *
48
+ * - pageInitialized(lifecycle)
49
+ * - pageUpdated(changes, lifecycle, changedBefore)
50
+ * - pageDisposed(lifecycle)
51
+ *
52
+ * lifecycle value has
53
+ * - active : this page is activated
54
+ * - page : first path of href
55
+ * - resourceId : second path of href
56
+ * - params : search params object of href
57
+ * - initialized : initialized state of this page
58
+ *
59
+ * you can update lifecycle values, or add custom values
60
+ * by calling this.pageUpdate({ ...values }, force)
61
+ * If lifecycle values changed by this.pageUpdate(...),
62
+ * this.pageUpdated(...) will be called back right after.
63
+ * If you want to invoke this.pageUpdated(...) callback,
64
+ * set force argument to true.
65
+ *
66
+ * you can re-initialize this page
67
+ * by calling this.pageReset().
68
+ * this.pageInitialized(...) followed by this.pageDisposed(...) will be invoked
69
+ * by calling this.pageReset().
70
+ *
71
+ * you can invoke this.pageDisposed()
72
+ * by calling this.pageDispose()
73
+ */
74
+ pageInitialized(lifecycle) {
75
+ this.loadScript(wellstekGantt).then(() => {
76
+ this.initializeGantt();
77
+ // this.loadScript('./colors.js').then(() => {})
78
+ });
79
+ /*
80
+ * This page is initialized.
81
+ * It's right time to configure of this page.
82
+ *
83
+ * - called before when this page activated first
84
+ * - called when i18next resource is updated (loaded, changed, ..)
85
+ * - called right after this.pageReset()
86
+ */
87
+ }
88
+ loadScript(src) {
89
+ return new Promise((resolve, reject) => {
90
+ const script = document.createElement('script');
91
+ script.src = src;
92
+ script.onload = () => resolve();
93
+ script.onerror = () => reject(new Error(`Script load error for ${src}`));
94
+ this.renderRoot.appendChild(script);
95
+ });
96
+ }
97
+ initializeGantt() {
98
+ const options = {
99
+ //dateAdapter: new MomentWellstekGanttDateAdapter(moment),
100
+ data,
101
+ //rows: data.rows,
102
+ //tasks: data.tasks,
103
+ //from: data.fromDate,
104
+ //to: data.toDate,
105
+ //ganttTableModules: [WellstekGanttTable],
106
+ //ganttBodyModules: [WellstekGanttDependencies],
107
+ columnOffset: 15,
108
+ magnetOffset: 15,
109
+ rowHeight: 35,
110
+ rowPadding: 5,
111
+ headers: [
112
+ { unit: 'day', format: 'MM-DD' },
113
+ { unit: 'hour', format: 'HH:mm', offset: 12 }
114
+ ],
115
+ fitWidth: false,
116
+ minWidth: 1500,
117
+ tableHeader: {
118
+ title: '필터',
119
+ property: 'label',
120
+ type: 'tree',
121
+ isFilter: true
122
+ },
123
+ tableWidth: 140,
124
+ columnUnit: 'hour'
125
+ };
126
+ window.gantt = new window.WellstekGantt({
127
+ target: this.container,
128
+ props: options
129
+ });
130
+ }
131
+ pageUpdated(changes, lifecycle, before) {
132
+ if (this.active) {
133
+ /*
134
+ * this page is activated
135
+ */
136
+ this.itemId = lifecycle.resourceId;
137
+ this.params = lifecycle.params;
138
+ }
139
+ else {
140
+ /* this page is deactivated */
141
+ }
142
+ }
143
+ pageDisposed(lifecycle) {
144
+ /*
145
+ * This page is disposed.
146
+ * It's right time to release system resources.
147
+ *
148
+ * - called just before (re)pageInitialized
149
+ * - called right after when i18next resource updated (loaded, changed, ..)
150
+ * - called right after this.pageReset()
151
+ * - called right after this.pageDispose()
152
+ */
153
+ }
154
+ save() {
155
+ OxPrompt.open({
156
+ type: 'success',
157
+ title: i18next.t('text.completed'),
158
+ text: i18next.t('text.data_saved_successfully'),
159
+ confirmButton: { text: i18next.t('button.confirm') }
160
+ });
161
+ }
162
+ };
163
+ ResourceGantt.styles = [
164
+ ScrollbarStyles,
165
+ css `
166
+ :host {
167
+ display: block;
168
+ }
169
+
170
+ #gantt {
171
+ border: 1px solid #eee;
172
+ height: 100%;
173
+ }
174
+ `
175
+ ];
176
+ __decorate([
177
+ property({ type: String }),
178
+ __metadata("design:type", String)
179
+ ], ResourceGantt.prototype, "itemId", void 0);
180
+ __decorate([
181
+ property({ type: Object }),
182
+ __metadata("design:type", Object)
183
+ ], ResourceGantt.prototype, "params", void 0);
184
+ __decorate([
185
+ query('#gantt'),
186
+ __metadata("design:type", HTMLDivElement)
187
+ ], ResourceGantt.prototype, "container", void 0);
188
+ ResourceGantt = __decorate([
189
+ customElement('resource-gantt')
190
+ ], ResourceGantt);
191
+ export { ResourceGantt };
192
+ //# sourceMappingURL=resource-gantt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-gantt.js","sourceRoot":"","sources":["../../../client/pages/resource-gantt/resource-gantt.ts"],"names":[],"mappings":";AAAA,OAAO,EAAkB,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAS,MAAM,mBAAmB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAEtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAY,MAAM,eAAe,CAAA;AACjD,OAAO,EAAsB,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,sCAAsC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAGpF,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAoBzD,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;YACxC,IAAI,EAAE,4BAA4B;YAClC,aAAa;YACb,MAAM;YACN,uCAAuC;YACvC,sBAAsB;YACtB,uBAAuB;YACvB,SAAS;YACT,iCAAiC;YACjC,MAAM;YACN,IAAI;SACL,CAAA;IACH,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,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,CAYZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAAgB;AACf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAAY;AAEtB;IAAhB,KAAK,CAAC,QAAQ,CAAC;8BAAa,cAAc;gDAAA;AAlBhC,aAAa;IADzB,aAAa,CAAC,gBAAgB,CAAC;GACnB,aAAa,CAsLzB","sourcesContent":["import { PropertyValues, html, css } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\n\nimport { store, PageView } from '@operato/shell'\nimport { i18next, localize } from '@operato/i18n'\nimport { CommonButtonStyles, ScrollbarStyles } from '@operato/styles'\nimport { OxPrompt } from '@operato/popup/ox-prompt.js'\n\nimport { data } from './data'\n\nconst wellstekGantt = new URL('/assets/javascript/wellstek-gantt.js', import.meta.url).href\n\n@customElement('resource-gantt')\nexport class ResourceGantt extends connect(store)(PageView) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: block;\n }\n\n #gantt {\n border: 1px solid #eee;\n height: 100%;\n }\n `\n ]\n\n @property({ type: String }) itemId?: string\n @property({ type: Object }) params: any\n\n @query('#gantt') container!: HTMLDivElement\n\n get context() {\n return {\n title: i18next.t('title.resource-gantt'),\n help: 'operato-ecs/resource-gantt'\n // actions: [\n // {\n // title: i18next.t('button.back'),\n // action: () => {\n // history.back()\n // },\n // ...CommonButtonStyles.back\n // }\n // ]\n }\n }\n\n render() {\n return html` <div id=\"gantt\"></div> `\n }\n\n updated(changes: PropertyValues<this>) {\n /*\n * If this page properties are changed, this callback will be invoked.\n * This callback will be called back only when this page is activated.\n */\n if (changes.has('itemId') || changes.has('params')) {\n /* do something */\n }\n }\n\n stateChanged(state: any) {\n /*\n * application wide state changed\n *\n */\n }\n\n /*\n * page lifecycle\n *\n * - pageInitialized(lifecycle)\n * - pageUpdated(changes, lifecycle, changedBefore)\n * - pageDisposed(lifecycle)\n *\n * lifecycle value has\n * - active : this page is activated\n * - page : first path of href\n * - resourceId : second path of href\n * - params : search params object of href\n * - initialized : initialized state of this page\n *\n * you can update lifecycle values, or add custom values\n * by calling this.pageUpdate({ ...values }, force)\n * If lifecycle values changed by this.pageUpdate(...),\n * this.pageUpdated(...) will be called back right after.\n * If you want to invoke this.pageUpdated(...) callback,\n * set force argument to true.\n *\n * you can re-initialize this page\n * by calling this.pageReset().\n * this.pageInitialized(...) followed by this.pageDisposed(...) will be invoked\n * by calling this.pageReset().\n *\n * you can invoke this.pageDisposed()\n * by calling this.pageDispose()\n */\n\n pageInitialized(lifecycle: any) {\n this.loadScript(wellstekGantt).then(() => {\n this.initializeGantt()\n\n // this.loadScript('./colors.js').then(() => {})\n })\n\n /*\n * This page is initialized.\n * It's right time to configure of this page.\n *\n * - called before when this page activated first\n * - called when i18next resource is updated (loaded, changed, ..)\n * - called right after this.pageReset()\n */\n }\n\n loadScript(src: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const script = document.createElement('script')\n script.src = src\n script.onload = () => resolve()\n script.onerror = () => reject(new Error(`Script load error for ${src}`))\n this.renderRoot.appendChild(script)\n })\n }\n\n initializeGantt() {\n const options = {\n //dateAdapter: new MomentWellstekGanttDateAdapter(moment),\n data,\n //rows: data.rows,\n //tasks: data.tasks,\n //from: data.fromDate,\n //to: data.toDate,\n //ganttTableModules: [WellstekGanttTable],\n //ganttBodyModules: [WellstekGanttDependencies],\n columnOffset: 15,\n magnetOffset: 15,\n rowHeight: 35,\n rowPadding: 5,\n headers: [\n { unit: 'day', format: 'MM-DD' },\n { unit: 'hour', format: 'HH:mm', offset: 12 }\n ],\n fitWidth: false,\n minWidth: 1500,\n tableHeader: {\n title: '필터',\n property: 'label',\n type: 'tree',\n isFilter: true\n },\n tableWidth: 140,\n columnUnit: 'hour'\n }\n\n ;(window as any).gantt = new (window as any).WellstekGantt({\n target: this.container,\n props: options\n })\n }\n\n pageUpdated(changes: any, lifecycle: any, before: any) {\n if (this.active) {\n /*\n * this page is activated\n */\n this.itemId = lifecycle.resourceId\n this.params = lifecycle.params\n } else {\n /* this page is deactivated */\n }\n }\n\n pageDisposed(lifecycle: any) {\n /*\n * This page is disposed.\n * It's right time to release system resources.\n *\n * - called just before (re)pageInitialized\n * - called right after when i18next resource updated (loaded, changed, ..)\n * - called right after this.pageReset()\n * - called right after this.pageDispose()\n */\n }\n\n save() {\n OxPrompt.open({\n type: 'success',\n title: i18next.t('text.completed'),\n text: i18next.t('text.data_saved_successfully'),\n confirmButton: { text: i18next.t('button.confirm') }\n })\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export default function route(page: any): any;
@@ -0,0 +1,13 @@
1
+ export default function route(page) {
2
+ switch (page) {
3
+ case '':
4
+ return '/dashboard';
5
+ case 'api-sandbox':
6
+ import('./pages/api/api-sandbox');
7
+ return page;
8
+ case 'resource-gantt':
9
+ import('./pages/resource-gantt/resource-gantt');
10
+ return page;
11
+ }
12
+ }
13
+ //# sourceMappingURL=route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route.js","sourceRoot":"","sources":["../client/route.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,IAAI;IAChC,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,EAAE;YACL,OAAO,YAAY,CAAA;QAErB,KAAK,aAAa;YAChB,MAAM,CAAC,yBAAyB,CAAC,CAAA;YACjC,OAAO,IAAI,CAAA;QAEb,KAAK,gBAAgB;YACnB,MAAM,CAAC,uCAAuC,CAAC,CAAA;YAC/C,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC","sourcesContent":["export default function route(page) {\n switch (page) {\n case '':\n return '/dashboard'\n\n case 'api-sandbox':\n import('./pages/api/api-sandbox')\n return page\n\n case 'resource-gantt':\n import('./pages/resource-gantt/resource-gantt')\n return page\n }\n}\n"]}