@things-factory/quotation 10.1.123 → 10.1.128

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/dist-client/bootstrap.js +1 -7
  2. package/dist-client/bootstrap.js.map +1 -1
  3. package/dist-client/index.d.ts +2 -1
  4. package/dist-client/index.js +2 -1
  5. package/dist-client/index.js.map +1 -1
  6. package/dist-client/pages/quotation-editor.d.ts +43 -0
  7. package/dist-client/pages/quotation-editor.js +313 -0
  8. package/dist-client/pages/quotation-editor.js.map +1 -0
  9. package/dist-client/pages/quotation-list.d.ts +36 -0
  10. package/dist-client/pages/quotation-list.js +113 -0
  11. package/dist-client/pages/quotation-list.js.map +1 -0
  12. package/dist-client/quotation-attach.d.ts +16 -0
  13. package/dist-client/quotation-attach.js +8 -0
  14. package/dist-client/quotation-attach.js.map +1 -0
  15. package/dist-client/quotation-words.d.ts +1 -0
  16. package/dist-client/quotation-words.js +13 -0
  17. package/dist-client/quotation-words.js.map +1 -0
  18. package/dist-client/route.d.ts +1 -1
  19. package/dist-client/route.js +4 -4
  20. package/dist-client/route.js.map +1 -1
  21. package/dist-client/tsconfig.tsbuildinfo +1 -1
  22. package/dist-server/index.d.ts +1 -0
  23. package/dist-server/index.js +1 -0
  24. package/dist-server/index.js.map +1 -1
  25. package/dist-server/service/index.d.ts +8 -3
  26. package/dist-server/service/index.js +9 -17
  27. package/dist-server/service/index.js.map +1 -1
  28. package/dist-server/service/quotation/index.d.ts +8 -5
  29. package/dist-server/service/quotation/index.js +8 -6
  30. package/dist-server/service/quotation/index.js.map +1 -1
  31. package/dist-server/service/quotation/quotation-event-query.d.ts +9 -0
  32. package/dist-server/service/quotation/quotation-event-query.js +55 -0
  33. package/dist-server/service/quotation/quotation-event-query.js.map +1 -0
  34. package/dist-server/service/quotation/quotation-event.d.ts +22 -0
  35. package/dist-server/service/quotation/quotation-event.js +98 -0
  36. package/dist-server/service/quotation/quotation-event.js.map +1 -0
  37. package/dist-server/service/quotation/quotation-item-query.d.ts +8 -0
  38. package/dist-server/service/quotation/quotation-item-query.js +45 -0
  39. package/dist-server/service/quotation/quotation-item-query.js.map +1 -0
  40. package/dist-server/service/quotation/quotation-item.d.ts +18 -0
  41. package/dist-server/service/quotation/quotation-item.js +75 -0
  42. package/dist-server/service/quotation/quotation-item.js.map +1 -0
  43. package/dist-server/service/quotation/quotation-mutation.d.ts +7 -6
  44. package/dist-server/service/quotation/quotation-mutation.js +66 -140
  45. package/dist-server/service/quotation/quotation-mutation.js.map +1 -1
  46. package/dist-server/service/quotation/quotation-query.d.ts +10 -5
  47. package/dist-server/service/quotation/quotation-query.js +69 -41
  48. package/dist-server/service/quotation/quotation-query.js.map +1 -1
  49. package/dist-server/service/quotation/quotation-rules.d.ts +6 -0
  50. package/dist-server/service/quotation/quotation-rules.js +22 -0
  51. package/dist-server/service/quotation/quotation-rules.js.map +1 -0
  52. package/dist-server/service/quotation/quotation-service.d.ts +23 -0
  53. package/dist-server/service/quotation/quotation-service.js +114 -0
  54. package/dist-server/service/quotation/quotation-service.js.map +1 -0
  55. package/dist-server/service/quotation/quotation-type.d.ts +4 -18
  56. package/dist-server/service/quotation/quotation-type.js +9 -63
  57. package/dist-server/service/quotation/quotation-type.js.map +1 -1
  58. package/dist-server/service/quotation/quotation.d.ts +19 -11
  59. package/dist-server/service/quotation/quotation.js +41 -44
  60. package/dist-server/service/quotation/quotation.js.map +1 -1
  61. package/dist-server/tsconfig.tsbuildinfo +1 -1
  62. package/package.json +16 -6
  63. package/things-factory.config.js +2 -2
  64. package/translations/en.json +36 -1
  65. package/translations/ko.json +36 -1
  66. package/dist-client/actions/main.d.ts +0 -1
  67. package/dist-client/actions/main.js +0 -2
  68. package/dist-client/actions/main.js.map +0 -1
  69. package/dist-client/activities/activity-quotation-edit.d.ts +0 -14
  70. package/dist-client/activities/activity-quotation-edit.js +0 -87
  71. package/dist-client/activities/activity-quotation-edit.js.map +0 -1
  72. package/dist-client/activities/activity-quotation-view.d.ts +0 -14
  73. package/dist-client/activities/activity-quotation-view.js +0 -87
  74. package/dist-client/activities/activity-quotation-view.js.map +0 -1
  75. package/dist-client/pages/main.d.ts +0 -1
  76. package/dist-client/pages/main.js +0 -36
  77. package/dist-client/pages/main.js.map +0 -1
  78. package/dist-client/pages/quotation/quotation-importer.d.ts +0 -23
  79. package/dist-client/pages/quotation/quotation-importer.js +0 -93
  80. package/dist-client/pages/quotation/quotation-importer.js.map +0 -1
  81. package/dist-client/pages/quotation/quotation-list-page.d.ts +0 -55
  82. package/dist-client/pages/quotation/quotation-list-page.js +0 -262
  83. package/dist-client/pages/quotation/quotation-list-page.js.map +0 -1
  84. package/dist-client/reducers/main.d.ts +0 -6
  85. package/dist-client/reducers/main.js +0 -14
  86. package/dist-client/reducers/main.js.map +0 -1
  87. package/dist-server/activities/activity-quotation.d.ts +0 -42
  88. package/dist-server/activities/activity-quotation.js +0 -114
  89. package/dist-server/activities/activity-quotation.js.map +0 -1
  90. package/dist-server/activities/index.d.ts +0 -1
  91. package/dist-server/activities/index.js +0 -17
  92. package/dist-server/activities/index.js.map +0 -1
  93. package/dist-server/service/quotation/event-subscriber.d.ts +0 -7
  94. package/dist-server/service/quotation/event-subscriber.js +0 -21
  95. package/dist-server/service/quotation/event-subscriber.js.map +0 -1
  96. package/dist-server/service/quotation/quotation-history.d.ts +0 -25
  97. package/dist-server/service/quotation/quotation-history.js +0 -132
  98. package/dist-server/service/quotation/quotation-history.js.map +0 -1
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@things-factory/quotation",
3
- "version": "10.1.123",
3
+ "version": "10.1.128",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
7
7
  "license": "MIT",
8
8
  "author": "heartyoh <heartyoh@hatiolab.com>",
9
- "description": "A module that manages the entire lifecycle from quotation issuance to approval, revision, etc",
9
+ "description": "Quotations with revisions, on the commercial document of @things-factory/invoice",
10
10
  "publishConfig": {
11
11
  "access": "public",
12
12
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -24,14 +24,24 @@
24
24
  "clean:client": "npx rimraf dist-client",
25
25
  "clean:server": "npx rimraf dist-server",
26
26
  "clean": "npm run clean:server && npm run clean:client",
27
- "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
27
+ "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration",
28
+ "test": "node --test test/*.test.mjs",
29
+ "pretest": "npm run build:server"
28
30
  },
29
31
  "dependencies": {
32
+ "@material/web": "^2.0.0",
33
+ "@operato/data-grist": "^10.0.0",
30
34
  "@operato/graphql": "^10.0.0",
35
+ "@operato/i18n": "^10.0.0",
36
+ "@operato/layout": "^10.0.0",
37
+ "@operato/list-state": "^10.29.1",
38
+ "@operato/popup": "^10.0.0",
31
39
  "@operato/shell": "^10.0.0",
40
+ "@operato/styles": "^10.29.1",
41
+ "@operato/utils": "^10.0.0",
32
42
  "@things-factory/auth-base": "^10.1.123",
33
- "@things-factory/shell": "^10.1.123",
34
- "@things-factory/worklist": "^10.1.123"
43
+ "@things-factory/invoice": "^10.1.128",
44
+ "@things-factory/shell": "^10.1.123"
35
45
  },
36
- "gitHead": "9781f1eb37a7e6a37285878cff16f8683747eb7a"
46
+ "gitHead": "2df4c35fbc0eb3dc7bc24882b2d94cdd9c65aa63"
37
47
  }
@@ -4,8 +4,8 @@ import bootstrap from './dist-client/bootstrap'
4
4
  export default {
5
5
  route,
6
6
  routes: [
7
- { tagname: 'quotation-main', page: 'quotation-main' },
8
- { tagname: 'quotation-list-page', page: 'quotation-list' }
7
+ { tagname: 'quotation-list', page: 'quotation-list' },
8
+ { tagname: 'quotation-editor', page: 'quotation-editor' }
9
9
  ],
10
10
  bootstrap
11
11
  }
@@ -1 +1,36 @@
1
- {}
1
+ {
2
+ "button.quotation-accept": "Mark accepted",
3
+ "button.quotation-expire": "Mark expired",
4
+ "button.quotation-new": "New quotation",
5
+ "button.quotation-print": "Print",
6
+ "button.quotation-reject": "Mark declined",
7
+ "button.quotation-revise": "Revise",
8
+ "button.quotation-send": "Send",
9
+ "error.quotation-draft-required": "Revise a sent quotation to change it.",
10
+ "error.quotation-issue-date-required": "Enter the issue date before sending.",
11
+ "error.quotation-latest-required": "Revise the latest version.",
12
+ "error.quotation-not-found": "Quotation not found.",
13
+ "error.quotation-number-duplicate": "Quotation number already exists.",
14
+ "error.quotation-reason-required": "Say why the buyer declined.",
15
+ "error.quotation-revision-invalid": "Only a sent quotation nobody accepted can be revised.",
16
+ "error.quotation-revision-number": "A revision keeps its quotation number.",
17
+ "error.quotation-transition-invalid": "The quotation status or its last day does not allow this.",
18
+ "error.quotation-valid-until": "Enter the last day the offer holds.",
19
+ "field.quotation-outcome-reason": "Reason declined",
20
+ "field.quotation-valid-until": "Valid until",
21
+ "field.quotation-version": "Version",
22
+ "text.quotation-empty": "No quotations yet.",
23
+ "text.quotation-empty-description": "Create the first one with New quotation.",
24
+ "text.quotation-not-found": "Quotation not found.",
25
+ "text.quotation-section-decline": "Declined",
26
+ "text.quotation-status-accepted": "Accepted",
27
+ "text.quotation-status-draft": "Draft",
28
+ "text.quotation-status-expired": "Expired",
29
+ "text.quotation-status-rejected": "Declined",
30
+ "text.quotation-status-sent": "Sent",
31
+ "text.quotation-status-superseded": "Superseded",
32
+ "title.quotation": "Quotation",
33
+ "title.quotation-list": "Quotations",
34
+ "title.quotation-new": "New quotation",
35
+ "title.quotation-print": "QUOTATION"
36
+ }
@@ -1 +1,36 @@
1
- {}
1
+ {
2
+ "button.quotation-accept": "수락 처리",
3
+ "button.quotation-expire": "만료 처리",
4
+ "button.quotation-new": "견적 작성",
5
+ "button.quotation-print": "인쇄",
6
+ "button.quotation-reject": "거절 처리",
7
+ "button.quotation-revise": "개정",
8
+ "button.quotation-send": "발송",
9
+ "error.quotation-draft-required": "보낸 견적은 개정해서 고칩니다.",
10
+ "error.quotation-issue-date-required": "보내기 전에 작성일을 입력하세요.",
11
+ "error.quotation-latest-required": "가장 최근 판을 개정하세요.",
12
+ "error.quotation-not-found": "견적을 찾을 수 없습니다.",
13
+ "error.quotation-number-duplicate": "이미 사용한 견적 번호입니다.",
14
+ "error.quotation-reason-required": "거절 사유를 입력하세요.",
15
+ "error.quotation-revision-invalid": "수락되지 않은 보낸 견적만 개정할 수 있습니다.",
16
+ "error.quotation-revision-number": "개정본은 견적 번호를 바꿀 수 없습니다.",
17
+ "error.quotation-transition-invalid": "견적 상태나 유효기한 때문에 할 수 없습니다.",
18
+ "error.quotation-valid-until": "유효기한을 입력하세요.",
19
+ "field.quotation-outcome-reason": "거절 사유",
20
+ "field.quotation-valid-until": "유효기한",
21
+ "field.quotation-version": "판",
22
+ "text.quotation-empty": "견적이 없습니다.",
23
+ "text.quotation-empty-description": "견적 작성으로 첫 견적을 만듭니다.",
24
+ "text.quotation-not-found": "견적을 찾을 수 없습니다.",
25
+ "text.quotation-section-decline": "거절",
26
+ "text.quotation-status-accepted": "수락",
27
+ "text.quotation-status-draft": "작성 중",
28
+ "text.quotation-status-expired": "기한 만료",
29
+ "text.quotation-status-rejected": "거절",
30
+ "text.quotation-status-sent": "발송",
31
+ "text.quotation-status-superseded": "개정됨",
32
+ "title.quotation": "견적",
33
+ "title.quotation-list": "견적",
34
+ "title.quotation-new": "새 견적",
35
+ "title.quotation-print": "견적서"
36
+ }
@@ -1 +0,0 @@
1
- export declare const UPDATE_QUOTATION = "UPDATE_QUOTATION";
@@ -1,2 +0,0 @@
1
- export const UPDATE_QUOTATION = 'UPDATE_QUOTATION';
2
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
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"]}
@@ -1,14 +0,0 @@
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 {};
@@ -1,87 +0,0 @@
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
- static { this.styles = [
17
- ScrollbarStyles,
18
- css `
19
- :host {
20
- display: flex;
21
- flex-direction: column;
22
-
23
- background-color: var(--md-sys-color-surface);
24
- }
25
-
26
- quotation-edit {
27
- flex: 1;
28
- padding: 10px;
29
- overflow: auto;
30
- }
31
- `
32
- ]; }
33
- // @query('quotation-edit') quotationView!: QuotationView
34
- render() {
35
- return html `
36
- <quotation-edit .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-edit>
37
- `;
38
- }
39
- async onChange() {
40
- // this.output = this.quotationView.value
41
- this.dispatchEvent(new CustomEvent('change', {
42
- detail: this.output
43
- }));
44
- }
45
- updated(changes) {
46
- if (changes.has('input')) {
47
- this.fetchQuotation();
48
- }
49
- }
50
- async fetchQuotation() {
51
- const id = this.input.quotationId;
52
- if (id) {
53
- const response = await client.query({
54
- query: gql `
55
- query ($id: String!) {
56
- quotation(id: $id) {
57
- id
58
- name
59
- description
60
- }
61
- }
62
- `,
63
- variables: {
64
- id
65
- }
66
- });
67
- this.quotation = response.data.quotation;
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
@@ -1 +0,0 @@
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;aAC/D,WAAM,GAAG;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;KAaF;KACF,AAhBY,CAgBZ;IAOD,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,CAAC;YACzB,IAAI,CAAC,cAAc,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;QAEjC,IAAI,EAAE,EAAE,CAAC;YACP,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;QAC1C,CAAC;IACH,CAAC;;AAlD2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAE/B;IAAR,KAAK,EAAE;;wDAAgB;AAtBb,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CAsEjC","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: var(--md-sys-color-surface);\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"]}
@@ -1,14 +0,0 @@
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 {};
@@ -1,87 +0,0 @@
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
- static { this.styles = [
17
- ScrollbarStyles,
18
- css `
19
- :host {
20
- display: flex;
21
- flex-direction: column;
22
-
23
- background-color: var(--md-sys-color-surface);
24
- }
25
-
26
- quotation-view {
27
- flex: 1;
28
- padding: 10px;
29
- overflow: auto;
30
- }
31
- `
32
- ]; }
33
- // @query('quotation-view') quotationView!: QuotationView
34
- render() {
35
- return html `
36
- <quotation-view .quotation=${this.quotation} .value=${this.output} @change=${this.onChange}></quotation-view>
37
- `;
38
- }
39
- async onChange() {
40
- // this.output = this.quotationView.value
41
- this.dispatchEvent(new CustomEvent('change', {
42
- detail: this.output
43
- }));
44
- }
45
- updated(changes) {
46
- if (changes.has('input')) {
47
- this.fetchQuotation();
48
- }
49
- }
50
- async fetchQuotation() {
51
- const id = this.input.quotationId;
52
- if (id) {
53
- const response = await client.query({
54
- query: gql `
55
- query ($id: String!) {
56
- quotation(id: $id) {
57
- id
58
- name
59
- description
60
- }
61
- }
62
- `,
63
- variables: {
64
- id
65
- }
66
- });
67
- this.quotation = response.data.quotation;
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
@@ -1 +0,0 @@
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;aAC/D,WAAM,GAAG;QACd,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;KAaF;KACF,AAhBY,CAgBZ;IAOD,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,CAAC;YACzB,IAAI,CAAC,cAAc,EAAE,CAAA;QACvB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAA;QAEjC,IAAI,EAAE,EAAE,CAAC;YACP,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;QAC1C,CAAC;IACH,CAAC;;AAlD2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDAAa;AAE/B;IAAR,KAAK,EAAE;;wDAAgB;AAtBb,qBAAqB;IADjC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,qBAAqB,CAsEjC","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: var(--md-sys-color-surface);\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"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,36 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { html } from 'lit';
3
- import { customElement, property } from 'lit/decorators.js';
4
- import { store, PageView } from '@operato/shell';
5
- const logo = new URL('/assets/images/hatiolab-logo.png', import.meta.url).href;
6
- let QuotationMain = class QuotationMain extends PageView {
7
- render() {
8
- return html `
9
- <section>
10
- <h2>Quotation</h2>
11
- <img src=${logo}>
12
- </section>
13
- `;
14
- }
15
- connectedCallback() {
16
- super.connectedCallback();
17
- this._applyState();
18
- this._unsubscribe = store.subscribe(() => this._applyState());
19
- }
20
- disconnectedCallback() {
21
- super.disconnectedCallback();
22
- this._unsubscribe?.();
23
- }
24
- _applyState() {
25
- const __state__ = store.getState();
26
- this.quotation = __state__.quotation.state_main;
27
- }
28
- };
29
- __decorate([
30
- property({ type: String }),
31
- __metadata("design:type", String)
32
- ], QuotationMain.prototype, "quotation", void 0);
33
- QuotationMain = __decorate([
34
- customElement('quotation-main')
35
- ], QuotationMain);
36
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
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,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,QAAQ;IAGlC,MAAM;QACJ,OAAO,IAAI,CAAA;;;mBAGI,IAAI;;KAElB,CAAA;IACH,CAAC;IAKD,iBAAiB;QAEf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAEzB,IAAI,CAAC,WAAW,EAAE,CAAA;QAElB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IAE/D,CAAC;IAGD,oBAAoB;QAElB,KAAK,CAAC,oBAAoB,EAAE,CAAA;QAE5B,IAAI,CAAC,YAAY,EAAE,EAAE,CAAA;IAEvB,CAAC;IAGO,WAAW;QAEjB,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAS,CAAA;QAC7C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,UAAU,CAAA;IAE7C,CAAC;CACF,CAAA;AAxC6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;gDAAmB;AAD1C,aAAa;IADlB,aAAa,CAAC,gBAAgB,CAAC;GAC1B,aAAa,CAyClB","sourcesContent":["import { html } from 'lit'\nimport { customElement, property } from 'lit/decorators.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 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 private _unsubscribe?: () => void\n\n\n connectedCallback() {\n\n super.connectedCallback()\n\n this._applyState()\n\n this._unsubscribe = store.subscribe(() => this._applyState())\n\n }\n\n\n disconnectedCallback() {\n\n super.disconnectedCallback()\n\n this._unsubscribe?.()\n\n }\n\n\n private _applyState() {\n\n const __state__ = store.getState() as any\nthis.quotation = __state__.quotation.state_main\n\n }\n}\n\n"]}
@@ -1,23 +0,0 @@
1
- import '@material/web/icon/icon.js';
2
- import '@operato/data-grist';
3
- import { LitElement } from 'lit';
4
- export declare class QuotationImporter extends LitElement {
5
- static styles: import("lit").CSSResult[];
6
- quotations: any[];
7
- columns: {
8
- list: {
9
- fields: string[];
10
- };
11
- pagination: {
12
- infinite: boolean;
13
- };
14
- columns: {
15
- type: string;
16
- name: string;
17
- header: string;
18
- width: number;
19
- }[];
20
- };
21
- render(): import("lit-html").TemplateResult<1>;
22
- save(): Promise<void>;
23
- }
@@ -1,93 +0,0 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import '@material/web/icon/icon.js';
3
- import '@operato/data-grist';
4
- import gql from 'graphql-tag';
5
- import { css, html, LitElement } from 'lit';
6
- import { property } from 'lit/decorators.js';
7
- import { client } from '@operato/graphql';
8
- import { i18next } from '@operato/i18n';
9
- import { isMobileDevice } from '@operato/utils';
10
- import { CommonHeaderStyles } from '@operato/styles';
11
- export class QuotationImporter extends LitElement {
12
- constructor() {
13
- super(...arguments);
14
- this.quotations = [];
15
- this.columns = {
16
- list: { fields: ['name', 'description'] },
17
- pagination: { infinite: true },
18
- columns: [
19
- {
20
- type: 'string',
21
- name: 'name',
22
- header: i18next.t('field.name'),
23
- width: 150
24
- },
25
- {
26
- type: 'string',
27
- name: 'description',
28
- header: i18next.t('field.description'),
29
- width: 200
30
- },
31
- {
32
- type: 'checkbox',
33
- name: 'active',
34
- header: i18next.t('field.active'),
35
- width: 60
36
- }
37
- ]
38
- };
39
- }
40
- static { this.styles = [
41
- CommonHeaderStyles,
42
- css `
43
- :host {
44
- display: flex;
45
- flex-direction: column;
46
-
47
- background-color: var(--md-sys-color-surface);
48
- }
49
-
50
- ox-grist {
51
- flex: 1;
52
- }
53
- `
54
- ]; }
55
- render() {
56
- return html `
57
- <ox-grist
58
- .mode=${isMobileDevice() ? 'LIST' : 'GRID'}
59
- .config=${this.columns}
60
- .data=${{
61
- records: this.quotations
62
- }}
63
- ></ox-grist>
64
-
65
- <div class="footer">
66
- <div filler></div>
67
- <button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</button>
68
- </div>
69
- `;
70
- }
71
- async save() {
72
- const response = await client.mutate({
73
- mutation: gql `
74
- mutation importQuotations($quotations: [QuotationPatch!]!) {
75
- importQuotations(quotations: $quotations)
76
- }
77
- `,
78
- variables: { quotations: this.quotations }
79
- });
80
- if (response.errors?.length)
81
- return;
82
- this.dispatchEvent(new CustomEvent('imported'));
83
- }
84
- }
85
- __decorate([
86
- property({ type: Array }),
87
- __metadata("design:type", Array)
88
- ], QuotationImporter.prototype, "quotations", void 0);
89
- __decorate([
90
- property({ type: Object }),
91
- __metadata("design:type", Object)
92
- ], QuotationImporter.prototype, "columns", void 0);
93
- //# sourceMappingURL=quotation-importer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"quotation-importer.js","sourceRoot":"","sources":["../../../client/pages/quotation/quotation-importer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,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;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,MAAM,OAAO,iBAAkB,SAAQ,UAAU;IAAjD;;QAiB6B,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;IAiCH,CAAC;aAzEQ,WAAM,GAAG;QACd,kBAAkB;QAClB,GAAG,CAAA;;;;;;;;;;;KAWF;KACF,AAdY,CAcZ;IA4BD,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBACd;YACN,OAAO,EAAE,IAAI,CAAC,UAAU;SACzB;;;;;yBAKgB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAEhG,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,QAAQ,CAAC,MAAM,EAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AAxD0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAuB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;kDAuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@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'\nimport { CommonHeaderStyles } from '@operato/styles'\n\nexport class QuotationImporter extends LitElement {\n static styles = [\n CommonHeaderStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n }\n\n ox-grist {\n flex: 1;\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 render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.quotations\n }}\n ></ox-grist>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.save.bind(this)} done><md-icon>save</md-icon>${i18next.t('button.save')}</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"]}
@@ -1,55 +0,0 @@
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[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
6
- export declare class QuotationListPage extends QuotationListPage_base {
7
- static styles: import("lit").CSSResult[];
8
- static get scopedElements(): {
9
- 'quotation-importer': typeof QuotationImporter;
10
- };
11
- gristConfig: any;
12
- mode: 'CARD' | 'GRID' | 'LIST';
13
- private grist;
14
- get context(): {
15
- title: string;
16
- search: {
17
- handler: (search: string) => void;
18
- value: string;
19
- };
20
- filter: {
21
- handler: () => void;
22
- };
23
- help: string;
24
- actions: {
25
- icon: string;
26
- emphasis: {
27
- raised: boolean;
28
- outlined: boolean;
29
- dense: boolean;
30
- danger: boolean;
31
- };
32
- title: string;
33
- action: () => Promise<void>;
34
- }[];
35
- exportable: {
36
- name: string;
37
- data: () => Promise<{}[]>;
38
- };
39
- importable: {
40
- handler: (records: any) => Promise<void>;
41
- };
42
- };
43
- render(): import("lit-html").TemplateResult<1>;
44
- pageInitialized(lifecycle: any): Promise<void>;
45
- pageUpdated(changes: any, lifecycle: any): Promise<void>;
46
- fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
47
- total: any;
48
- records: any;
49
- }>;
50
- _deleteQuotation(): Promise<void>;
51
- _updateQuotation(): Promise<void>;
52
- exportHandler(): Promise<{}[]>;
53
- importHandler(records: any): Promise<void>;
54
- }
55
- export {};