@sebgroup/green-angular 3.5.2 → 3.6.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.
package/index.d.ts CHANGED
@@ -12,5 +12,6 @@ export * from './lib/shared';
12
12
  export * from './lib/slider';
13
13
  export * from './lib/in-page-wizard';
14
14
  export * from './lib/context-menu';
15
+ export * from './lib/sortable-list';
15
16
  export * from './lib/cell-table';
16
17
  export * from './lib/shared/core-element';
@@ -13,8 +13,9 @@ import * as i11 from "./context-menu/context-menu.module";
13
13
  import * as i12 from "./in-page-wizard/in-page-wizard.module";
14
14
  import * as i13 from "./cell-table/cell-table.module";
15
15
  import * as i14 from "./shared/shared.module";
16
+ import * as i15 from "./sortable-list/sortable-list.module";
16
17
  export declare class NggModule {
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<NggModule, never>;
18
- static ɵmod: i0.ɵɵNgModuleDeclaration<NggModule, never, [typeof i1.CommonModule], [typeof i2.NggAccordionModule, typeof i3.NggBadgeModule, typeof i4.NggButtonModule, typeof i5.NggDatepickerModule, typeof i6.NggDropdownModule, typeof i7.NggModalModule, typeof i8.NggProgressCircleModule, typeof i9.NggSegmentedControlModule, typeof i10.NggSliderModule, typeof i11.NggContextMenuModule, typeof i12.NggInPageWizardModule, typeof i13.NggCellTableModule, typeof i14.NggSharedModule]>;
19
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NggModule, never, [typeof i1.CommonModule], [typeof i2.NggAccordionModule, typeof i3.NggBadgeModule, typeof i4.NggButtonModule, typeof i5.NggDatepickerModule, typeof i6.NggDropdownModule, typeof i7.NggModalModule, typeof i8.NggProgressCircleModule, typeof i9.NggSegmentedControlModule, typeof i10.NggSliderModule, typeof i11.NggContextMenuModule, typeof i12.NggInPageWizardModule, typeof i13.NggCellTableModule, typeof i14.NggSharedModule, typeof i15.NggSortableListModule]>;
19
20
  static ɵinj: i0.ɵɵInjectorDeclaration<NggModule>;
20
21
  }
@@ -0,0 +1,2 @@
1
+ export * from './sortable-list.component';
2
+ export * from './sortable-list.module';
@@ -0,0 +1,91 @@
1
+ import { ElementRef, EventEmitter, TemplateRef } from '@angular/core';
2
+ import { CdkDragDrop } from '@angular/cdk/drag-drop';
3
+ import * as i0 from "@angular/core";
4
+ export interface SortableListItem {
5
+ id: any;
6
+ name: string;
7
+ description?: string;
8
+ selected?: boolean;
9
+ hasCustomSuffix?: boolean;
10
+ }
11
+ export interface SortableListGroup {
12
+ items: SortableListItem[];
13
+ title: string;
14
+ description?: string;
15
+ }
16
+ export declare class NggSortableListComponent {
17
+ groups: SortableListGroup[];
18
+ shouldDisplayCheckboxes: boolean;
19
+ isReadOnly: boolean;
20
+ isDraggable: boolean;
21
+ description: string;
22
+ suffixTemplate: TemplateRef<any> | null;
23
+ itemSelectionChanged: EventEmitter<{
24
+ changedItem: SortableListItem;
25
+ groups: SortableListGroup[];
26
+ }>;
27
+ itemOrderChanged: EventEmitter<{
28
+ previousIndex: [number, number];
29
+ currentIndex: [number, number];
30
+ groups: SortableListGroup[];
31
+ }>;
32
+ sortableListGroups: ElementRef;
33
+ focusedIndex: Record<number, number>;
34
+ /**
35
+ * Toggles the selection of a checklist item and updates its position in the list.
36
+ *
37
+ * @param item - The checklist item to update.
38
+ */
39
+ toggleSelection(item: SortableListItem): void;
40
+ /**
41
+ * Handles the onDragDrop event.
42
+ *
43
+ * @param event - The drag and drop event.
44
+ */
45
+ onDragDrop(event: CdkDragDrop<SortableListItem[]>): void;
46
+ /**
47
+ * Handles moving items up or down using the alt + arrow up or alt + arrow down keys.
48
+ *
49
+ * @param groupIndex - The index of the group.
50
+ * @param currentItemIndex - The current index of the item.
51
+ * @param newItemIndex - The new index of the item.
52
+ */
53
+ onAltArrowKeydown(groupIndex: number, currentItemIndex: number, newItemIndex: number, event: any): void;
54
+ /**
55
+ * Handles focus by arrow keydown event.
56
+ *
57
+ * @param groupIndex - The index of the group.
58
+ * @param itemIndex - The index of the item.
59
+ * @param event - The keyboard event.
60
+ */
61
+ onArrowKeydown(groupIndex: number, itemIndex: number, event: Event): void;
62
+ /**
63
+ * Emits the item order changed event.
64
+ *
65
+ * @param previousIndex - The previous index of the item.
66
+ * @param currentIndex - The current index of the item.
67
+ */
68
+ private emitItemOrderChanged;
69
+ /**
70
+ * Emits the selected checklist item through an event.
71
+ *
72
+ * @param item - The checklist item to emit.
73
+ */
74
+ private emitCheckListItem;
75
+ /**
76
+ * Focuses on a specific item in the sortable list.
77
+ *
78
+ * @param groupIndex - The index of the group.
79
+ * @param itemIndex - The index of the item.
80
+ */
81
+ private focusItem;
82
+ /**
83
+ * Checks if an item has focus.
84
+ *
85
+ * @param groupIndex - The index of the group.
86
+ * @param itemIndex - The index of the item.
87
+ */
88
+ itemHasFocus(groupIndex: number, itemIndex: number): boolean;
89
+ static ɵfac: i0.ɵɵFactoryDeclaration<NggSortableListComponent, never>;
90
+ static ɵcmp: i0.ɵɵComponentDeclaration<NggSortableListComponent, "ngg-sortable-list", never, { "groups": "groups"; "shouldDisplayCheckboxes": "shouldDisplayCheckboxes"; "isReadOnly": "isReadOnly"; "isDraggable": "isDraggable"; "description": "description"; "suffixTemplate": "suffixTemplate"; }, { "itemSelectionChanged": "itemSelectionChanged"; "itemOrderChanged": "itemOrderChanged"; }, never, never, false, never>;
91
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./sortable-list.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "@angular/cdk/drag-drop";
6
+ export declare class NggSortableListModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<NggSortableListModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NggSortableListModule, [typeof i1.NggSortableListComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i4.DragDropModule], [typeof i1.NggSortableListComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<NggSortableListModule>;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sebgroup/green-angular",
3
- "version": "3.5.2",
3
+ "version": "3.6.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=15.2.9",
6
6
  "@angular/common": ">=15.2.9",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "@sebgroup/green-core": "^1.9.1",
15
- "@sebgroup/chlorophyll": "^3.1.3",
15
+ "@sebgroup/chlorophyll": "^3.2.0",
16
16
  "@sebgroup/extract": "^3.0.1",
17
17
  "tslib": "^2.3.1"
18
18
  },