@things-factory/tax-invoice 6.2.126 → 6.2.131

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 (57) hide show
  1. package/client/pages/tax-invoice-api/tax-invoice-api-page.ts +99 -61
  2. package/client/pages/tax-invoice-company/tax-invoice-company-list-page.ts +2 -67
  3. package/client/pages/{tax-invoice-company/tax-invoice-company-importer.ts → tax-invoice-send/company-list-popup.ts} +60 -46
  4. package/client/pages/tax-invoice-send/tax-invoice-send-page.ts +144 -3
  5. package/config/config.development.js +13 -0
  6. package/config/config.production.js +13 -0
  7. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.d.ts +3 -2
  8. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js +91 -61
  9. package/dist-client/pages/tax-invoice-api/tax-invoice-api-page.js.map +1 -1
  10. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.d.ts +2 -11
  11. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js +0 -10
  12. package/dist-client/pages/tax-invoice-company/tax-invoice-company-importer.js.map +1 -1
  13. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.d.ts +0 -16
  14. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js +3 -62
  15. package/dist-client/pages/tax-invoice-company/tax-invoice-company-list-page.js.map +1 -1
  16. package/dist-client/pages/tax-invoice-send/company-list-popup.d.ts +65 -0
  17. package/dist-client/pages/tax-invoice-send/company-list-popup.js +199 -0
  18. package/dist-client/pages/tax-invoice-send/company-list-popup.js.map +1 -0
  19. package/dist-client/pages/tax-invoice-send/supplier-list-popup.d.ts +77 -0
  20. package/dist-client/pages/tax-invoice-send/supplier-list-popup.js +209 -0
  21. package/dist-client/pages/tax-invoice-send/supplier-list-popup.js.map +1 -0
  22. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.d.ts +7 -1
  23. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js +130 -2
  24. package/dist-client/pages/tax-invoice-send/tax-invoice-send-page.js.map +1 -1
  25. package/dist-client/tsconfig.tsbuildinfo +1 -1
  26. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js +20 -12
  27. package/dist-server/service/tax-invoice-api/tax-invoice-api-mutation.js.map +1 -1
  28. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js +13 -7
  29. package/dist-server/service/tax-invoice-api/tax-invoice-api-query.js.map +1 -1
  30. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js +3 -7
  31. package/dist-server/service/tax-invoice-api/tax-invoice-api-type.js.map +1 -1
  32. package/dist-server/service/tax-invoice-api/tax-invoice-api.js +9 -21
  33. package/dist-server/service/tax-invoice-api/tax-invoice-api.js.map +1 -1
  34. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js +41 -6
  35. package/dist-server/service/tax-invoice-company/tax-invoice-company-query.js.map +1 -1
  36. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js +55 -5
  37. package/dist-server/service/tax-invoice-company/tax-invoice-company-type.js.map +1 -1
  38. package/dist-server/service/tax-invoice-company/tax-invoice-company.js +1 -19
  39. package/dist-server/service/tax-invoice-company/tax-invoice-company.js.map +1 -1
  40. package/dist-server/service/unipost-api/tax-invoice-inquiry.js +6 -10
  41. package/dist-server/service/unipost-api/tax-invoice-inquiry.js.map +1 -1
  42. package/dist-server/service/unipost-api/tax-invoice-send.js +4 -5
  43. package/dist-server/service/unipost-api/tax-invoice-send.js.map +1 -1
  44. package/dist-server/service/unipost-api/test-data.js +3812 -0
  45. package/dist-server/service/unipost-api/test-data.js.map +1 -0
  46. package/dist-server/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +3 -2
  48. package/server/service/tax-invoice-api/tax-invoice-api-mutation.ts +34 -20
  49. package/server/service/tax-invoice-api/tax-invoice-api-query.ts +12 -6
  50. package/server/service/tax-invoice-api/tax-invoice-api-type.ts +2 -5
  51. package/server/service/tax-invoice-api/tax-invoice-api.ts +9 -19
  52. package/server/service/tax-invoice-company/tax-invoice-company-query.ts +35 -5
  53. package/server/service/tax-invoice-company/tax-invoice-company-type.ts +40 -4
  54. package/server/service/tax-invoice-company/tax-invoice-company.ts +0 -18
  55. package/server/service/unipost-api/tax-invoice-inquiry.ts +6 -10
  56. package/server/service/unipost-api/tax-invoice-send.ts +5 -5
  57. package/translations/ko.json +3 -0
@@ -1,21 +1,9 @@
1
1
  import '@operato/data-grist';
2
2
  import { PageView } from '@operato/shell';
3
3
  import { FetchOption } from '@operato/data-grist';
4
- import { TaxInvoiceCompanyImporter } from './tax-invoice-company-importer';
5
- export declare enum CompanyType {
6
- SUPPLIER = 10,
7
- BUYER = 20
8
- }
9
- export declare const COMPANY_TYPE_LABEL: {
10
- 10: string;
11
- 20: string;
12
- };
13
4
  declare const TaxInvoiceCompanyListPage_base: (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
14
5
  export declare class TaxInvoiceCompanyListPage extends TaxInvoiceCompanyListPage_base {
15
6
  static styles: import("lit").CSSResult[];
16
- static get scopedElements(): {
17
- 'tax-invoice-company-importer': typeof TaxInvoiceCompanyImporter;
18
- };
19
7
  gristConfig: any;
20
8
  mode: 'CARD' | 'GRID' | 'LIST';
21
9
  private grist;
@@ -37,9 +25,6 @@ export declare class TaxInvoiceCompanyListPage extends TaxInvoiceCompanyListPage
37
25
  name: string;
38
26
  data: () => Promise<{}[]>;
39
27
  };
40
- importable: {
41
- handler: (records: any) => Promise<void>;
42
- };
43
28
  };
44
29
  render(): import("lit-html").TemplateResult<1>;
45
30
  pageInitialized(lifecycle: any): Promise<void>;
@@ -52,6 +37,5 @@ export declare class TaxInvoiceCompanyListPage extends TaxInvoiceCompanyListPage
52
37
  _updateTaxInvoiceCompany(): Promise<void>;
53
38
  getAttributeSetForDomain(): Promise<any>;
54
39
  exportHandler(): Promise<{}[]>;
55
- importHandler(records: any): Promise<void>;
56
40
  }
57
41
  export {};
@@ -8,30 +8,15 @@ import { ScopedElementsMixin } from '@open-wc/scoped-elements';
8
8
  import { DataGrist } from '@operato/data-grist';
9
9
  import { client } from '@operato/graphql';
10
10
  import { i18next, localize } from '@operato/i18n';
11
- import { notify, openPopup } from '@operato/layout';
11
+ import { notify } from '@operato/layout';
12
12
  import { OxPrompt } from '@operato/popup';
13
13
  import { isMobileDevice } from '@operato/utils';
14
14
  import gql from 'graphql-tag';
15
- import { TaxInvoiceCompanyImporter } from './tax-invoice-company-importer';
16
- export var CompanyType;
17
- (function (CompanyType) {
18
- CompanyType[CompanyType["SUPPLIER"] = 10] = "SUPPLIER";
19
- CompanyType[CompanyType["BUYER"] = 20] = "BUYER"; // 거래처
20
- })(CompanyType || (CompanyType = {}));
21
- export const COMPANY_TYPE_LABEL = {
22
- [CompanyType.SUPPLIER]: '공급자',
23
- [CompanyType.BUYER]: '거래처'
24
- };
25
15
  let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {
26
16
  constructor() {
27
17
  super(...arguments);
28
18
  this.mode = isMobileDevice() ? 'CARD' : 'GRID';
29
19
  }
30
- static get scopedElements() {
31
- return {
32
- 'tax-invoice-company-importer': TaxInvoiceCompanyImporter
33
- };
34
- }
35
20
  get context() {
36
21
  return {
37
22
  title: i18next.t('title.tax invoice company list'),
@@ -43,9 +28,6 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
43
28
  exportable: {
44
29
  name: i18next.t('title.tax invoice company list'),
45
30
  data: this.exportHandler.bind(this)
46
- },
47
- importable: {
48
- handler: this.importHandler.bind(this)
49
31
  }
50
32
  };
51
33
  }
@@ -92,27 +74,6 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
92
74
  filter: 'search',
93
75
  width: 200
94
76
  },
95
- {
96
- type: 'select',
97
- name: 'type',
98
- header: i18next.t('field.type'),
99
- record: {
100
- editable: true,
101
- classifier: () => ({ emphasized: ['#D1E8FF', '#000'] }),
102
- options: [
103
- {},
104
- {
105
- display: i18next.t('text.company supplier'),
106
- value: CompanyType.SUPPLIER
107
- },
108
- {
109
- display: i18next.t('text.company buyer'),
110
- value: CompanyType.BUYER
111
- }
112
- ]
113
- },
114
- width: 100
115
- },
116
77
  {
117
78
  type: 'string',
118
79
  name: 'businessRegistrationNumber',
@@ -134,7 +95,7 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
134
95
  {
135
96
  type: 'string',
136
97
  name: 'businessName',
137
- header: i18next.t('field.business name'),
98
+ header: i18next.t('field.tax invoice business name'),
138
99
  record: {
139
100
  editable: true
140
101
  },
@@ -143,7 +104,7 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
143
104
  {
144
105
  type: 'string',
145
106
  name: 'representativeName',
146
- header: i18next.t('field.representative name'),
107
+ header: i18next.t('field.tax invoice representative name'),
147
108
  record: {
148
109
  editable: true
149
110
  },
@@ -281,7 +242,6 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
281
242
  id
282
243
  name
283
244
  description
284
- type
285
245
  businessRegistrationNumber
286
246
  branchIdentification
287
247
  businessName
@@ -402,7 +362,6 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
402
362
  'id',
403
363
  'name',
404
364
  'description',
405
- 'type',
406
365
  'businessRegistrationNumber',
407
366
  'branchIdentification',
408
367
  'businessName',
@@ -425,24 +384,6 @@ let TaxInvoiceCompanyListPage = class TaxInvoiceCompanyListPage extends localize
425
384
  return tempObj;
426
385
  });
427
386
  }
428
- async importHandler(records) {
429
- const popup = openPopup(html `
430
- <tax-invoice-company-importer
431
- .taxInvoiceCompanies=${records}
432
- @imported=${() => {
433
- history.back();
434
- this.grist.fetch();
435
- }}
436
- ></tax-invoice-company-importer>
437
- `, {
438
- backdrop: true,
439
- size: 'large',
440
- title: i18next.t('title.import tax invoice company')
441
- });
442
- popup.onclosed = () => {
443
- this.grist.fetch();
444
- };
445
- }
446
387
  };
447
388
  TaxInvoiceCompanyListPage.styles = [
448
389
  ScrollbarStyles,
@@ -1 +1 @@
1
- {"version":3,"file":"tax-invoice-company-list-page.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-company/tax-invoice-company-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAE1E,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,sDAAa,CAAA;IACb,gDAAU,CAAA,CAAC,MAAM;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AACD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,KAAK;IAC7B,CAAC,WAAW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EuB,OAAO;sBAClB,GAAG,EAAE;YACf,OAAO,CAAC,IAAI,EAAE,CAAA;YACd,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC;SACrD,CACF,CAAA;QAED,KAAK,CAAC,QAAQ,GAAG,GAAG,EAAE;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QACpB,CAAC,CAAA;IACH,CAAC;;AAndM,gCAAM,GAAG;IACd,eAAe;IACf,iBAAiB;IACjB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAQD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAoE;AAE/F;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;wDAAA;AAzBjC,yBAAyB;IADrC,aAAa,CAAC,+BAA+B,CAAC;GAClC,yBAAyB,CAqdrC;SArdY,yBAAyB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\nimport gql from 'graphql-tag'\nimport { TaxInvoiceCompanyImporter } from './tax-invoice-company-importer'\n\nexport enum CompanyType {\n SUPPLIER = 10, // 공급자\n BUYER = 20 // 거래처\n}\nexport const COMPANY_TYPE_LABEL = {\n [CompanyType.SUPPLIER]: '공급자',\n [CompanyType.BUYER]: '거래처'\n}\n\n@customElement('tax-invoice-company-list-page')\nexport class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n static get scopedElements() {\n return {\n 'tax-invoice-company-importer': TaxInvoiceCompanyImporter\n }\n }\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.tax invoice company list'),\n help: 'tax-invoice-company/tax-invoice-company',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateTaxInvoiceCompany.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteTaxInvoiceCompany.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.tax invoice company list'),\n data: this.exportHandler.bind(this)\n },\n importable: {\n handler: this.importHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['name', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true,\n classifier: () => ({ emphasized: ['#D1E8FF', '#000'] })\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n editable: true,\n classifier: () => ({ emphasized: ['#D1E8FF', '#000'] }),\n options: [\n {},\n {\n display: i18next.t('text.company supplier'),\n value: CompanyType.SUPPLIER\n },\n {\n display: i18next.t('text.company buyer'),\n value: CompanyType.BUYER\n }\n ]\n },\n width: 100\n },\n {\n type: 'string',\n name: 'businessRegistrationNumber',\n header: i18next.t('field.business registration number'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'branchIdentification',\n header: i18next.t('field.branch identification'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'businessName',\n header: i18next.t('field.business name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'representativeName',\n header: i18next.t('field.representative name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'address',\n header: i18next.t('field.address'),\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'string',\n name: 'businessType',\n header: i18next.t('field.business type'),\n record: {\n editable: true\n },\n width: 100\n },\n {\n type: 'string',\n name: 'industryType',\n header: i18next.t('field.industry type'),\n record: {\n editable: true\n },\n width: 100\n },\n {\n type: 'string',\n name: 'department',\n header: i18next.t('field.department'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactName',\n header: i18next.t('field.contact name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactPhone',\n header: i18next.t('field.contact phone'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactEmail',\n header: i18next.t('field.contact email'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactCellPhone',\n header: i18next.t('field.contact cell phone'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'attributes',\n name: 'attributes',\n header: i18next.t('field.attributes'),\n record: {\n editable: true,\n options: async () => {\n return {\n objectified: true,\n attributeSet: await this.getAttributeSetForDomain()\n }\n }\n },\n width: 150\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoiceCompanies(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n type\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n attributes\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteTaxInvoiceCompany() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteTaxInvoiceCompanies(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateTaxInvoiceCompany() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [TaxInvoiceCompanyPatch!]!) {\n updateMultipleTaxInvoiceCompany(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async getAttributeSetForDomain() {\n const response = await client.query({\n query: gql`\n query {\n attributeSet: attributeSetByEntity(entity: \"Domain\") {\n entity\n description\n items {\n name\n description\n tag\n type\n active\n hidden\n options\n }\n }\n }\n `\n })\n\n return response.data?.attributeSet || {}\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set([\n 'id',\n 'name',\n 'description',\n 'type',\n 'businessRegistrationNumber',\n 'branchIdentification',\n 'businessName',\n 'representativeName',\n 'address',\n 'businessType',\n 'industryType',\n 'department',\n 'contactName',\n 'contactPhone',\n 'contactEmail',\n 'contactCellPhone',\n 'attributes'\n ])\n\n return exportTargets.map(taxInvoice => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = taxInvoice[field]\n }\n\n return tempObj\n })\n }\n\n async importHandler(records) {\n const popup = openPopup(\n html`\n <tax-invoice-company-importer\n .taxInvoiceCompanies=${records}\n @imported=${() => {\n history.back()\n this.grist.fetch()\n }}\n ></tax-invoice-company-importer>\n `,\n {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.import tax invoice company')\n }\n )\n\n popup.onclosed = () => {\n this.grist.fetch()\n }\n }\n}\n"]}
1
+ {"version":3,"file":"tax-invoice-company-list-page.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-company/tax-invoice-company-list-page.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAe,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,MAAM,EAAa,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,GAAG,MAAM,aAAa,CAAA;AAGtB,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAAxF;;QAiBuB,SAAI,GAA6B,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;IA6YjG,CAAC;IAzYC,IAAI,OAAO;QACT,OAAO;YACL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,gCAAgC,CAAC;YAClD,IAAI,EAAE,yCAAyC;YAC/C,OAAO,EAAE;gCAEL,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,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jB,GAAG,CAAA;;;;;;;;;KASF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8DAAiB;AAC5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;uDAAoE;AAE/F;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;wDAAA;AAnBjC,yBAAyB;IADrC,aAAa,CAAC,+BAA+B,CAAC;GAClC,yBAAyB,CA8ZrC;SA9ZY,yBAAyB","sourcesContent":["import '@operato/data-grist'\n\nimport { CommonButtonStyles, CommonGristStyles, ScrollbarStyles } from '@operato/styles'\nimport { PageView } from '@operato/shell'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ScopedElementsMixin } from '@open-wc/scoped-elements'\nimport { DataGrist, FetchOption } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next, localize } from '@operato/i18n'\nimport { notify, openPopup } from '@operato/layout'\nimport { OxPrompt } from '@operato/popup'\nimport { isMobileDevice } from '@operato/utils'\nimport gql from 'graphql-tag'\n\n@customElement('tax-invoice-company-list-page')\nexport class TaxInvoiceCompanyListPage extends localize(i18next)(ScopedElementsMixin(PageView)) {\n static styles = [\n ScrollbarStyles,\n CommonGristStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n `\n ]\n\n @property({ type: Object }) gristConfig: any\n @property({ type: String }) mode: 'CARD' | 'GRID' | 'LIST' = isMobileDevice() ? 'CARD' : 'GRID'\n\n @query('ox-grist') private grist!: DataGrist\n\n get context() {\n return {\n title: i18next.t('title.tax invoice company list'),\n help: 'tax-invoice-company/tax-invoice-company',\n actions: [\n {\n title: i18next.t('button.save'),\n action: this._updateTaxInvoiceCompany.bind(this),\n ...CommonButtonStyles.save\n },\n {\n title: i18next.t('button.delete'),\n action: this._deleteTaxInvoiceCompany.bind(this),\n ...CommonButtonStyles.delete\n }\n ],\n exportable: {\n name: i18next.t('title.tax invoice company list'),\n data: this.exportHandler.bind(this)\n }\n }\n }\n\n render() {\n const mode = this.mode || (isMobileDevice() ? 'CARD' : 'GRID')\n\n return html`\n <ox-grist .mode=${mode} .config=${this.gristConfig} .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\">\n <div id=\"filters\">\n <ox-filters-form autofocus></ox-filters-form>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async pageInitialized(lifecycle: any) {\n this.gristConfig = {\n list: {\n fields: ['name', 'description'],\n details: ['name', 'updatedAt']\n },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: true,\n classifier: () => ({ emphasized: ['#D1E8FF', '#000'] })\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n editable: true\n },\n filter: 'search',\n width: 200\n },\n {\n type: 'string',\n name: 'businessRegistrationNumber',\n header: i18next.t('field.business registration number'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'branchIdentification',\n header: i18next.t('field.branch identification'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'businessName',\n header: i18next.t('field.tax invoice business name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'representativeName',\n header: i18next.t('field.tax invoice representative name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'address',\n header: i18next.t('field.address'),\n record: {\n editable: true\n },\n width: 200\n },\n {\n type: 'string',\n name: 'businessType',\n header: i18next.t('field.business type'),\n record: {\n editable: true\n },\n width: 100\n },\n {\n type: 'string',\n name: 'industryType',\n header: i18next.t('field.industry type'),\n record: {\n editable: true\n },\n width: 100\n },\n {\n type: 'string',\n name: 'department',\n header: i18next.t('field.department'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactName',\n header: i18next.t('field.contact name'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactPhone',\n header: i18next.t('field.contact phone'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactEmail',\n header: i18next.t('field.contact email'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactCellPhone',\n header: i18next.t('field.contact cell phone'),\n record: {\n editable: true\n },\n width: 150\n },\n {\n type: 'attributes',\n name: 'attributes',\n header: i18next.t('field.attributes'),\n record: {\n editable: true,\n options: async () => {\n return {\n objectified: true,\n attributeSet: await this.getAttributeSetForDomain()\n }\n }\n },\n width: 150\n },\n {\n type: 'resource-object',\n name: 'updater',\n header: i18next.t('field.updater'),\n record: {\n editable: false\n },\n width: 120\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: i18next.t('field.updated_at'),\n record: {\n editable: false\n },\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n sorters: [\n {\n name: 'name'\n }\n ]\n }\n }\n\n async pageUpdated(changes: any, lifecycle: any) {\n if (this.active) {\n this.grist.fetch()\n }\n }\n\n async fetchHandler({ page = 1, limit = 100, sortings = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n responses: taxInvoiceCompanies(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n businessRegistrationNumber\n branchIdentification\n businessName\n representativeName\n address\n businessType\n industryType\n department\n contactName\n contactPhone\n contactEmail\n contactCellPhone\n attributes\n updater {\n id\n name\n }\n updatedAt\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings\n }\n })\n\n return {\n total: response.data.responses.total || 0,\n records: response.data.responses.items || []\n }\n }\n\n async _deleteTaxInvoiceCompany() {\n if (\n await OxPrompt.open({\n title: i18next.t('text.are_you_sure'),\n text: i18next.t('text.sure_to_x', { x: i18next.t('text.delete') }),\n confirmButton: { text: i18next.t('button.confirm') },\n cancelButton: { text: i18next.t('button.cancel') }\n })\n ) {\n const ids = this.grist.selected.map(record => record.id)\n if (ids && ids.length > 0) {\n const response = await client.mutate({\n mutation: gql`\n mutation ($ids: [String!]!) {\n deleteTaxInvoiceCompanies(ids: $ids)\n }\n `,\n variables: {\n ids\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n notify({\n message: i18next.t('text.info_x_successfully', { x: i18next.t('text.delete') })\n })\n }\n }\n }\n }\n\n async _updateTaxInvoiceCompany() {\n let patches = this.grist.dirtyRecords\n if (patches && patches.length) {\n patches = patches.map(patch => {\n let patchField: any = patch.id ? { id: patch.id } : {}\n const dirtyFields = patch.__dirtyfields__\n for (let key in dirtyFields) {\n patchField[key] = key === 'type' ? Number(dirtyFields[key].after) : dirtyFields[key].after\n }\n patchField.cuFlag = patch.__dirty__\n\n return patchField\n })\n\n const response = await client.mutate({\n mutation: gql`\n mutation ($patches: [TaxInvoiceCompanyPatch!]!) {\n updateMultipleTaxInvoiceCompany(patches: $patches) {\n name\n }\n }\n `,\n variables: {\n patches\n }\n })\n\n if (!response.errors) {\n this.grist.fetch()\n }\n }\n }\n\n async getAttributeSetForDomain() {\n const response = await client.query({\n query: gql`\n query {\n attributeSet: attributeSetByEntity(entity: \"Domain\") {\n entity\n description\n items {\n name\n description\n tag\n type\n active\n hidden\n options\n }\n }\n }\n `\n })\n\n return response.data?.attributeSet || {}\n }\n\n async exportHandler() {\n const exportTargets = this.grist.selected.length ? this.grist.selected : this.grist.dirtyData.records\n const targetFieldSet = new Set([\n 'id',\n 'name',\n 'description',\n 'businessRegistrationNumber',\n 'branchIdentification',\n 'businessName',\n 'representativeName',\n 'address',\n 'businessType',\n 'industryType',\n 'department',\n 'contactName',\n 'contactPhone',\n 'contactEmail',\n 'contactCellPhone',\n 'attributes'\n ])\n\n return exportTargets.map(taxInvoice => {\n let tempObj = {}\n for (const field of targetFieldSet) {\n tempObj[field] = taxInvoice[field]\n }\n\n return tempObj\n })\n }\n}\n"]}
@@ -0,0 +1,65 @@
1
+ import '@operato/data-grist';
2
+ import { LitElement } from 'lit';
3
+ export declare class CompanyListPopup extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ private grist;
6
+ companyList: any[];
7
+ columns: {
8
+ pagination: {
9
+ infinite: boolean;
10
+ };
11
+ columns: ({
12
+ type: string;
13
+ gutterName: string;
14
+ multiple?: undefined;
15
+ name?: undefined;
16
+ header?: undefined;
17
+ record?: undefined;
18
+ filter?: undefined;
19
+ sortable?: undefined;
20
+ width?: undefined;
21
+ } | {
22
+ type: string;
23
+ gutterName: string;
24
+ multiple: boolean;
25
+ name?: undefined;
26
+ header?: undefined;
27
+ record?: undefined;
28
+ filter?: undefined;
29
+ sortable?: undefined;
30
+ width?: undefined;
31
+ } | {
32
+ type: string;
33
+ name: string;
34
+ header: string;
35
+ record: {
36
+ editable: boolean;
37
+ };
38
+ filter: string;
39
+ sortable: boolean;
40
+ width: number;
41
+ gutterName?: undefined;
42
+ multiple?: undefined;
43
+ } | {
44
+ type: string;
45
+ name: string;
46
+ header: string;
47
+ record: {
48
+ editable: boolean;
49
+ };
50
+ width: number;
51
+ gutterName?: undefined;
52
+ multiple?: undefined;
53
+ filter?: undefined;
54
+ sortable?: undefined;
55
+ })[];
56
+ rows: {
57
+ selectable: {
58
+ multiple: boolean;
59
+ };
60
+ appendable: boolean;
61
+ };
62
+ };
63
+ render(): import("lit-html").TemplateResult<1>;
64
+ select(): Promise<void>;
65
+ }
@@ -0,0 +1,199 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import '@operato/data-grist';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { property, query } from 'lit/decorators.js';
5
+ import { DataGrist } from '@operato/data-grist';
6
+ import { i18next } from '@operato/i18n';
7
+ export class CompanyListPopup extends LitElement {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.companyList = [];
11
+ this.columns = {
12
+ pagination: { infinite: true },
13
+ columns: [
14
+ { type: 'gutter', gutterName: 'sequence' },
15
+ { type: 'gutter', gutterName: 'row-selector', multiple: false },
16
+ {
17
+ type: 'string',
18
+ name: 'name',
19
+ header: i18next.t('field.name'),
20
+ record: {
21
+ editable: false
22
+ },
23
+ filter: 'search',
24
+ sortable: true,
25
+ width: 150
26
+ },
27
+ {
28
+ type: 'string',
29
+ name: 'businessRegistrationNumber',
30
+ header: i18next.t('field.business registration number'),
31
+ record: {
32
+ editable: false
33
+ },
34
+ width: 150
35
+ },
36
+ {
37
+ type: 'string',
38
+ name: 'branchIdentification',
39
+ header: i18next.t('field.branch identification'),
40
+ record: {
41
+ editable: false
42
+ },
43
+ width: 150
44
+ },
45
+ {
46
+ type: 'string',
47
+ name: 'businessName',
48
+ header: i18next.t('field.tax invoice business name'),
49
+ record: {
50
+ editable: false
51
+ },
52
+ width: 150
53
+ },
54
+ {
55
+ type: 'string',
56
+ name: 'representativeName',
57
+ header: i18next.t('field.tax invoice representative name'),
58
+ record: {
59
+ editable: false
60
+ },
61
+ width: 150
62
+ },
63
+ {
64
+ type: 'string',
65
+ name: 'address',
66
+ header: i18next.t('field.address'),
67
+ record: {
68
+ editable: false
69
+ },
70
+ width: 200
71
+ },
72
+ {
73
+ type: 'string',
74
+ name: 'businessType',
75
+ header: i18next.t('field.business type'),
76
+ record: {
77
+ editable: false
78
+ },
79
+ width: 100
80
+ },
81
+ {
82
+ type: 'string',
83
+ name: 'industryType',
84
+ header: i18next.t('field.industry type'),
85
+ record: {
86
+ editable: false
87
+ },
88
+ width: 100
89
+ },
90
+ {
91
+ type: 'string',
92
+ name: 'department',
93
+ header: i18next.t('field.department'),
94
+ record: {
95
+ editable: false
96
+ },
97
+ width: 150
98
+ },
99
+ {
100
+ type: 'string',
101
+ name: 'contactName',
102
+ header: i18next.t('field.contact name'),
103
+ record: {
104
+ editable: false
105
+ },
106
+ width: 150
107
+ },
108
+ {
109
+ type: 'string',
110
+ name: 'contactPhone',
111
+ header: i18next.t('field.contact phone'),
112
+ record: {
113
+ editable: false
114
+ },
115
+ width: 150
116
+ },
117
+ {
118
+ type: 'string',
119
+ name: 'contactEmail',
120
+ header: i18next.t('field.contact email'),
121
+ record: {
122
+ editable: false
123
+ },
124
+ width: 150
125
+ },
126
+ {
127
+ type: 'string',
128
+ name: 'contactCellPhone',
129
+ header: i18next.t('field.contact cell phone'),
130
+ record: {
131
+ editable: false
132
+ },
133
+ width: 150
134
+ }
135
+ ],
136
+ rows: {
137
+ selectable: {
138
+ multiple: false
139
+ },
140
+ appendable: false
141
+ }
142
+ };
143
+ }
144
+ render() {
145
+ return html `
146
+ <ox-grist
147
+ .mode=${'GRID'}
148
+ .config=${this.columns}
149
+ .data=${{
150
+ records: this.companyList
151
+ }}
152
+ ></ox-grist>
153
+
154
+ <div class="button-container">
155
+ <mwc-button raised @click="${this.select.bind(this)}">${i18next.t('button.select')}</mwc-button>
156
+ </div>
157
+ `;
158
+ }
159
+ async select() {
160
+ this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }));
161
+ }
162
+ }
163
+ CompanyListPopup.styles = [
164
+ css `
165
+ :host {
166
+ display: flex;
167
+ flex-direction: column;
168
+
169
+ background-color: #fff;
170
+ }
171
+
172
+ ox-grist {
173
+ flex: 1;
174
+ }
175
+
176
+ .button-container {
177
+ display: flex;
178
+ margin-left: auto;
179
+ padding: var(--padding-default);
180
+ }
181
+
182
+ mwc-button {
183
+ margin-left: var(--margin-default);
184
+ }
185
+ `
186
+ ];
187
+ __decorate([
188
+ query('ox-grist'),
189
+ __metadata("design:type", DataGrist)
190
+ ], CompanyListPopup.prototype, "grist", void 0);
191
+ __decorate([
192
+ property({ type: Array }),
193
+ __metadata("design:type", Array)
194
+ ], CompanyListPopup.prototype, "companyList", void 0);
195
+ __decorate([
196
+ property({ type: Object }),
197
+ __metadata("design:type", Object)
198
+ ], CompanyListPopup.prototype, "columns", void 0);
199
+ //# sourceMappingURL=company-list-popup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-list-popup.js","sourceRoot":"","sources":["../../../client/pages/tax-invoice-send/company-list-popup.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAAhD;;QA4B6B,gBAAW,GAAU,EAAE,CAAA;QACtB,YAAO,GAAG;YACpC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE;gBAC1C,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC/D;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,MAAM,EAAE;wBACN,QAAQ,EAAE,KAAK;qBAChB;oBACD,MAAM,EAAE,QAAQ;oBAChB,QAAQ,EAAE,IAAI;oBACd,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,4BAA4B;oBAClC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,oCAAoC,CAAC;oBACvD,MAAM,EAAE;wBACN,QAAQ,EAAE,KAAK;qBAChB;oBACD,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,sBAAsB;oBAC5B,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;IAED,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrF,CAAC;;AAnLM,uBAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAiB,SAAS;+CAAA;AAE5C;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;qDAAwB;AAClD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAmI1B","sourcesContent":["import '@operato/data-grist'\n\nimport { css, html, LitElement } from 'lit'\nimport { property, query } from 'lit/decorators.js'\nimport { DataGrist } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\n\nexport class CompanyListPopup 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 @query('ox-grist') private grist!: DataGrist\n\n @property({ type: Array }) companyList: any[] = []\n @property({ type: Object }) columns = {\n pagination: { infinite: true },\n columns: [\n { type: 'gutter', gutterName: 'sequence' },\n { type: 'gutter', gutterName: 'row-selector', multiple: false },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n editable: false\n },\n filter: 'search',\n sortable: true,\n width: 150\n },\n {\n type: 'string',\n name: 'businessRegistrationNumber',\n header: i18next.t('field.business registration number'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'branchIdentification',\n header: i18next.t('field.branch identification'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'businessName',\n header: i18next.t('field.tax invoice business name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'representativeName',\n header: i18next.t('field.tax invoice representative name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'address',\n header: i18next.t('field.address'),\n record: {\n editable: false\n },\n width: 200\n },\n {\n type: 'string',\n name: 'businessType',\n header: i18next.t('field.business type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'industryType',\n header: i18next.t('field.industry type'),\n record: {\n editable: false\n },\n width: 100\n },\n {\n type: 'string',\n name: 'department',\n header: i18next.t('field.department'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactName',\n header: i18next.t('field.contact name'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactPhone',\n header: i18next.t('field.contact phone'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactEmail',\n header: i18next.t('field.contact email'),\n record: {\n editable: false\n },\n width: 150\n },\n {\n type: 'string',\n name: 'contactCellPhone',\n header: i18next.t('field.contact cell phone'),\n record: {\n editable: false\n },\n width: 150\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n appendable: false\n }\n }\n\n render() {\n return html`\n <ox-grist\n .mode=${'GRID'}\n .config=${this.columns}\n .data=${{\n records: this.companyList\n }}\n ></ox-grist>\n\n <div class=\"button-container\">\n <mwc-button raised @click=\"${this.select.bind(this)}\">${i18next.t('button.select')}</mwc-button>\n </div>\n `\n }\n\n async select() {\n this.dispatchEvent(new CustomEvent('selected', { detail: this.grist.selected[0] }))\n }\n}\n"]}
@@ -0,0 +1,77 @@
1
+ import '@operato/data-grist';
2
+ import { LitElement } from 'lit';
3
+ export declare class SupplierListPopup extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ private grist;
6
+ supplierList: any[];
7
+ columns: {
8
+ pagination: {
9
+ infinite: boolean;
10
+ };
11
+ columns: ({
12
+ type: string;
13
+ gutterName: string;
14
+ multiple?: undefined;
15
+ name?: undefined;
16
+ header?: undefined;
17
+ record?: undefined;
18
+ filter?: undefined;
19
+ sortable?: undefined;
20
+ width?: undefined;
21
+ } | {
22
+ type: string;
23
+ gutterName: string;
24
+ multiple: boolean;
25
+ name?: undefined;
26
+ header?: undefined;
27
+ record?: undefined;
28
+ filter?: undefined;
29
+ sortable?: undefined;
30
+ width?: undefined;
31
+ } | {
32
+ type: string;
33
+ name: string;
34
+ header: string;
35
+ record: {
36
+ editable: boolean;
37
+ };
38
+ filter: string;
39
+ sortable: boolean;
40
+ width: number;
41
+ gutterName?: undefined;
42
+ multiple?: undefined;
43
+ } | {
44
+ type: string;
45
+ name: string;
46
+ header: string;
47
+ record: {
48
+ editable: boolean;
49
+ };
50
+ filter: string;
51
+ width: number;
52
+ gutterName?: undefined;
53
+ multiple?: undefined;
54
+ sortable?: undefined;
55
+ } | {
56
+ type: string;
57
+ name: string;
58
+ header: string;
59
+ record: {
60
+ editable: boolean;
61
+ };
62
+ width: number;
63
+ gutterName?: undefined;
64
+ multiple?: undefined;
65
+ filter?: undefined;
66
+ sortable?: undefined;
67
+ })[];
68
+ rows: {
69
+ selectable: {
70
+ multiple: boolean;
71
+ };
72
+ appendable: boolean;
73
+ };
74
+ };
75
+ render(): import("lit-html").TemplateResult<1>;
76
+ select(): Promise<void>;
77
+ }