@dangl/web-components-ava 1.3.0-beta0046 → 1.3.0-beta0064

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 CHANGED
@@ -30,9 +30,11 @@ To use these components, import the JavaScript components into your html file:
30
30
  <script>
31
31
  const tree = document.getElementById('ava-tree');
32
32
  const project = {...}
33
- tree.project = project;
34
- // The config is optional
35
- tree.config = {...};
33
+ tree.setAttribute('project', JSON.stringify(project));
34
+ tree.setAttribute('config', JSON.stringify({ selectedColor: 'violet' }));
35
+ tree.setAttribute('expansionstate', JSON.stringify({ 'ba636130-ae48-4e2c-8f30-c6a7f026ff5c': true }));
36
+ tree.setAttribute('selectednodeid', '29db577d-d4a9-4c28-9877-ff544767e5f4');
37
+ tree.setAttribute('modeview', 'Tree');
36
38
  </script>
37
39
  ```
38
40
 
@@ -40,18 +42,6 @@ For the config, you can use this model:
40
42
 
41
43
  ```typescript
42
44
  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
45
  /**
56
46
  * Optional, defaults to 20px. If this is set, then the tree will be indented by the given value each level.
57
47
  * This can be any valid CSS value for the padding-left property, such as 20px, 1em, or 5%.
@@ -64,12 +54,6 @@ export interface IConfigurationTree {
64
54
  */
65
55
  selectedColor?: string;
66
56
 
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
57
  /**
74
58
  * 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
59
  */
@@ -136,6 +120,30 @@ export interface IConfigurationTree {
136
120
  }
137
121
  ```
138
122
 
123
+ You can also supply the following input parameters
124
+
125
+ ```typescript
126
+ /**
127
+ * Optionally, you can supply a map of expansion states for the tree. The keys should be the
128
+ * id properties of the elements in the tree, and the values should be true if the element is
129
+ * expanded, and false if it is collapsed.
130
+ */
131
+ readonly expansionstate = input<IExpansionState | null, IExpansionState>(null, {
132
+ transform: this.transformFn<IExpansionState>
133
+ });
134
+
135
+ /**
136
+ * Optionally, you can supply the id of the node that should be selected in the tree initially.
137
+ */
138
+ readonly selectednodeid = input<string | null>(null);
139
+
140
+ /**
141
+ * You can specify which view type to use for the tree. The default is ModeViewType.Tree, but you can also use
142
+ * ModeViewType.List or ModeViewType.Table.
143
+ */
144
+ readonly modeview = input<ModeViewType>(ModeViewType.Tree);
145
+ ```
146
+
139
147
  ### Invoice Component
140
148
 
141
149
  ```html