@limetech/limepkg-cpq-order 2.11.0-dev.1 → 2.11.0-dev.3

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.
@@ -1,6 +1,6 @@
1
1
  import { LimeType, LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
- import { IconfigItemMapping } from '../../interfaces';
3
+ import { IconfigGeneral, IconfigItemMapping, VatBehaviour } from '../../interfaces';
4
4
  import { Item } from '../../classes';
5
5
  export declare class ItemForm implements LimeWebComponent {
6
6
  /**
@@ -15,6 +15,7 @@ export declare class ItemForm implements LimeWebComponent {
15
15
  currency: string;
16
16
  itemMapping: IconfigItemMapping;
17
17
  limetype: LimeType;
18
+ generalConfig: IconfigGeneral;
18
19
  validate: EventEmitter;
19
20
  get translate(): Translator;
20
21
  render(): any[];
@@ -75,6 +76,7 @@ export declare class ItemForm implements LimeWebComponent {
75
76
  name: string;
76
77
  props: {
77
78
  value: number;
79
+ vatBehaviour: VatBehaviour;
78
80
  };
79
81
  };
80
82
  };
@@ -1,4 +1,5 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
+ import { IconfigGeneral } from 'src/interfaces';
2
3
  export declare class ItemSummary implements LimeWebComponent {
3
4
  /**
4
5
  * @inherit
@@ -14,7 +15,12 @@ export declare class ItemSummary implements LimeWebComponent {
14
15
  vat: number;
15
16
  totalInclVat: number;
16
17
  currency: string;
18
+ generalConfig?: IconfigGeneral;
19
+ private vatBehaviour;
17
20
  get translate(): Translator;
21
+ componentWillLoad(): void;
18
22
  render(): any;
23
+ private renderPriceInfoWithoutTax;
24
+ private renderPriceInfoWithTax;
19
25
  private renderSubtotalAndDiscount;
20
26
  }
@@ -1,6 +1,6 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
- import { DocumentTemplate } from 'src/services/documenttemplate.service.interface';
3
+ import { DocumentTemplate } from '@limetech/limepkg-document-templates';
4
4
  export declare class TemplateSelector implements LimeWebComponent {
5
5
  /**
6
6
  * @inherit
@@ -1,6 +1,7 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
2
  import { FormComponent } from '@limetech/lime-elements';
3
3
  import { EventEmitter } from '../../stencil-public-runtime';
4
+ import { VatBehaviour } from 'src/interfaces';
4
5
  export declare class VatSelector implements LimeWebComponent, FormComponent {
5
6
  platform: LimeWebComponentPlatform;
6
7
  context: LimeWebComponentContext;
@@ -10,6 +11,7 @@ export declare class VatSelector implements LimeWebComponent, FormComponent {
10
11
  readonly?: boolean;
11
12
  disabled?: boolean;
12
13
  helperText?: string;
14
+ vatBehaviour: VatBehaviour;
13
15
  change: EventEmitter<number>;
14
16
  vatValue: string;
15
17
  private readonly hundred;
@@ -18,4 +20,6 @@ export declare class VatSelector implements LimeWebComponent, FormComponent {
18
20
  private roundToOneDecimal;
19
21
  render(): any;
20
22
  private handleChange;
23
+ private shouldHideVatField;
24
+ private shouldBeReadOnly;
21
25
  }
@@ -6,10 +6,11 @@
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { LimeProperty, LimeType, LimeWebComponentContext, LimeWebComponentPlatform } from "@limetech/lime-web-components";
9
- import { ErpStatus, Iarticle, IarticleGroup, Iconfig, IconfigItemMapping, Iitem } from "./interfaces";
9
+ import { ErpStatus, Iarticle, IarticleGroup, Iconfig, IconfigGeneral, IconfigItemMapping, Iitem } from "./interfaces";
10
10
  import { Deal, Item, Order } from "./classes";
11
11
  import { StatusLabelMapping } from "./components/erp-status/flow-items";
12
- import { DocumentTemplate } from "src/services/documenttemplate.service.interface";
12
+ import { IconfigGeneral as IconfigGeneral1, VatBehaviour } from "src/interfaces";
13
+ import { DocumentTemplate } from "@limetech/limepkg-document-templates";
13
14
  export namespace Components {
14
15
  interface CocArticleGroupPicker {
15
16
  "config"?: Iconfig;
@@ -148,6 +149,7 @@ export namespace Components {
148
149
  */
149
150
  "context": LimeWebComponentContext;
150
151
  "currency": string;
152
+ "generalConfig": IconfigGeneral;
151
153
  "itemData": Item;
152
154
  "itemMapping": IconfigItemMapping;
153
155
  "limetype": LimeType;
@@ -165,6 +167,7 @@ export namespace Components {
165
167
  "context": LimeWebComponentContext;
166
168
  "currency": string;
167
169
  "discount": number;
170
+ "generalConfig"?: IconfigGeneral1;
168
171
  /**
169
172
  * Reference to the platform
170
173
  * @inherit
@@ -279,6 +282,7 @@ export namespace Components {
279
282
  * The value of the current property
280
283
  */
281
284
  "value": number;
285
+ "vatBehaviour": VatBehaviour;
282
286
  }
283
287
  interface LwcLimepkgCpqOrderLoader {
284
288
  /**
@@ -612,6 +616,7 @@ declare namespace LocalJSX {
612
616
  */
613
617
  "context"?: LimeWebComponentContext;
614
618
  "currency"?: string;
619
+ "generalConfig"?: IconfigGeneral;
615
620
  "itemData"?: Item;
616
621
  "itemMapping"?: IconfigItemMapping;
617
622
  "limetype"?: LimeType;
@@ -630,6 +635,7 @@ declare namespace LocalJSX {
630
635
  "context"?: LimeWebComponentContext;
631
636
  "currency"?: string;
632
637
  "discount"?: number;
638
+ "generalConfig"?: IconfigGeneral1;
633
639
  /**
634
640
  * Reference to the platform
635
641
  * @inherit
@@ -751,6 +757,7 @@ declare namespace LocalJSX {
751
757
  * The value of the current property
752
758
  */
753
759
  "value"?: number;
760
+ "vatBehaviour"?: VatBehaviour;
754
761
  }
755
762
  interface LwcLimepkgCpqOrderLoader {
756
763
  /**
@@ -98,9 +98,18 @@ export interface IconfigOrder {
98
98
  orderrowMapping: IconfigOrderrowMapping;
99
99
  orderFromDealMapping: IconfigOrderFromDealMapping[];
100
100
  }
101
+ export interface IconfigGeneral {
102
+ vat: IconfigVatBehaviour;
103
+ }
104
+ interface IconfigVatBehaviour {
105
+ vat_behaviour: VatBehaviour;
106
+ }
107
+ export declare type VatBehaviour = 'hide' | 'show' | 'show_and_edit';
101
108
  export interface Iconfig {
102
109
  article: IconfigArticle;
103
110
  customization?: IconfigCustomization;
104
111
  cpq?: IconfigCpq;
105
112
  order?: IconfigOrder;
113
+ general_config?: IconfigGeneral;
106
114
  }
115
+ export {};
@@ -1,35 +1,4 @@
1
- export declare const ServerCommandServiceName = "limepkg-server-commands.service";
2
- export interface ServerCommandService {
3
- /**
4
- * Posts the commands to the command endpoint.
5
- *
6
- * @param {ServerCommand[]} payload The commands.
7
- * @returns {Promise<ServerCommandBatchResponse>} The response.
8
- */
9
- postCommands(payload: ServerCommand[]): Promise<ServerCommandBatchResponse>;
10
- }
11
- export interface ServerCommand {
12
- name: string;
13
- parameters: object;
14
- }
15
- export interface ServerCommandResponse {
16
- successful: boolean;
17
- command: object;
18
- data: any;
19
- error: ServerCommandError;
20
- }
21
- export interface ServerCommandError {
22
- code: string;
23
- message: string;
24
- }
25
- export interface ServerCommandBatch {
26
- commands: ServerCommand[];
27
- }
28
- export interface ServerCommandBatchResponse {
29
- successful: boolean;
30
- id: string;
31
- commands: ServerCommandResponse[];
32
- }
1
+ export * from '@limetech/limepkg-server-commands';
33
2
  export declare enum ServerCommandName {
34
3
  upsert = "upsert-limeobject",
35
4
  delete = "delete-limeobject"
@@ -1,4 +1,4 @@
1
1
  import { CreateLimeobjectDialogCommand, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
- import { DocumentTemplate } from './documenttemplate.service.interface';
2
+ import { DocumentTemplate } from '@limetech/limepkg-document-templates';
3
3
  export declare function loadAllTemplates(platform: LimeWebComponentPlatform, limetype: string): Promise<DocumentTemplate[]>;
4
4
  export declare function openGenerateQuotationDialog(platform: LimeWebComponentPlatform, command: CreateLimeobjectDialogCommand): void;
@@ -0,0 +1,10 @@
1
+ import { LimeObject, LimeType, LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ export declare const limeTypes: {
3
+ readonly person: LimeType;
4
+ readonly company: LimeType;
5
+ };
6
+ export declare const limeObjects: {
7
+ readonly person1: LimeObject;
8
+ readonly company1: LimeObject;
9
+ };
10
+ export declare function createTestPlatform(): LimeWebComponentPlatform;
@@ -0,0 +1,8 @@
1
+ import { LimeWebComponentPlatform } from '@limetech/lime-web-components';
2
+ export declare class TestPlatform implements LimeWebComponentPlatform {
3
+ get type(): LimeWebComponentPlatform['type'];
4
+ private services;
5
+ get(name: string): any;
6
+ has(name: string): boolean;
7
+ register(name: string, service: any): void;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/limepkg-cpq-order",
3
- "version": "2.11.0-dev.1",
3
+ "version": "2.11.0-dev.3",
4
4
  "description": "Type definitions for limepkg-cpq-order frontend",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",
@@ -1,142 +0,0 @@
1
- import { FileInfo } from '@limetech/lime-elements';
2
- export interface Template {
3
- id: number;
4
- extension?: string;
5
- last_modified?: string;
6
- mimetype?: string;
7
- filename?: string;
8
- size?: number;
9
- storage_type?: string;
10
- metadata?: {
11
- [key: string]: any;
12
- };
13
- filetype: TemplateFileType;
14
- }
15
- export declare enum TemplateFileType {
16
- DOCUMENT_TEMPLATE = 113,
17
- DOCUMENT_TEMPLATE_2 = 115
18
- }
19
- /**
20
- * The registered name of the document template service.
21
- */
22
- export declare const DocumentTemplateServiceName = "limepkg-document-templates.documenttemplateservice";
23
- /**
24
- * Array of supported document template extensions. Currently allowed ones are: .docx, .pdf, .xlsx
25
- */
26
- export declare const SupportedDocumentTemplateExtensions: readonly ["docx", "pdf", "xlsx"];
27
- /**
28
- * The supported document template extension.
29
- */
30
- export declare type SupportedDocumentTemplateExtension = (typeof SupportedDocumentTemplateExtensions)[number];
31
- /**
32
- * The available options used when getting templates.
33
- */
34
- export declare type GetOptions = {
35
- /**
36
- * Only return templates compatible with this lime type.
37
- */
38
- limetype?: string;
39
- /**
40
- * Only return templates matching this extension.
41
- */
42
- extension?: SupportedDocumentTemplateExtension[];
43
- };
44
- /**
45
- * Defines the document template service.
46
- */
47
- export interface DocumentTemplateService {
48
- /**
49
- * Returns a list of available templates based
50
- * on the provided options.
51
- *
52
- * @param {GetOptions} options The options for the request
53
- * @returns {Promise<DocumentTemplate[]>} The document templates.
54
- */
55
- getTemplates(options?: GetOptions): Promise<DocumentTemplate[]>;
56
- /**
57
- * Returns a file info representation of a document template.
58
- *
59
- * @param {DocumentTemplate} template The document template
60
- * @returns {FileInfo} The file info representation
61
- */
62
- templateToFileInfo(template: DocumentTemplate): FileInfo;
63
- /**
64
- * Returns a document template representation of a file info.
65
- *
66
- * @param {FileInfo} file The file info
67
- * @returns {DocumentTemplate} The document template representation
68
- */
69
- fileInfoToTemplate(file: FileInfo): DocumentTemplate;
70
- }
71
- export interface Locale {
72
- /**
73
- * The locale code.
74
- * For example "en_US".
75
- */
76
- code?: string;
77
- /**
78
- * The locale display name.
79
- */
80
- displayName?: string;
81
- }
82
- /**
83
- * The available document template types.
84
- */
85
- export declare type DocumentTemplateType = 'document_template' | 'legacy_template' | 'field_file';
86
- export interface DocumentTemplate {
87
- /**
88
- * The id of the document template.
89
- *
90
- * When this value is a string it has a custom template id which will
91
- * stay persisted even if the document template file changes.
92
- * When this value is a number it is the same as {@link DocumentTemplate#id}.
93
- */
94
- templateId: string | number;
95
- /**
96
- * The id of the document template's file.
97
- *
98
- * IMPORTANT!
99
- * This id is volatile since it is the id of the document template
100
- * file and thus will change when the template document file changes.
101
- */
102
- fileId: number;
103
- /**
104
- * The name of the document template file.
105
- */
106
- fileName: string;
107
- /**
108
- * The extension of the document template file.
109
- */
110
- extension: string;
111
- /**
112
- * Additional tags for this document template.
113
- */
114
- tags?: string[];
115
- /**
116
- * An optional category for this document template.
117
- *
118
- * NOTE! Only used with legacy templates.
119
- */
120
- category?: string;
121
- /**
122
- * Defines the default locale for this document template.
123
- */
124
- locale?: Locale;
125
- /**
126
- * The type of this document template.
127
- */
128
- type?: DocumentTemplateType;
129
- }
130
- export interface TemplatePickerComponent {
131
- /**
132
- * The name of the web component.
133
- */
134
- name: string;
135
- /**
136
- * The optional web component properties.
137
- */
138
- props?: object;
139
- }
140
- export interface LoadTemplateOptions {
141
- limetype?: string;
142
- }