@things-factory/quotation 6.0.46

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 (98) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/assets/images/hatiolab-logo.png +0 -0
  3. package/client/actions/main.ts +1 -0
  4. package/client/activities/activity-quotation-edit.ts +90 -0
  5. package/client/activities/activity-quotation-view.ts +90 -0
  6. package/client/bootstrap.ts +8 -0
  7. package/client/index.ts +1 -0
  8. package/client/pages/main.ts +25 -0
  9. package/client/pages/quotation/quotation-importer.ts +97 -0
  10. package/client/pages/quotation/quotation-list-page.ts +348 -0
  11. package/client/reducers/main.ts +17 -0
  12. package/client/route.ts +11 -0
  13. package/client/tsconfig.json +11 -0
  14. package/dist-client/actions/main.d.ts +1 -0
  15. package/dist-client/actions/main.js +2 -0
  16. package/dist-client/actions/main.js.map +1 -0
  17. package/dist-client/activities/activity-quotation-edit.d.ts +14 -0
  18. package/dist-client/activities/activity-quotation-edit.js +87 -0
  19. package/dist-client/activities/activity-quotation-edit.js.map +1 -0
  20. package/dist-client/activities/activity-quotation-view.d.ts +14 -0
  21. package/dist-client/activities/activity-quotation-view.js +87 -0
  22. package/dist-client/activities/activity-quotation-view.js.map +1 -0
  23. package/dist-client/bootstrap.d.ts +1 -0
  24. package/dist-client/bootstrap.js +8 -0
  25. package/dist-client/bootstrap.js.map +1 -0
  26. package/dist-client/index.d.ts +1 -0
  27. package/dist-client/index.js +2 -0
  28. package/dist-client/index.js.map +1 -0
  29. package/dist-client/pages/main.d.ts +1 -0
  30. package/dist-client/pages/main.js +27 -0
  31. package/dist-client/pages/main.js.map +1 -0
  32. package/dist-client/pages/quotation/quotation-importer.d.ts +22 -0
  33. package/dist-client/pages/quotation/quotation-importer.js +100 -0
  34. package/dist-client/pages/quotation/quotation-importer.js.map +1 -0
  35. package/dist-client/pages/quotation/quotation-list-page.d.ts +62 -0
  36. package/dist-client/pages/quotation/quotation-list-page.js +326 -0
  37. package/dist-client/pages/quotation/quotation-list-page.js.map +1 -0
  38. package/dist-client/reducers/main.d.ts +6 -0
  39. package/dist-client/reducers/main.js +14 -0
  40. package/dist-client/reducers/main.js.map +1 -0
  41. package/dist-client/route.d.ts +1 -0
  42. package/dist-client/route.js +11 -0
  43. package/dist-client/route.js.map +1 -0
  44. package/dist-client/tsconfig.tsbuildinfo +1 -0
  45. package/dist-server/activities/activity-quotation.js +113 -0
  46. package/dist-server/activities/activity-quotation.js.map +1 -0
  47. package/dist-server/activities/index.js +17 -0
  48. package/dist-server/activities/index.js.map +1 -0
  49. package/dist-server/controllers/index.js +1 -0
  50. package/dist-server/controllers/index.js.map +1 -0
  51. package/dist-server/index.js +7 -0
  52. package/dist-server/index.js.map +1 -0
  53. package/dist-server/middlewares/index.js +8 -0
  54. package/dist-server/middlewares/index.js.map +1 -0
  55. package/dist-server/migrations/index.js +12 -0
  56. package/dist-server/migrations/index.js.map +1 -0
  57. package/dist-server/routes.js +25 -0
  58. package/dist-server/routes.js.map +1 -0
  59. package/dist-server/service/index.js +23 -0
  60. package/dist-server/service/index.js.map +1 -0
  61. package/dist-server/service/quotation/event-subscriber.js +21 -0
  62. package/dist-server/service/quotation/event-subscriber.js.map +1 -0
  63. package/dist-server/service/quotation/index.js +12 -0
  64. package/dist-server/service/quotation/index.js.map +1 -0
  65. package/dist-server/service/quotation/quotation-history.js +123 -0
  66. package/dist-server/service/quotation/quotation-history.js.map +1 -0
  67. package/dist-server/service/quotation/quotation-mutation.js +168 -0
  68. package/dist-server/service/quotation/quotation-mutation.js.map +1 -0
  69. package/dist-server/service/quotation/quotation-query.js +97 -0
  70. package/dist-server/service/quotation/quotation-query.js.map +1 -0
  71. package/dist-server/service/quotation/quotation-type.js +86 -0
  72. package/dist-server/service/quotation/quotation-type.js.map +1 -0
  73. package/dist-server/service/quotation/quotation.js +110 -0
  74. package/dist-server/service/quotation/quotation.js.map +1 -0
  75. package/dist-server/tsconfig.tsbuildinfo +1 -0
  76. package/helps/quotation/quotation.md +160 -0
  77. package/package.json +36 -0
  78. package/server/activities/activity-quotation.ts +112 -0
  79. package/server/activities/index.ts +17 -0
  80. package/server/controllers/index.ts +0 -0
  81. package/server/index.ts +4 -0
  82. package/server/middlewares/index.ts +3 -0
  83. package/server/migrations/index.ts +9 -0
  84. package/server/routes.ts +28 -0
  85. package/server/service/index.ts +22 -0
  86. package/server/service/quotation/event-subscriber.ts +17 -0
  87. package/server/service/quotation/index.ts +9 -0
  88. package/server/service/quotation/quotation-history.ts +110 -0
  89. package/server/service/quotation/quotation-mutation.ts +198 -0
  90. package/server/service/quotation/quotation-query.ts +62 -0
  91. package/server/service/quotation/quotation-type.ts +61 -0
  92. package/server/service/quotation/quotation.ts +95 -0
  93. package/server/tsconfig.json +10 -0
  94. package/things-factory.config.js +11 -0
  95. package/translations/en.json +1 -0
  96. package/translations/ko.json +1 -0
  97. package/translations/ms.json +1 -0
  98. package/translations/zh.json +1 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "strict": true,
5
+ "declaration": true,
6
+ "module": "esnext",
7
+ "outDir": "../dist-client",
8
+ "baseUrl": "./"
9
+ },
10
+ "include": ["./**/*"]
11
+ }
@@ -0,0 +1 @@
1
+ export declare const UPDATE_QUOTATION = "UPDATE_QUOTATION";
@@ -0,0 +1,2 @@
1
+ export const UPDATE_QUOTATION = 'UPDATE_QUOTATION';
2
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/actions/main.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAA","sourcesContent":["export const UPDATE_QUOTATION = 'UPDATE_QUOTATION'\n"]}
@@ -0,0 +1,14 @@
1
+ import '../components/quotation-edit.js';
2
+ import { LitElement } from 'lit';
3
+ declare const ActivityQuotationView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ export declare class ActivityQuotationView extends ActivityQuotationView_base {
5
+ static styles: import("lit").CSSResult[];
6
+ input?: any;
7
+ output?: any;
8
+ quotation?: any;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ onChange(): Promise<void>;
11
+ updated(changes: any): void;
12
+ fetchQuotation(): Promise<void>;
13
+ }
14
+ export {};
@@ -0,0 +1,87 @@
1
+ /*
2
+ Add the following line to clinet/bootstrap.ts so that activity editor can be registered when loading a module.
3
+ --
4
+ import './activities/quotation-edit.js' // refered by the activity template (activity-quotation) on server
5
+ */
6
+ import { __decorate, __metadata } from "tslib";
7
+ import '../components/quotation-edit.js';
8
+ import gql from 'graphql-tag';
9
+ import { css, html, LitElement } from 'lit';
10
+ import { customElement, property, state } from 'lit/decorators.js';
11
+ import { client } from '@operato/graphql';
12
+ import { i18next, localize } from '@operato/i18n';
13
+ import { ScrollbarStyles } from '@operato/styles';
14
+ // import { QuotationView } from '../components/quotation-edit.js'
15
+ let ActivityQuotationView = class ActivityQuotationView extends localize(i18next)(LitElement) {
16
+ // @query('quotation-edit') quotationView!: QuotationView
17
+ render() {
18
+ return html `
19
+ <quotation-edit .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-edit>
20
+ `;
21
+ }
22
+ async onChange() {
23
+ // this.output = this.quotationView.value
24
+ this.dispatchEvent(new CustomEvent('change', {
25
+ detail: this.output
26
+ }));
27
+ }
28
+ updated(changes) {
29
+ if (changes.has('input')) {
30
+ this.fetchQuotation();
31
+ }
32
+ }
33
+ async fetchQuotation() {
34
+ const id = this.input.quotationId;
35
+ if (id) {
36
+ const response = await client.query({
37
+ query: gql `
38
+ query ($id: String!) {
39
+ quotation(id: $id) {
40
+ id
41
+ name
42
+ description
43
+ }
44
+ }
45
+ `,
46
+ variables: {
47
+ id
48
+ }
49
+ });
50
+ this.quotation = response.data.quotation;
51
+ }
52
+ }
53
+ };
54
+ ActivityQuotationView.styles = [
55
+ ScrollbarStyles,
56
+ css `
57
+ :host {
58
+ display: flex;
59
+ flex-direction: column;
60
+
61
+ background-color: #fff;
62
+ }
63
+
64
+ quotation-edit {
65
+ flex: 1;
66
+ padding: 10px;
67
+ overflow: auto;
68
+ }
69
+ `
70
+ ];
71
+ __decorate([
72
+ property({ type: Object }),
73
+ __metadata("design:type", Object)
74
+ ], ActivityQuotationView.prototype, "input", void 0);
75
+ __decorate([
76
+ property({ type: Object }),
77
+ __metadata("design:type", Object)
78
+ ], ActivityQuotationView.prototype, "output", void 0);
79
+ __decorate([
80
+ state(),
81
+ __metadata("design:type", Object)
82
+ ], ActivityQuotationView.prototype, "quotation", void 0);
83
+ ActivityQuotationView = __decorate([
84
+ customElement('activity-quotation-edit')
85
+ ], ActivityQuotationView);
86
+ export { ActivityQuotationView };
87
+ //# sourceMappingURL=activity-quotation-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-quotation-edit.js","sourceRoot":"","sources":["../../client/activities/activity-quotation-edit.ts"],"names":[],"mappings":"AAAA;;;;EAIE;;AAEF,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,kEAAkE;AAG3D,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAwBtE,yDAAyD;IAEzD,MAAM;QACJ,OAAO,IAAI,CAAA;mCACoB,IAAI,CAAC,SAAS,WAAW,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,QAAQ;KAC3F,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,yCAAyC;QAEzC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,EAAE,CAAA;SACtB;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;QAEjC,IAAI,EAAE,EAAE;YACN,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;SAQT;gBACD,SAAS,EAAE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAA;SACzC;IACH,CAAC;;AApEM,4BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAExC;IAAC,KAAK,EAAE;;wDAAgB;AAtBb,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CAsEjC;SAtEY,qBAAqB","sourcesContent":["/* \nAdd the following line to clinet/bootstrap.ts so that activity editor can be registered when loading a module.\n--\nimport './activities/quotation-edit.js' // refered by the activity template (activity-quotation) on server\n*/\n\nimport '../components/quotation-edit.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n// import { QuotationView } from '../components/quotation-edit.js'\n\n@customElement('activity-quotation-edit')\nexport class ActivityQuotationView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n quotation-edit {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() quotation?: any //Quotation\n\n // @query('quotation-edit') quotationView!: QuotationView\n\n render() {\n return html`\n <quotation-edit .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-edit>\n `\n }\n\n async onChange() {\n // this.output = this.quotationView.value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchQuotation()\n }\n }\n\n async fetchQuotation() {\n const id = this.input.quotationId\n\n if (id) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n quotation(id: $id) {\n id\n name\n description\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.quotation = response.data.quotation\n }\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import '../components/quotation-view.js';
2
+ import { LitElement } from 'lit';
3
+ declare const ActivityQuotationView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ export declare class ActivityQuotationView extends ActivityQuotationView_base {
5
+ static styles: import("lit").CSSResult[];
6
+ input?: any;
7
+ output?: any;
8
+ quotation?: any;
9
+ render(): import("lit-html").TemplateResult<1>;
10
+ onChange(): Promise<void>;
11
+ updated(changes: any): void;
12
+ fetchQuotation(): Promise<void>;
13
+ }
14
+ export {};
@@ -0,0 +1,87 @@
1
+ /*
2
+ Add the following line to clinet/bootstrap.ts so that activity view can be registered when loading a module.
3
+ --
4
+ import './activities/quotation-view.js' // refered by the activity template (activity-data-collect) on server
5
+ */
6
+ import { __decorate, __metadata } from "tslib";
7
+ import '../components/quotation-view.js';
8
+ import gql from 'graphql-tag';
9
+ import { css, html, LitElement } from 'lit';
10
+ import { customElement, property, state } from 'lit/decorators.js';
11
+ import { client } from '@operato/graphql';
12
+ import { i18next, localize } from '@operato/i18n';
13
+ import { ScrollbarStyles } from '@operato/styles';
14
+ // import { QuotationView } from '../components/quotation-view.js'
15
+ let ActivityQuotationView = class ActivityQuotationView extends localize(i18next)(LitElement) {
16
+ // @query('quotation-view') quotationView!: QuotationView
17
+ render() {
18
+ return html `
19
+ <quotation-view .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-view>
20
+ `;
21
+ }
22
+ async onChange() {
23
+ // this.output = this.quotationView.value
24
+ this.dispatchEvent(new CustomEvent('change', {
25
+ detail: this.output
26
+ }));
27
+ }
28
+ updated(changes) {
29
+ if (changes.has('input')) {
30
+ this.fetchQuotation();
31
+ }
32
+ }
33
+ async fetchQuotation() {
34
+ const id = this.input.quotationId;
35
+ if (id) {
36
+ const response = await client.query({
37
+ query: gql `
38
+ query ($id: String!) {
39
+ quotation(id: $id) {
40
+ id
41
+ name
42
+ description
43
+ }
44
+ }
45
+ `,
46
+ variables: {
47
+ id
48
+ }
49
+ });
50
+ this.quotation = response.data.quotation;
51
+ }
52
+ }
53
+ };
54
+ ActivityQuotationView.styles = [
55
+ ScrollbarStyles,
56
+ css `
57
+ :host {
58
+ display: flex;
59
+ flex-direction: column;
60
+
61
+ background-color: #fff;
62
+ }
63
+
64
+ quotation-view {
65
+ flex: 1;
66
+ padding: 10px;
67
+ overflow: auto;
68
+ }
69
+ `
70
+ ];
71
+ __decorate([
72
+ property({ type: Object }),
73
+ __metadata("design:type", Object)
74
+ ], ActivityQuotationView.prototype, "input", void 0);
75
+ __decorate([
76
+ property({ type: Object }),
77
+ __metadata("design:type", Object)
78
+ ], ActivityQuotationView.prototype, "output", void 0);
79
+ __decorate([
80
+ state(),
81
+ __metadata("design:type", Object)
82
+ ], ActivityQuotationView.prototype, "quotation", void 0);
83
+ ActivityQuotationView = __decorate([
84
+ customElement('activity-quotation-view')
85
+ ], ActivityQuotationView);
86
+ export { ActivityQuotationView };
87
+ //# sourceMappingURL=activity-quotation-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-quotation-view.js","sourceRoot":"","sources":["../../client/activities/activity-quotation-view.ts"],"names":[],"mappings":"AAAA;;;;EAIE;;AAEF,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,kEAAkE;AAG3D,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAwBtE,yDAAyD;IAEzD,MAAM;QACJ,OAAO,IAAI,CAAA;mCACoB,IAAI,CAAC,SAAS,WAAW,IAAI,CAAC,MAAM,YAAY,IAAI,CAAC,QAAQ;KAC3F,CAAA;IACH,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,yCAAyC;QAEzC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CAAC,OAAO;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YACxB,IAAI,CAAC,cAAc,EAAE,CAAA;SACtB;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;QAEjC,IAAI,EAAE,EAAE;YACN,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAClC,KAAK,EAAE,GAAG,CAAA;;;;;;;;SAQT;gBACD,SAAS,EAAE;oBACT,EAAE;iBACH;aACF,CAAC,CAAA;YAEF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAA;SACzC;IACH,CAAC;;AApEM,4BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;KAaF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAY;AACvC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAExC;IAAC,KAAK,EAAE;;wDAAgB;AAtBb,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CAsEjC;SAtEY,qBAAqB","sourcesContent":["/* \nAdd the following line to clinet/bootstrap.ts so that activity view can be registered when loading a module.\n--\nimport './activities/quotation-view.js' // refered by the activity template (activity-data-collect) on server\n*/\n\nimport '../components/quotation-view.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { ScrollbarStyles } from '@operato/styles'\n\n// import { QuotationView } from '../components/quotation-view.js'\n\n@customElement('activity-quotation-view')\nexport class ActivityQuotationView extends localize(i18next)(LitElement) {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n quotation-view {\n flex: 1;\n padding: 10px;\n overflow: auto;\n }\n `\n ]\n\n @property({ type: Object }) input?: any\n @property({ type: Object }) output?: any\n\n @state() quotation?: any //Quotation\n\n // @query('quotation-view') quotationView!: QuotationView\n\n render() {\n return html`\n <quotation-view .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-view>\n `\n }\n\n async onChange() {\n // this.output = this.quotationView.value\n\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: this.output\n })\n )\n }\n\n updated(changes) {\n if (changes.has('input')) {\n this.fetchQuotation()\n }\n }\n\n async fetchQuotation() {\n const id = this.input.quotationId\n\n if (id) {\n const response = await client.query({\n query: gql`\n query ($id: String!) {\n quotation(id: $id) {\n id\n name\n description\n }\n }\n `,\n variables: {\n id\n }\n })\n\n this.quotation = response.data.quotation\n }\n }\n}\n"]}
@@ -0,0 +1 @@
1
+ export default function bootstrap(): void;
@@ -0,0 +1,8 @@
1
+ import { store } from '@operato/shell';
2
+ import quotation from './reducers/main';
3
+ export default function bootstrap() {
4
+ store.addReducers({
5
+ quotation
6
+ });
7
+ }
8
+ //# sourceMappingURL=bootstrap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../client/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,SAAS;IAC/B,KAAK,CAAC,WAAW,CAAC;QAChB,SAAS;KACV,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { store } from '@operato/shell'\nimport quotation from './reducers/main'\n\nexport default function bootstrap() {\n store.addReducers({\n quotation\n })\n}\n"]}
@@ -0,0 +1 @@
1
+ export * from './actions/main';
@@ -0,0 +1,2 @@
1
+ export * from './actions/main';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA","sourcesContent":["export * from './actions/main'"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { html } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { connect } from 'pwa-helpers/connect-mixin.js';
5
+ import { store, PageView } from '@operato/shell';
6
+ const logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href;
7
+ let QuotationMain = class QuotationMain extends connect(store)(PageView) {
8
+ render() {
9
+ return html `
10
+ <section>
11
+ <h2>Quotation</h2>
12
+ <img src=${logo}>
13
+ </section>
14
+ `;
15
+ }
16
+ stateChanged(state) {
17
+ this.quotation = state.quotation.state_main;
18
+ }
19
+ };
20
+ __decorate([
21
+ property({ type: String }),
22
+ __metadata("design:type", String)
23
+ ], QuotationMain.prototype, "quotation", void 0);
24
+ QuotationMain = __decorate([
25
+ customElement('quotation-main')
26
+ ], QuotationMain);
27
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../client/pages/main.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,kCAAkC,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;AAG9E,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAGlD,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI;;KAElB,CAAA;IACH,CAAC;IAED,YAAY,CAAC,KAAK;QAChB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,UAAU,CAAA;IAC7C,CAAC;CACF,CAAA;AAdC;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAmB;AAD1C,aAAa;IADlB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CAelB","sourcesContent":["import { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { connect } from 'pwa-helpers/connect-mixin.js'\nimport { store, PageView } from '@operato/shell'\n\nconst logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href\n\n@customElement('quotation-main')\nclass QuotationMain extends connect(store)(PageView) {\n @property({ type: String }) quotation?: string\n\n render() {\n return html`\n <section>\n <h2>Quotation</h2>\n <img src=${logo}>\n </section>\n `\n }\n\n stateChanged(state) {\n this.quotation = state.quotation.state_main\n }\n}\n\n"]}
@@ -0,0 +1,22 @@
1
+ import '@operato/data-grist';
2
+ import { LitElement } from 'lit';
3
+ export declare class QuotationImporter extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ quotations: any[];
6
+ columns: {
7
+ list: {
8
+ fields: string[];
9
+ };
10
+ pagination: {
11
+ infinite: boolean;
12
+ };
13
+ columns: {
14
+ type: string;
15
+ name: string;
16
+ header: string;
17
+ width: number;
18
+ }[];
19
+ };
20
+ render(): import("lit-html").TemplateResult<1>;
21
+ save(): Promise<void>;
22
+ }
@@ -0,0 +1,100 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/data-grist';
3
+ import gql from 'graphql-tag';
4
+ import { css, html, LitElement } from 'lit';
5
+ import { property } from 'lit/decorators.js';
6
+ import { client } from '@operato/graphql';
7
+ import { i18next } from '@operato/i18n';
8
+ import { isMobileDevice } from '@operato/utils';
9
+ export class QuotationImporter extends LitElement {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.quotations = [];
13
+ this.columns = {
14
+ list: { fields: ['name', 'description'] },
15
+ pagination: { infinite: true },
16
+ columns: [
17
+ {
18
+ type: 'string',
19
+ name: 'name',
20
+ header: i18next.t('field.name'),
21
+ width: 150
22
+ },
23
+ {
24
+ type: 'string',
25
+ name: 'description',
26
+ header: i18next.t('field.description'),
27
+ width: 200
28
+ },
29
+ {
30
+ type: 'checkbox',
31
+ name: 'active',
32
+ header: i18next.t('field.active'),
33
+ width: 60
34
+ }
35
+ ]
36
+ };
37
+ }
38
+ render() {
39
+ return html `
40
+ <ox-grist
41
+ .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
42
+ .config=${this.columns}
43
+ .data=${{
44
+ records: this.quotations
45
+ }}
46
+ ></ox-grist>
47
+
48
+ <div class="button-container">
49
+ <mwc-button raised @click="${this.save.bind(this)}">${i18next.t('button.save')}</mwc-button>
50
+ </div>
51
+ `;
52
+ }
53
+ async save() {
54
+ var _a;
55
+ const response = await client.mutate({
56
+ mutation: gql `
57
+ mutation importQuotations($quotations: [QuotationPatch!]!) {
58
+ importQuotations(quotations: $quotations)
59
+ }
60
+ `,
61
+ variables: { quotations: this.quotations }
62
+ });
63
+ if ((_a = response.errors) === null || _a === void 0 ? void 0 : _a.length)
64
+ return;
65
+ this.dispatchEvent(new CustomEvent('imported'));
66
+ }
67
+ }
68
+ QuotationImporter.styles = [
69
+ css `
70
+ :host {
71
+ display: flex;
72
+ flex-direction: column;
73
+
74
+ background-color: #fff;
75
+ }
76
+
77
+ ox-grist {
78
+ flex: 1;
79
+ }
80
+
81
+ .button-container {
82
+ display: flex;
83
+ margin-left: auto;
84
+ padding: var(--padding-default);
85
+ }
86
+
87
+ mwc-button {
88
+ margin-left: var(--margin-default);
89
+ }
90
+ `
91
+ ];
92
+ __decorate([
93
+ property({ type: Array }),
94
+ __metadata("design:type", Array)
95
+ ], QuotationImporter.prototype, "quotations", void 0);
96
+ __decorate([
97
+ property({ type: Object }),
98
+ __metadata("design:type", Object)
99
+ ], QuotationImporter.prototype, "columns", void 0);
100
+ //# sourceMappingURL=quotation-importer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quotation-importer.js","sourceRoot":"","sources":["../../../client/pages/quotation/quotation-importer.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAE/C,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAAjD;;QA0B6B,eAAU,GAAU,EAAE,CAAA;QACrB,YAAO,GAAG;YACpC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAmCH,CAAC;IAhCC,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBAEpB;YACE,OAAO,EAAE,IAAI,CAAC,UAAU;SAE5B;;;;qCAI6B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAEjF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;SAC3C,CAAC,CAAA;QAEF,IAAI,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAnFM,wBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAuB;AACjD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAuB1B","sourcesContent":["import '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\n\nexport class QuotationImporter extends LitElement {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-grist {\n flex: 1;\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n padding: var(--padding-default);\n }\n\n mwc-button {\n margin-left: var(--margin-default);\n }\n `\n ]\n\n @property({ type: Array }) quotations: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${\n { \n records: this.quotations \n }\n }\n ></ox-grist>\n\n <div class=\"button-container\">\n <mwc-button raised @click=\"${this.save.bind(this)}\">${i18next.t('button.save')}</mwc-button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importQuotations($quotations: [QuotationPatch!]!) {\n importQuotations(quotations: $quotations)\n }\n `,\n variables: { quotations: this.quotations }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n\n"]}
@@ -0,0 +1,62 @@
1
+ import '@operato/data-grist';
2
+ import { PageView } from '@operato/shell';
3
+ import { FetchOption } from '@operato/data-grist';
4
+ import { QuotationImporter } from './quotation-importer';
5
+ declare const QuotationListPage_base: (new (...args: any[]) => {
6
+ _storeUnsubscribe: import("redux").Unsubscribe;
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ stateChanged(_state: unknown): void;
10
+ readonly isConnected: boolean;
11
+ }) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
12
+ export declare class QuotationListPage extends QuotationListPage_base {
13
+ static styles: import("lit").CSSResult[];
14
+ static get scopedElements(): {
15
+ 'quotation-importer': typeof QuotationImporter;
16
+ };
17
+ gristConfig: any;
18
+ mode: 'CARD' | 'GRID' | 'LIST';
19
+ private grist;
20
+ private sortersControl;
21
+ get context(): {
22
+ search: {
23
+ handler: (search: string) => void;
24
+ placeholder: string;
25
+ value: string;
26
+ };
27
+ filter: {
28
+ handler: () => void;
29
+ };
30
+ help: string;
31
+ actions: {
32
+ icon: string;
33
+ emphasis: {
34
+ raised: boolean;
35
+ outlined: boolean;
36
+ dense: boolean;
37
+ danger: boolean;
38
+ };
39
+ title: string;
40
+ action: () => Promise<void>;
41
+ }[];
42
+ exportable: {
43
+ name: string;
44
+ data: () => Promise<{}[]>;
45
+ };
46
+ importable: {
47
+ handler: (records: any) => Promise<void>;
48
+ };
49
+ };
50
+ render(): import("lit-html").TemplateResult<1>;
51
+ pageInitialized(lifecycle: any): Promise<void>;
52
+ pageUpdated(changes: any, lifecycle: any): Promise<void>;
53
+ fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
54
+ total: any;
55
+ records: any;
56
+ }>;
57
+ _deleteQuotation(): Promise<void>;
58
+ _updateQuotation(): Promise<void>;
59
+ exportHandler(): Promise<{}[]>;
60
+ importHandler(records: any): Promise<void>;
61
+ }
62
+ export {};