@limetech/limepkg-cpq-order 2.11.3 → 2.12.0

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,7 +1,7 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator, DialogRenderer } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
3
  import { Deal, Item } from '../../classes';
4
- import { Iconfig } from '../../interfaces';
4
+ import { Iconfig, ActiveEventItem } from '../../interfaces';
5
5
  export declare class DealView implements LimeWebComponent {
6
6
  /**
7
7
  * @inherit
@@ -21,10 +21,13 @@ export declare class DealView implements LimeWebComponent {
21
21
  get translate(): Translator;
22
22
  get dialog(): DialogRenderer;
23
23
  render(): any[];
24
- activateRowHandler(event: CustomEvent<any>): void;
24
+ activateRowHandler(event: CustomEvent<ActiveEventItem | Item>): void;
25
25
  closeDialogHandler: () => void;
26
26
  updateItemHandler: (event: CustomEvent<Item>) => void;
27
+ deleteItemHandler: (event: CustomEvent<Item>) => void;
27
28
  newItemHandler: (event: CustomEvent<Item>) => void;
29
+ setActiveRowAfterPositionChange: (event: CustomEvent<Item>) => void;
30
+ updateItemPositions: (event: CustomEvent<Item[]>) => void;
28
31
  private buttonNewItemClickHandler;
29
32
  private openEditDialog;
30
33
  }
@@ -0,0 +1,13 @@
1
+ import { Item } from 'src/classes';
2
+ import { ItemPosition } from './item-table';
3
+ /**
4
+ * Sorts items based on a new item's position.
5
+ *
6
+ * This function adjusts the positions of other items in the list to make room
7
+ * for the new item's position. It ensures that no two items have the same position.
8
+ *
9
+ * @param items - The list of items to sort.
10
+ * @param newItemPosition - The new position of the item being updated.
11
+ * @returns A new array of items with updated positions.
12
+ */
13
+ export declare function sortItems(items: Item[], newItemPosition: ItemPosition): Item[];
@@ -2,6 +2,10 @@ import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Tr
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
3
  import { IconfigItemMapping } from '../../interfaces';
4
4
  import { Item } from '../../classes';
5
+ export declare type ItemPosition = {
6
+ guid: string;
7
+ position: number;
8
+ };
5
9
  export declare class ItemTable implements LimeWebComponent {
6
10
  /**
7
11
  * @inherit
@@ -18,10 +22,18 @@ export declare class ItemTable implements LimeWebComponent {
18
22
  itemMapping: IconfigItemMapping;
19
23
  private limetypes;
20
24
  activate: EventEmitter<Item>;
25
+ positionUpdate: EventEmitter<Item[]>;
26
+ activeRowChange: EventEmitter<Item>;
27
+ private columns;
28
+ private filteredItems;
21
29
  get translate(): Translator;
30
+ componentWillLoad(): void;
31
+ protected itemMappingChanged(newValue: IconfigItemMapping, oldValue: IconfigItemMapping): void;
32
+ protected itemsChanged(newValue: Item[], oldValue: Item[]): void;
22
33
  render(): any;
23
34
  private renderLoadingBar;
24
35
  private handleActivate;
25
36
  private defineColumns;
26
37
  private filterItems;
38
+ private handlePositionChange;
27
39
  }
@@ -1,7 +1,7 @@
1
1
  import { LimeWebComponent, LimeWebComponentContext, LimeWebComponentPlatform, Translator, DialogRenderer } from '@limetech/lime-web-components';
2
2
  import { EventEmitter } from '../../stencil-public-runtime';
3
3
  import { Item, Order } from '../../classes';
4
- import { Iconfig } from '../../interfaces';
4
+ import { Iconfig, ActiveEventItem } from '../../interfaces';
5
5
  export declare class OrderView implements LimeWebComponent {
6
6
  /**
7
7
  * @inherit
@@ -21,10 +21,13 @@ export declare class OrderView implements LimeWebComponent {
21
21
  get translate(): Translator;
22
22
  get dialog(): DialogRenderer;
23
23
  render(): any[];
24
- activateRowHandler(event: CustomEvent<any>): void;
24
+ activateRowHandler(event: CustomEvent<ActiveEventItem | Item>): void;
25
25
  closeDialogHandler: () => void;
26
26
  updateItemHandler: (event: CustomEvent<Item>) => void;
27
27
  newItemHandler: (event: CustomEvent<Item>) => void;
28
+ deleteItemHandler: (event: CustomEvent<Item>) => void;
29
+ setActiveRowAfterPositionChange: (event: CustomEvent<Item>) => void;
30
+ updateItemPositions: (event: CustomEvent<Item[]>) => void;
28
31
  private buttonNewItemClickHandler;
29
32
  private openEditDialog;
30
33
  private handleOverviewPropertiesInNewOrderDialog;
@@ -0,0 +1,27 @@
1
+ import { TableComponent } from '@limetech/lime-elements';
2
+ import { LimeWebComponentContext, LimeWebComponentPlatform } from '@limetech/lime-web-components';
3
+ import { EventEmitter } from '../../stencil-public-runtime';
4
+ import { ItemPosition } from '../item-table/item-table';
5
+ export declare class CocPositionIndex implements TableComponent {
6
+ /**
7
+ * @inherit
8
+ */
9
+ platform: LimeWebComponentPlatform;
10
+ /**
11
+ * @inherit
12
+ */
13
+ context: LimeWebComponentContext;
14
+ value: ItemPosition;
15
+ private inputValue;
16
+ valueChange: EventEmitter<ItemPosition>;
17
+ private valueHasChanged;
18
+ componentWillLoad(): void;
19
+ private handleChange;
20
+ protected valueChanged(newValue: ItemPosition, oldValue: ItemPosition): void;
21
+ render(): any;
22
+ private handleClick;
23
+ private handleDoubleClick;
24
+ private handleEnterClick;
25
+ private handleBlur;
26
+ private emitValueChange;
27
+ }
@@ -10,6 +10,7 @@ import { ErpStatus, Iarticle, IarticleGroup, Iconfig, IconfigGeneral, IconfigIte
10
10
  import { Deal, Item, Order } from "./classes";
11
11
  import { StatusLabelMapping } from "./components/erp-status/flow-items";
12
12
  import { IconfigGeneral as IconfigGeneral1, VatBehaviour } from "src/interfaces";
13
+ import { ItemPosition } from "./components/item-table/item-table";
13
14
  import { DocumentTemplate } from "@limetech/limepkg-document-templates";
14
15
  export namespace Components {
15
16
  interface CocArticleGroupPicker {
@@ -236,6 +237,20 @@ export namespace Components {
236
237
  */
237
238
  "platform": LimeWebComponentPlatform;
238
239
  }
240
+ interface CocPositionIndex {
241
+ /**
242
+ * @inherit
243
+ */
244
+ "context": LimeWebComponentContext;
245
+ /**
246
+ * @inherit
247
+ */
248
+ "platform": LimeWebComponentPlatform;
249
+ /**
250
+ * Value being rendered
251
+ */
252
+ "value": ItemPosition;
253
+ }
239
254
  interface CocTemplateSelector {
240
255
  /**
241
256
  * The context this component belongs to
@@ -335,6 +350,10 @@ export interface CocOrderViewCustomEvent<T> extends CustomEvent<T> {
335
350
  detail: T;
336
351
  target: HTMLCocOrderViewElement;
337
352
  }
353
+ export interface CocPositionIndexCustomEvent<T> extends CustomEvent<T> {
354
+ detail: T;
355
+ target: HTMLCocPositionIndexElement;
356
+ }
338
357
  export interface CocTemplateSelectorCustomEvent<T> extends CustomEvent<T> {
339
358
  detail: T;
340
359
  target: HTMLCocTemplateSelectorElement;
@@ -434,6 +453,12 @@ declare global {
434
453
  prototype: HTMLCocOrderViewElement;
435
454
  new (): HTMLCocOrderViewElement;
436
455
  };
456
+ interface HTMLCocPositionIndexElement extends Components.CocPositionIndex, HTMLStencilElement {
457
+ }
458
+ var HTMLCocPositionIndexElement: {
459
+ prototype: HTMLCocPositionIndexElement;
460
+ new (): HTMLCocPositionIndexElement;
461
+ };
437
462
  interface HTMLCocTemplateSelectorElement extends Components.CocTemplateSelector, HTMLStencilElement {
438
463
  }
439
464
  var HTMLCocTemplateSelectorElement: {
@@ -468,6 +493,7 @@ declare global {
468
493
  "coc-new-order-dialog": HTMLCocNewOrderDialogElement;
469
494
  "coc-order-card": HTMLCocOrderCardElement;
470
495
  "coc-order-view": HTMLCocOrderViewElement;
496
+ "coc-position-index": HTMLCocPositionIndexElement;
471
497
  "coc-template-selector": HTMLCocTemplateSelectorElement;
472
498
  "coc-vat-selector": HTMLCocVatSelectorElement;
473
499
  "lwc-limepkg-cpq-order-loader": HTMLLwcLimepkgCpqOrderLoaderElement;
@@ -662,6 +688,8 @@ declare namespace LocalJSX {
662
688
  "itemMapping"?: IconfigItemMapping;
663
689
  "items"?: Item[];
664
690
  "onActivate"?: (event: CocItemTableCustomEvent<Item>) => void;
691
+ "onActiveRowChange"?: (event: CocItemTableCustomEvent<Item>) => void;
692
+ "onPositionUpdate"?: (event: CocItemTableCustomEvent<Item[]>) => void;
665
693
  /**
666
694
  * Reference to the platform
667
695
  * @inherit
@@ -712,6 +740,21 @@ declare namespace LocalJSX {
712
740
  */
713
741
  "platform"?: LimeWebComponentPlatform;
714
742
  }
743
+ interface CocPositionIndex {
744
+ /**
745
+ * @inherit
746
+ */
747
+ "context"?: LimeWebComponentContext;
748
+ "onValueChange"?: (event: CocPositionIndexCustomEvent<ItemPosition>) => void;
749
+ /**
750
+ * @inherit
751
+ */
752
+ "platform"?: LimeWebComponentPlatform;
753
+ /**
754
+ * Value being rendered
755
+ */
756
+ "value"?: ItemPosition;
757
+ }
715
758
  interface CocTemplateSelector {
716
759
  /**
717
760
  * The context this component belongs to
@@ -791,6 +834,7 @@ declare namespace LocalJSX {
791
834
  "coc-new-order-dialog": CocNewOrderDialog;
792
835
  "coc-order-card": CocOrderCard;
793
836
  "coc-order-view": CocOrderView;
837
+ "coc-position-index": CocPositionIndex;
794
838
  "coc-template-selector": CocTemplateSelector;
795
839
  "coc-vat-selector": CocVatSelector;
796
840
  "lwc-limepkg-cpq-order-loader": LwcLimepkgCpqOrderLoader;
@@ -815,6 +859,7 @@ declare module "@stencil/core" {
815
859
  "coc-new-order-dialog": LocalJSX.CocNewOrderDialog & JSXBase.HTMLAttributes<HTMLCocNewOrderDialogElement>;
816
860
  "coc-order-card": LocalJSX.CocOrderCard & JSXBase.HTMLAttributes<HTMLCocOrderCardElement>;
817
861
  "coc-order-view": LocalJSX.CocOrderView & JSXBase.HTMLAttributes<HTMLCocOrderViewElement>;
862
+ "coc-position-index": LocalJSX.CocPositionIndex & JSXBase.HTMLAttributes<HTMLCocPositionIndexElement>;
818
863
  "coc-template-selector": LocalJSX.CocTemplateSelector & JSXBase.HTMLAttributes<HTMLCocTemplateSelectorElement>;
819
864
  "coc-vat-selector": LocalJSX.CocVatSelector & JSXBase.HTMLAttributes<HTMLCocVatSelectorElement>;
820
865
  "lwc-limepkg-cpq-order-loader": LocalJSX.LwcLimepkgCpqOrderLoader & JSXBase.HTMLAttributes<HTMLLwcLimepkgCpqOrderLoaderElement>;
@@ -1,4 +1,6 @@
1
+ import { Column } from '@limetech/lime-elements';
1
2
  import { IconfigBaseMapping } from './config';
3
+ import { ItemPosition } from 'src/components/item-table/item-table';
2
4
  export interface Iitem<T extends {} = Record<string, any>> {
3
5
  id: number;
4
6
  articleGroup?: IarticleGroup;
@@ -57,13 +59,16 @@ export interface Iorder extends Base {
57
59
  deal: number;
58
60
  orderstatus: ErpStatus;
59
61
  }
60
- export interface Icolumn {
62
+ export interface Icolumn extends Column {
61
63
  title: string;
62
64
  field: string;
63
65
  headerSort: boolean;
64
66
  horizontalAlign?: 'left' | 'center' | 'right';
65
67
  formatter?: any;
66
68
  }
69
+ export interface ActiveEventItem extends Omit<Iitem, 'position'> {
70
+ position: ItemPosition;
71
+ }
67
72
  export declare enum ErpStatus {
68
73
  notready = "notready",
69
74
  readytobesent = "readytobesent",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/limepkg-cpq-order",
3
- "version": "2.11.3",
3
+ "version": "2.12.0",
4
4
  "description": "Type definitions for limepkg-cpq-order frontend",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs.js",