@dangl/web-components-ava 1.1.2-beta0066 → 1.1.2-beta0078

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