@dangl/web-components-ava 1.1.2-beta0049
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 +186 -0
- package/assets/Material_Icons-400-1.woff2 +0 -0
- package/invoice.js +1 -0
- package/package.json +4 -0
- package/tree.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Dangl.AngularAva
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@dangl/angular-ava)
|
|
4
|
+
|
|
5
|
+
`@dangl/angular-ava` is an UI library for Angular applications. It's used to render trees of AVA Projects. _AVA_ in German stands for _Ausschreibung, Vergabe & Abrechnung_ (_Tendering, awarding & billing_), they represent services and elements of construction projects.
|
|
6
|
+
|
|
7
|
+
[AVACloud by Dangl**IT** GmbH](https://www.dangl-it.com/products/avacloud-gaeb-saas/) is one way of creating such data structures.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
### Import the Module
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { AngularAvaModule } from '../../projects/angular-ava/src/lib/angular-ava.module';
|
|
15
|
+
|
|
16
|
+
@NgModule({
|
|
17
|
+
declarations: [AppComponent],
|
|
18
|
+
imports: [AngularAvaModule],
|
|
19
|
+
providers: [],
|
|
20
|
+
bootstrap: [AppComponent]
|
|
21
|
+
})
|
|
22
|
+
export class AppModule {}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Use the Component
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<ava-tree [project]="projectData" (selectClick)="selected($event, 0)">
|
|
29
|
+
</ava-tree>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`projectData` must be of type `ProjectDto`.
|
|
33
|
+
|
|
34
|
+
### Input Parameters
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
/**
|
|
38
|
+
* This is the main data element for the tree structure. You should supply a ProjectDto with
|
|
39
|
+
* exactly one service specification in it.
|
|
40
|
+
*/
|
|
41
|
+
@Input() project: ProjectDto | null = null;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Optionally, you can supply a map of expansion states for the tree. The keys should be the
|
|
45
|
+
* id properties of the elements in the tree, and the values should be true if the element is
|
|
46
|
+
* expanded, and false if it is collapsed.
|
|
47
|
+
*/
|
|
48
|
+
@Input() expansionState: { [id: string]: boolean } = {};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Optionally, you can supply the id of the node that should be selected in the tree initially.
|
|
52
|
+
*/
|
|
53
|
+
@Input() selectedNodeId: string | null = null;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Optional, defaults to 20px. If this is set, then the tree will be indented by the given value each level.
|
|
57
|
+
* This can be any valid CSS value for the padding-left property, such as 20px, 1em, or 5%.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
@Input() indent = '20px';
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Optional, you can supply a color to be used as the background color for the selected line. Defaults to the primary
|
|
64
|
+
* color from the Material theme, which is #00acc1.
|
|
65
|
+
*/
|
|
66
|
+
@Input() selectedColor: string | null = null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* You can specify which view type to use for the tree. The default is ModeViewType.Tree, but you can also use
|
|
70
|
+
* ModeViewType.List or ModeViewType.Table.
|
|
71
|
+
*/
|
|
72
|
+
@Input() modeView: ModeViewType = ModeViewType.Tree;
|
|
73
|
+
|
|
74
|
+
/** Optional, defaults to true. If this is disabled, then the double click event for elements is not raised,
|
|
75
|
+
* and clicking on an elemt sends an immediate result since the component has not to wait and check if a double click event
|
|
76
|
+
* is fired.
|
|
77
|
+
*/
|
|
78
|
+
@Input() allowDblClick = true;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* If this is set to true, then the tree will be in selection mode, and the user can select elements
|
|
82
|
+
* by clicking on them. The selected elements will be emitted in the selectedElementsChanged event.
|
|
83
|
+
*/
|
|
84
|
+
@Input() isSelectionMode = false;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* You can optionally supply a list of elements that should be selected initially. This is only used if
|
|
88
|
+
* isSelectionMode is true.
|
|
89
|
+
*/
|
|
90
|
+
@Input() initiallySelectedElements: SelectedElement[] | null = null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* You can supply a map of strings to be used for the text in the tree. This allows you to translate
|
|
94
|
+
* the text in the tree to other languages. There are also 'DEFAULT_TEXT_WORDS' and 'germanTextsAva'
|
|
95
|
+
* supplied with the package.
|
|
96
|
+
* {
|
|
97
|
+
* textSearch: string,
|
|
98
|
+
* textNothing: string,
|
|
99
|
+
* textNothingFiltered: string,
|
|
100
|
+
* textAll: string,
|
|
101
|
+
* tooltipAllOpen: string,
|
|
102
|
+
* tooltipAllClose: string,
|
|
103
|
+
* tooltipAllAdd:string,
|
|
104
|
+
* tooltipAllRemove: string,
|
|
105
|
+
* }
|
|
106
|
+
*/
|
|
107
|
+
@Input() set textWords(words: ITextWords | null)
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Defaults to true. If this is enabled, then navigating in the tree with the keyboard only works
|
|
111
|
+
* if the mouse is over the tree area. This limitation is useful if you have multiple trees or other components
|
|
112
|
+
* that might be using keyboard input.
|
|
113
|
+
*/
|
|
114
|
+
@Input() mouseAwareKeyboardControl = true;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* With this parameter, you can configure which keys will be listenend to to switch the tree elements,
|
|
118
|
+
* and also to disable the functionality of the keys */
|
|
119
|
+
@Input() set customKeyboardOperationConfig(config: IKeyboardOperationConfig) {
|
|
120
|
+
this.keyboardOperationService.mergeConfigOperation(config);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* You can supply custom filters that are processed when the filter input is changed. Default filters are used
|
|
125
|
+
* that check for short text and item number matches, and you can either add custom filters or replace the default ones.
|
|
126
|
+
*/
|
|
127
|
+
@Input() listFilterFunc = DEFAULT_FILTERS;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Optional. For table views, this allows you to add custom columns to the table.
|
|
131
|
+
* addTableColumns: Array of objects
|
|
132
|
+
* {
|
|
133
|
+
* name: string, // name of column
|
|
134
|
+
* title: string, // showed title of column
|
|
135
|
+
* align?: string, // optional alight: left(default) / center / right
|
|
136
|
+
* numberFormat?: string // optional format of number value, example: '1.2-2'
|
|
137
|
+
* }
|
|
138
|
+
*/
|
|
139
|
+
@Input() addTableColumns: TableColumnType[] = [];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* This allows you to supply a list of functions that can be used to change the appearance of elements.
|
|
143
|
+
* They objects contain a predicate function that is evaluated, along with an option to configure the
|
|
144
|
+
* appearance of the element.
|
|
145
|
+
* functionView: Array of objects
|
|
146
|
+
* {
|
|
147
|
+
* name: string, // name of view part: you can add/remove it when it need
|
|
148
|
+
* func: (element: any, result?: any) => boolean, // this filter function calculate condition to change view
|
|
149
|
+
* view: {
|
|
150
|
+
* iconName?: string, // changed name of icon
|
|
151
|
+
* iconColor?: string, // changed color of icon
|
|
152
|
+
* textBold?: string, // changed weight of text
|
|
153
|
+
* textColor?: string // changed color of text
|
|
154
|
+
* }
|
|
155
|
+
* }
|
|
156
|
+
*/
|
|
157
|
+
@Input() functionView: IFunctionViewLine[] | null = null;
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Output Parameters
|
|
161
|
+
|
|
162
|
+
```typescript
|
|
163
|
+
/**
|
|
164
|
+
* This is emitted when an element is selected by clicking on it. The selected element is emitted as the event value.
|
|
165
|
+
*/
|
|
166
|
+
@Output() selectClick = new EventEmitter<IElementDto | null>();
|
|
167
|
+
/**
|
|
168
|
+
* This is emitted when an element is selected by double clicking on it. The selected element is emitted as the event value.
|
|
169
|
+
*/
|
|
170
|
+
@Output() selectDblClick = new EventEmitter<IElementDto>();
|
|
171
|
+
/**
|
|
172
|
+
* This is emitted when an element is selected by right clicking on it. The selected element is emitted as the event value.
|
|
173
|
+
*/
|
|
174
|
+
@Output() contextMenuEvent = new EventEmitter<ContextMenuDataType>();
|
|
175
|
+
/**
|
|
176
|
+
* This is emitted when the selected elements in the tree are changed. The selected elements are emitted as the event value.
|
|
177
|
+
* Selected elements are elements whose checkboxes are checked, and are different than elements that are in an active selection state.
|
|
178
|
+
* Typcial use cases for this include e.g. selecting multiple elements within a service specification without
|
|
179
|
+
* actually focussing them, e.g. for further processing.
|
|
180
|
+
*/
|
|
181
|
+
@Output() selectedElementsChanged = new EventEmitter<SelectedElement[]>();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Invoice Module
|
|
185
|
+
|
|
186
|
+
There is also an `InvoiceDisplayComponent` available that can be used to show invoice objects. It can be configured to use `DEFAULT_TEXT_WORD_INVOICE` or `germanTextsInvoice` or any custom implementation of `ITextWordInvoice` in it's `textWords` input property.
|
|
Binary file
|