@dangl/web-components-ava 1.1.2-beta0165 → 1.2.0-beta0170

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 (3) hide show
  1. package/README.md +142 -22
  2. package/package.json +1 -1
  3. package/tree.js +1 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Web Components AVA
2
2
 
3
- Shared web components to be used in WEB apps.
3
+ Web components to be used with the [Dangl IT](https://www.dangl-it.com) products for AVA and Invoicing - GAEB, ÖNorm, XRechnung and more!
4
+
5
+ This package contains standalone components that can be used in any web environment. For Angular specific components, visit [@dangl/angular-ava](https://www.npmjs.com/package/@dangl/angular-ava).
4
6
 
5
7
  ## Installation
6
8
 
@@ -12,37 +14,155 @@ npm install --save-dev @dangl/web-components-ava
12
14
 
13
15
  ## Usage
14
16
 
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>
17
+ To use these components, import the JavaScript components into your html file:
18
+
19
+ ```html
20
+ <!-- The AVA Tree component -->
21
+ <script type="module" src="dist/web-component-ava/tree.js"></script>
22
+ <!-- The Invoice component -->
23
+ <script type="module" src="dist/web-component-ava/invoice.js"></script>
26
24
  ```
27
25
 
28
- ### For using Tree component
26
+ ### AVA Tree Component
29
27
 
30
- ```javascript
31
- <ava-tree id="ava-tree"></ava-tree>
28
+ ```html
29
+ <ava-tree id="ava-tree"></ava-tree>
30
+ <script>
32
31
  const tree = document.getElementById('ava-tree');
33
- const serviceSpecifications = {...}
34
- tree.project = serviceSpecifications;
32
+ const project = {...}
33
+ tree.project = project;
34
+ // The config is optional
35
+ tree.config = {...};
36
+ </script>
37
+ ```
38
+
39
+ For the config, you can use this model:
40
+
41
+ ```typescript
42
+ export interface IConfigurationTree {
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
+ 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
+ selectedNodeId?: string;
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
+ indent?: string;
60
+
61
+ /**
62
+ * Optional, you can supply a color to be used as the background color for the selected line. Defaults to the primary
63
+ * color from the Material theme, which is #00acc1.
64
+ */
65
+ selectedColor?: string;
66
+
67
+ /**
68
+ * You can specify which view type to use for the tree. The default is ModeViewType.Tree, but you can also use
69
+ * ModeViewType.List or ModeViewType.Table.
70
+ */
71
+ modeView?: ModeViewType;
72
+
73
+ /**
74
+ * Optional, defaults to true. If this is disabled, then the double click event for elements is not raised, and clicking on an elemt sends an immediate result since the component has not to wait and check if a double click event is fired.
75
+ */
76
+ allowDblClick?: boolean;
77
+
78
+ /**
79
+ * If this is set to true, then the tree will be in selection mode, and the user can select elements by clicking on them. The selected elements will be emitted in the selectedElementsChanged event.
80
+ */
81
+ isSelectionMode?: boolean;
35
82
 
83
+ /**
84
+ * You can optionally supply a list of elements that should be selected initially. This is only used if isSelectionMode is true.
85
+ */
86
+ initiallySelectedElements?: SelectedElement[];
87
+
88
+ /**
89
+ * You can supply a map of strings to be used for the text in the tree. This allows you to translate the text in the tree to other languages. There are also 'DEFAULT_TEXT_WORDS' and 'germanTextsAva' supplied with the package. You may optionally just submit the string values 'en' or 'de' to use the default text words for English or German.
90
+ */
91
+ textWords?: ITextWords | "en" | "de";
92
+
93
+ /**
94
+ * Defaults to true. If this is enabled, then navigating in the tree with the keyboard only works if the mouse is over the tree area. This limitation is useful if you have multiple trees or other components that might be using keyboard input.
95
+ */
96
+ mouseAwareKeyboardControl?: boolean;
97
+
98
+ /**
99
+ * With this parameter, you can configure which keys will be listenend to to switch the tree elements, and also to disable the functionality of the keys
100
+ */
101
+ customKeyboardOperationConfig?: IKeyboardOperationConfig | null;
102
+
103
+ /**
104
+ * You can supply custom filters that are processed when the filter input is changed. Default filters are used that check for short text and item number matches, and you can either add custom filters or replace the default ones.
105
+ */
106
+ listFilterFunc?: FilterFunction[];
107
+
108
+ /**
109
+ * Optional. For table views, this allows you to add custom columns to the table.
110
+ * addTableColumns: Array of objects
111
+ * {
112
+ * name: string, // name of column
113
+ * title: string, // showed title of column
114
+ * align?: string, // optional alight: left(default) / center / right
115
+ * numberFormat?: string // optional format of number value, example: '1.2-2'
116
+ * }
117
+ */
118
+ addTableColumns?: TableColumnType[];
119
+
120
+ /**
121
+ * This allows you to supply a list of functions that can be used to change the appearance of elements.
122
+ * They objects contain a predicate function that is evaluated, along with an option to configure the appearance of the element.
123
+ * functionView: Array of objects
124
+ * {
125
+ * name: string, // name of view part: you can add/remove it when needed
126
+ * func: (element: any, result?: any) => boolean, // this filter function calculates conditions to change the view
127
+ * view: {
128
+ * iconName?: string, // changed name of icon
129
+ * iconColor?: string, // changed color of icon
130
+ * textBold?: string, // changed weight of text
131
+ * textColor?: string // changed color of text
132
+ * }
133
+ * }
134
+ */
135
+ functionView?: IFunctionViewLine[];
136
+ }
36
137
  ```
37
138
 
38
- ### For using Invoice component
139
+ ### Invoice Component
39
140
 
40
- ```javascript
41
- <ava-invoice-display></ava-invoice-display>
42
- const INVOICE = {...}
43
- window['IvoiceGlobalVariable'] = INVOICE;
141
+ ```html
142
+ <ava-invoice-display id="invoiceTree"></ava-invoice-display>
143
+ <script>
144
+ const INVOICE = {...};
145
+ window['InvoiceGlobalVariable'] = INVOICE;
146
+ // The config is optional
147
+ const invoiceView = document.getElementById('invoiceTree');
148
+ invoiceView.config = {...};
149
+ </script>
44
150
  ```
45
151
 
152
+ For the config, you can use this model:
153
+
154
+ ```typescript
155
+ export interface IConfigurationInvoice {
156
+ //** If specified, the invoice viewer will use the given textWords for the text in the UI. */
157
+ textWords?: ITextWordInvoice | null;
158
+
159
+ //** If specified, the invoice viewer will use non-interactive display features, . */
160
+ pdfViewEnabled?: boolean;
161
+
162
+ //** If specified, the invoice viewer will use the given language for the text in the UI. */
163
+ language?: "en" | "de";
164
+ }
165
+ ```
46
166
 
47
167
  ### Demo
48
168
 
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@dangl/web-components-ava",
3
- "version": "1.1.2-beta0165"
3
+ "version": "1.2.0-beta0170"
4
4
  }