angular-toolbox 0.9.4 → 0.9.5
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/README.md +1 -1
- package/esm2022/lib/collection/array-list-event-type.enum.mjs +30 -0
- package/esm2022/lib/collection/array-list.event.mjs +23 -0
- package/esm2022/lib/collection/array-list.mjs +158 -0
- package/esm2022/lib/collection/index.mjs +11 -0
- package/esm2022/lib/model/service/index.mjs +2 -2
- package/esm2022/lib/model/service/version/angular-toolbox-version.service.mjs +3 -3
- package/esm2022/lib/model/service/version/index.mjs +3 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/angular-toolbox.mjs +219 -4
- package/fesm2022/angular-toolbox.mjs.map +1 -1
- package/lib/collection/array-list-event-type.enum.d.ts +28 -0
- package/lib/collection/array-list.d.ts +111 -0
- package/lib/collection/array-list.event.d.ts +29 -0
- package/lib/collection/index.d.ts +10 -0
- package/lib/model/service/index.d.ts +1 -1
- package/lib/model/service/version/index.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The `ArrayListEventType` class the type of events on an `ArrayListEvent` object.
|
|
10
|
+
*/
|
|
11
|
+
export declare enum ArrayListEventType {
|
|
12
|
+
/**
|
|
13
|
+
* The type of event associated with the `ArrayList.addAll` action.
|
|
14
|
+
*/
|
|
15
|
+
ADD_ALL = "addAll",
|
|
16
|
+
/**
|
|
17
|
+
* The type of event associated with the `ArrayList.addItem`, or `ArrayList.addItemAt` actions.
|
|
18
|
+
*/
|
|
19
|
+
ADD = "add",
|
|
20
|
+
/**
|
|
21
|
+
* The type of event associated with the `ArrayList.removeAll` action.
|
|
22
|
+
*/
|
|
23
|
+
REMOVE_ALL = "removeAll",
|
|
24
|
+
/**
|
|
25
|
+
* The type of event associated with the `ArrayList.remove`, or `ArrayList.removeAt` actions.
|
|
26
|
+
*/
|
|
27
|
+
REMOVE = "remove"
|
|
28
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
import { EventEmitter } from "@angular/core";
|
|
9
|
+
import { IdentifiableComponent } from "../core";
|
|
10
|
+
import { ArrayListEvent } from "./array-list.event";
|
|
11
|
+
/**
|
|
12
|
+
* The `ArrayList` class uses a backing `Array` as the source of the data collection. Items in the backing
|
|
13
|
+
* `Array` can be accessed and manipulated using the methods and properties of the `ArrayList` instance.
|
|
14
|
+
* Operations on an `ArrayList` instance modify the data source.
|
|
15
|
+
*
|
|
16
|
+
* You typically use the `ArrayList` class as base class for services that persist data in the User Interface.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ArrayList<T> extends IdentifiableComponent {
|
|
19
|
+
/**
|
|
20
|
+
* Dispatches events each time this `ArrayList` is modified.
|
|
21
|
+
*/
|
|
22
|
+
readonly change: EventEmitter<ArrayListEvent<T>>;
|
|
23
|
+
/**
|
|
24
|
+
* Gets the number of items in the list.
|
|
25
|
+
*/
|
|
26
|
+
get length(): number;
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* The array used as a source for the `ArrayList`.
|
|
30
|
+
*/
|
|
31
|
+
protected __list__: Array<T>;
|
|
32
|
+
/**
|
|
33
|
+
* @private
|
|
34
|
+
*/
|
|
35
|
+
constructor(classRef?: string | undefined);
|
|
36
|
+
/**
|
|
37
|
+
* Adds a list of items to the current `ArrayList` instance, placing them at the end of the
|
|
38
|
+
* list in the order they are passed.
|
|
39
|
+
*
|
|
40
|
+
* @param addList The list of items to add to this current `ArrayList` instance.
|
|
41
|
+
*
|
|
42
|
+
* @return A reference to this `ArrayList` instance.
|
|
43
|
+
*/
|
|
44
|
+
addAll(addList: Array<T>): ArrayList<T>;
|
|
45
|
+
/**
|
|
46
|
+
* Adds the specified item to the end of the list.
|
|
47
|
+
*
|
|
48
|
+
* @param item The item to add.
|
|
49
|
+
*
|
|
50
|
+
* @return A reference to this `ArrayList` instance.
|
|
51
|
+
*/
|
|
52
|
+
addItem(item: T): ArrayList<T>;
|
|
53
|
+
/**
|
|
54
|
+
* Adds the item at the specified index.
|
|
55
|
+
*
|
|
56
|
+
* @param item The item to place at the index.
|
|
57
|
+
* @param index The index at which to place the item.
|
|
58
|
+
*
|
|
59
|
+
* @return A reference to this `ArrayList` instance.
|
|
60
|
+
*/
|
|
61
|
+
addItemAt(item: T, index: number): ArrayList<T>;
|
|
62
|
+
/**
|
|
63
|
+
* Gets the item at the specified index.
|
|
64
|
+
*
|
|
65
|
+
* @param index The index in the list from which to retrieve the item.
|
|
66
|
+
*
|
|
67
|
+
* @returns The item at that index, `undefined` if there is none.
|
|
68
|
+
*/
|
|
69
|
+
getItemAt(index: number): T | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the index of the item if it is in the list.
|
|
72
|
+
*
|
|
73
|
+
* @param item The item to find.
|
|
74
|
+
*
|
|
75
|
+
* @returns The index of the item, `-1` if the item is not in the list.
|
|
76
|
+
*/
|
|
77
|
+
getItemIndex(item: T): number;
|
|
78
|
+
/**
|
|
79
|
+
* Removes all items from the list.
|
|
80
|
+
*
|
|
81
|
+
* @return A reference to this `ArrayList` instance.
|
|
82
|
+
*/
|
|
83
|
+
removeAll(): ArrayList<T>;
|
|
84
|
+
/**
|
|
85
|
+
* Removes the specified item from this list.
|
|
86
|
+
*
|
|
87
|
+
* @param item Reference to the item that should be removed.
|
|
88
|
+
*
|
|
89
|
+
* @returns `true` whether if the item was removed; `false` otherwise.
|
|
90
|
+
*/
|
|
91
|
+
removeItem(item: T): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Removes the item at the specified index and returns it.
|
|
94
|
+
* Any items that were after this index are now one index earlier.
|
|
95
|
+
*
|
|
96
|
+
* @param index The index from which to remove the item.
|
|
97
|
+
|
|
98
|
+
* @returns The item that was removed.
|
|
99
|
+
*/
|
|
100
|
+
removeItemAt(index: number): T | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Returns an array that is populated in the same order as this `ArrayList` instance.
|
|
103
|
+
*
|
|
104
|
+
* @returns An array that is populated in the same order as this `ArrayList` instance.
|
|
105
|
+
*/
|
|
106
|
+
toArray(): Array<T>;
|
|
107
|
+
/**
|
|
108
|
+
* @private
|
|
109
|
+
*/
|
|
110
|
+
private dispatchEvent;
|
|
111
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
import { ArrayList } from "./array-list";
|
|
9
|
+
import { ArrayListEventType } from "./array-list-event-type.enum";
|
|
10
|
+
/**
|
|
11
|
+
* The `ArrayListEvent` class represents an event that is dispatched when the associated collection changes.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ArrayListEvent<T> {
|
|
14
|
+
/**
|
|
15
|
+
* The type of this event.
|
|
16
|
+
*/
|
|
17
|
+
readonly type: ArrayListEventType;
|
|
18
|
+
/**
|
|
19
|
+
* The reference to the `ArrayList` instance that dispatches this event.
|
|
20
|
+
*/
|
|
21
|
+
readonly list: ArrayList<T>;
|
|
22
|
+
/**
|
|
23
|
+
* Represents events dispatched by the `ArrayList` class.
|
|
24
|
+
*
|
|
25
|
+
* @param type The type of the event.
|
|
26
|
+
* @param list The reference to the `ArrayList` instance that dispatches this event.
|
|
27
|
+
*/
|
|
28
|
+
constructor(type: ArrayListEventType, list: ArrayList<T>);
|
|
29
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
export * from './array-list';
|
|
9
|
+
export * from './array-list.event';
|
|
10
|
+
export * from './array-list-event-type.enum';
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
7
|
*/
|
|
8
8
|
export * from './lib/angular-toolbox.module';
|
|
9
|
+
export * from './lib/collection';
|
|
9
10
|
export * from './lib/component';
|
|
10
11
|
export * from './lib/core';
|
|
11
12
|
export * from './lib/directive';
|