@simpleangularcontrols/sac-common 10.0.0-rc.11 → 10.0.0-rc.13

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 (86) hide show
  1. package/bundles/simpleangularcontrols-sac-common.umd.js +1425 -1088
  2. package/bundles/simpleangularcontrols-sac-common.umd.js.map +1 -1
  3. package/bundles/simpleangularcontrols-sac-common.umd.min.js +1 -1
  4. package/bundles/simpleangularcontrols-sac-common.umd.min.js.map +1 -1
  5. package/common/basedatetimecontrol.d.ts +99 -13
  6. package/common/basemodelcontrol.d.ts +33 -29
  7. package/controls/checkbox/radiobutton.d.ts +61 -26
  8. package/controls/contextmenu/contextmenu.d.ts +26 -19
  9. package/controls/contextmenu/contextmenu.interface.d.ts +3 -0
  10. package/controls/contextmenu/contextmenuitem.d.ts +5 -0
  11. package/controls/contextmenu/contextmenuitembutton.d.ts +21 -20
  12. package/controls/datetime/date.d.ts +28 -27
  13. package/controls/datetime/datetime.d.ts +27 -27
  14. package/controls/datetime/time.d.ts +26 -26
  15. package/controls/dialog/dialog.d.ts +31 -43
  16. package/controls/layout/formlayout.d.ts +4 -0
  17. package/controls/list/buildvaluestring.d.ts +6 -0
  18. package/controls/list/dropdown.d.ts +9 -51
  19. package/controls/list/dropdownoptions.d.ts +38 -0
  20. package/controls/list/dropdownoptions.ngfactory.d.ts +1 -0
  21. package/controls/static/formcontainer.d.ts +11 -3
  22. package/controls/tooltip/tooltip.d.ts +33 -51
  23. package/controls/treeview/treeview.d.ts +87 -121
  24. package/esm2015/common/basedatetimecontrol.js +178 -30
  25. package/esm2015/common/basemodelcontrol.js +71 -56
  26. package/esm2015/controls/checkbox/radiobutton.js +94 -45
  27. package/esm2015/controls/contextmenu/contextmenu.interface.js +1 -0
  28. package/esm2015/controls/contextmenu/contextmenu.interface.ngfactory.js +7 -0
  29. package/esm2015/controls/contextmenu/contextmenu.js +22 -23
  30. package/esm2015/controls/contextmenu/contextmenuitem.js +13 -2
  31. package/esm2015/controls/contextmenu/contextmenuitembutton.js +34 -25
  32. package/esm2015/controls/datetime/date.js +43 -41
  33. package/esm2015/controls/datetime/datetime.js +42 -41
  34. package/esm2015/controls/datetime/time.js +42 -41
  35. package/esm2015/controls/dialog/dialog.js +41 -83
  36. package/esm2015/controls/layout/formlayout.js +7 -6
  37. package/esm2015/controls/list/buildvaluestring.js +18 -0
  38. package/esm2015/controls/{treeview/ngtreeitemaction.ngfactory.js → list/buildvaluestring.ngfactory.js} +1 -1
  39. package/esm2015/controls/list/dropdown.js +16 -114
  40. package/esm2015/controls/list/dropdownoptions.js +72 -0
  41. package/esm2015/controls/{treeview/treeviewchild.ngfactory.js → list/dropdownoptions.ngfactory.js} +1 -1
  42. package/esm2015/controls/static/formcontainer.js +16 -6
  43. package/esm2015/controls/tooltip/tooltip.js +60 -250
  44. package/esm2015/controls/treeview/treeview.js +232 -247
  45. package/esm2015/interfaces/ISacConfigurationService.js +1 -1
  46. package/esm2015/interfaces/ISacIconService.js +1 -1
  47. package/esm2015/interfaces/treeviewaction.interface.js +1 -0
  48. package/esm2015/interfaces/treeviewaction.interface.ngfactory.js +7 -0
  49. package/esm2015/public_api.js +6 -6
  50. package/esm2015/services/sac-configuration.service.js +7 -5
  51. package/esm2015/services/sac-icon.service.js +25 -1
  52. package/esm2015/utilities/enums.js +5 -1
  53. package/esm2015/utilities/popuphelper.js +343 -0
  54. package/esm2015/utilities/popuphelper.ngfactory.js +7 -0
  55. package/esm2015/validation/equals.validator.js +14 -0
  56. package/esm2015/validation/equals.validator.ngfactory.js +7 -0
  57. package/esm2015/validation/notequals.validator.js +14 -0
  58. package/esm2015/validation/notequals.validator.ngfactory.js +7 -0
  59. package/esm2015/validation/validation.class.js +30 -6
  60. package/fesm2015/simpleangularcontrols-sac-common.js +1398 -1075
  61. package/fesm2015/simpleangularcontrols-sac-common.js.map +1 -1
  62. package/interfaces/ISacConfigurationService.d.ts +4 -0
  63. package/interfaces/ISacIconService.d.ts +16 -0
  64. package/interfaces/treeviewaction.interface.d.ts +4 -0
  65. package/interfaces/treeviewaction.interface.ngfactory.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/public_api.d.ts +5 -5
  68. package/services/sac-configuration.service.d.ts +8 -0
  69. package/services/sac-icon.service.d.ts +33 -1
  70. package/simpleangularcontrols-sac-common-10.0.0-rc.13.tgz +0 -0
  71. package/simpleangularcontrols-sac-common.metadata.json +1 -1
  72. package/utilities/enums.d.ts +3 -1
  73. package/utilities/popuphelper.d.ts +83 -0
  74. package/utilities/popuphelper.ngfactory.d.ts +1 -0
  75. package/validation/equals.validator.d.ts +2 -0
  76. package/validation/equals.validator.ngfactory.d.ts +1 -0
  77. package/validation/notequals.validator.d.ts +2 -0
  78. package/validation/notequals.validator.ngfactory.d.ts +1 -0
  79. package/validation/validation.class.d.ts +19 -0
  80. package/controls/treeview/ngtreeitemaction.d.ts +0 -40
  81. package/controls/treeview/treeviewchild.d.ts +0 -12
  82. package/esm2015/controls/treeview/ngtreeitemaction.js +0 -60
  83. package/esm2015/controls/treeview/treeviewchild.js +0 -18
  84. package/simpleangularcontrols-sac-common-10.0.0-rc.11.tgz +0 -0
  85. /package/controls/{treeview/ngtreeitemaction.ngfactory.d.ts → contextmenu/contextmenu.interface.ngfactory.d.ts} +0 -0
  86. /package/controls/{treeview/treeviewchild.ngfactory.d.ts → list/buildvaluestring.ngfactory.d.ts} +0 -0
@@ -1,5 +1,5 @@
1
- import { AfterViewChecked, ChangeDetectorRef, DoCheck, ElementRef, OnDestroy, OnInit } from '@angular/core';
2
1
  import { TooltipPosition } from '../../utilities/enums';
2
+ import { AfterViewChecked, ChangeDetectorRef, DoCheck, ElementRef, OnDestroy, OnInit } from '@angular/core';
3
3
  /**
4
4
  * Tooltip Component
5
5
  *
@@ -14,6 +14,10 @@ import { TooltipPosition } from '../../utilities/enums';
14
14
  export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, AfterViewChecked, DoCheck {
15
15
  private readonly cdRef;
16
16
  private readonly ref;
17
+ /**
18
+ * Helper class to display tooltip on correct position
19
+ */
20
+ private readonly popupHelper;
17
21
  /**
18
22
  * Inline mode for tooltip
19
23
  */
@@ -22,28 +26,10 @@ export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, Aft
22
26
  * Defines whether the tooltip is visible
23
27
  */
24
28
  private _isTooltipVisible;
25
- /**
26
- * method if content has changed and proportions need to be reset in the UI.
27
- */
28
- private readonly onContentChange;
29
29
  /**
30
30
  * Containers for the tooltip
31
31
  */
32
32
  private tooltipcontainer;
33
- /**
34
- * Position of the tooltip. Values: left|top|right|bottom|auto
35
- *
36
- * Value 'auto' can be combined with another value.
37
- */
38
- position: string;
39
- /**
40
- * Text for ToolTip
41
- */
42
- tooltiptext: string;
43
- /**
44
- * Name of the container for content (e.g. icon) on which the tooltip is displayed.
45
- */
46
- content: ElementRef<HTMLElement>;
47
33
  /**
48
34
  * Position of the tooltip on the left
49
35
  */
@@ -60,11 +46,37 @@ export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, Aft
60
46
  * Position of the tooltip at the top
61
47
  */
62
48
  TopPos: number;
49
+ /**
50
+ * Name of the container for content (e.g. icon) on which the tooltip is displayed.
51
+ */
52
+ content: ElementRef<HTMLElement>;
53
+ /**
54
+ * Position of the picker arrow at the left
55
+ */
56
+ posArrowLeft: number | null;
57
+ /**
58
+ * Position of the picker arrow at the top
59
+ */
60
+ posArrowTop: number | null;
61
+ /**
62
+ * Position of the tooltip. Values: left|top|right|bottom|auto
63
+ *
64
+ * Value 'auto' can be combined with another value.
65
+ */
66
+ position: string;
67
+ /**
68
+ * Text for ToolTip
69
+ */
70
+ tooltiptext: string;
63
71
  /**
64
72
  * Konstruktor
65
73
  * @param ref Element Referenz
66
74
  */
67
75
  constructor(cdRef: ChangeDetectorRef, ref: ElementRef);
76
+ /**
77
+ * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
78
+ */
79
+ get inlinemode(): boolean;
68
80
  /**
69
81
  * Setter for inline mode for tooltip
70
82
  */
@@ -73,10 +85,6 @@ export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, Aft
73
85
  * Setter for the name of the container for the tooltip. Is required as the tooltip can be hidden via ngIf.
74
86
  */
75
87
  set tooltip(content: ElementRef);
76
- /**
77
- * Property for inline mode for tooltip. Sets the display mode on the wrapper element to `inline`
78
- */
79
- get inlinemode(): boolean;
80
88
  get tooltop(): ElementRef;
81
89
  /**
82
90
  * Returns the position of the tooltip
@@ -122,24 +130,6 @@ export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, Aft
122
130
  * Offset for Tooltip. Required for BS4/BS5 to create padding
123
131
  */
124
132
  protected abstract getTooltipOffset(): number;
125
- /**
126
- * Returns the defined position for the tooltip
127
- */
128
- private GetPosition;
129
- /**
130
- * Returns whether the position has been configured
131
- *
132
- * @param position Position to be checked
133
- */
134
- private HasPosition;
135
- /**
136
- * Defines whether AutoPosition is active
137
- */
138
- private IsAutoPosition;
139
- /**
140
- * Checks whether the position is valid or whether the tooltip on the position has space
141
- */
142
- private ValidatePositions;
143
133
  /**
144
134
  * Calculates the position of the tooltip from links
145
135
  */
@@ -149,15 +139,7 @@ export declare abstract class SacTooltipCommon implements OnInit, OnDestroy, Aft
149
139
  */
150
140
  private getTopPosition;
151
141
  /**
152
- * Calculates the top of the page inside all elements
153
- * @param element HTML Element
154
- * @returns summarized top value for absolute position
155
- */
156
- private getOffsetTopParent;
157
- /**
158
- * Caclulate Scrollbars inside tree
159
- * @param element HTML Element
160
- * @returns Scroll top value of element with all childs
142
+ * method if content has changed and proportions need to be reset in the UI.
161
143
  */
162
- private getScrollTopParent;
144
+ private readonly onContentChange;
163
145
  }
@@ -1,185 +1,151 @@
1
- import { EventEmitter, OnInit, TemplateRef } from '@angular/core';
1
+ import { SacBaseModelControl } from '../../common/basemodelcontrol';
2
+ import { TreeviewAction } from '../../interfaces/treeviewaction.interface';
3
+ import { SacFormLayoutCommon } from '../layout/formlayout';
4
+ import { EventEmitter, Injector, TemplateRef } from '@angular/core';
5
+ import { AbstractControl, ValidationErrors } from '@angular/forms';
2
6
  /**
3
7
  * Basis Komponente für SacTreeView
4
8
  */
5
- export declare class SacTreeViewCommon implements OnInit {
9
+ export declare class SacTreeviewCommon extends SacBaseModelControl<any> {
6
10
  /**
7
- * Das Property enthielt boolean Wert und deffiniert, ob alle Items collapsed sind. Default value: undefined/null
11
+ * Event when Action is clicked on Node. An object of the type 'TreeviewAction' is returned. In the default case, 'action' in this object is always the value 'default'. The value can be changed via the 'templateaction'.
8
12
  */
9
- _collapseAll: boolean;
13
+ actionclicked: EventEmitter<TreeviewAction>;
10
14
  /**
11
- * Das Property enthielt boolean Wert und deffiniert, ob alle Items selected sind. Default value: undefined/null
15
+ * Property on the data object that contains the children of the structure element. Must be an array of objects. The default value is 'children'
12
16
  */
13
- private _selectAll;
17
+ attrchildren: string;
14
18
  /**
15
- * Das Property enthielt array of nodes. Default value: empty array [].
19
+ * Defines the property on the 'data' object with which the actions for a node can be deactivated. A 'disabled' property is used by default.
16
20
  */
17
- nodes: any[];
21
+ attrdisableaction: string;
18
22
  /**
19
- * Das Property enthielt node attribute: 'isCollapsed'. Es wird benutzt beim rendering. Für Expand/Collapsed Sicht des Node(Wert)
23
+ * Property on the 'data' object that stores the expanded state. Property must be of type boolean. Default is 'expanded'
20
24
  */
21
- collapseAttr: string;
25
+ attrexanded: string;
22
26
  /**
23
- * Das Property enthielt node attribute: 'isSelected'. Es wird benutzt beim Vorbereitung des Data des TreeView
27
+ * Property for saving the HoverState on the field. If the property is not present on the node, it is automatically created and removed again. The value can usually be left at the default value unless there is a conflict with a property on the node that is required for other purposes.
24
28
  */
25
- selectAttr: string;
29
+ attrhoverstate: string;
26
30
  /**
27
- * Das Property enthielt node attribute: 'isIndeterminate'. Es wird benutzt beim Vorbereitung des Data des TreeView
31
+ * Property on 'data' object, which contains the icon for the node. By default, the property is not set, which hides the icon in the node.
28
32
  */
29
- inDeterminateAttr: string;
33
+ attricon: string | null;
30
34
  /**
31
- * Providen data for tree.
35
+ * property on the 'data' object contains an ID of the node. The default is 'id'. If the property is set to NULL, the selectedId event is no longer triggered.
32
36
  */
33
- private _data;
37
+ attrid: string | null;
34
38
  /**
35
- * Getter für Data des TreeView
39
+ * Property on 'data' object, which contains the label for the node. Default is 'label'
36
40
  */
37
- get data(): any[];
41
+ attrlabel: string;
38
42
  /**
39
- * Input Property für Data des TreeView
43
+ * Property on 'data' object, which defines whether the node is selected or not. It should be ensured that only 1 node has the value for Selected set to true. Default is 'selected'.
40
44
  */
41
- set data(value: any[]);
45
+ attrselected: string;
42
46
  /**
43
- * Input Property für template des TreeView. Type: TemplateRef<any>.
47
+ * Event when a node is collapsed. Returns the node element as a parameter
44
48
  */
45
- template: TemplateRef<any>;
49
+ collabsed: EventEmitter<any>;
46
50
  /**
47
- * Die Directive erhält die actions für das TreeView
51
+ * The property contains an array of nodes. The data must already map the tree via child properties.
48
52
  */
49
- set treeviewTemplate(v: TemplateRef<any>);
53
+ data: any[];
50
54
  /**
51
- * Getter für das TreeView Template
55
+ * Activates the 'expand' and 'collabse' event even if a node has no children. This is helpful if node elements are to be reloaded at runtime.
52
56
  */
53
- get treeviewTemplate(): TemplateRef<any>;
57
+ enableasynchload: boolean | string;
54
58
  /**
55
- * Input property erhält Icon für das Template
59
+ * Activates Ellipsis on the node labels
56
60
  */
57
- fileicontemplate: TemplateRef<any>;
61
+ enableellipsis: boolean;
58
62
  /**
59
- * Setter property. Deffiniert das FileIcon für das TreeView
63
+ * Event when a node is expanded. Returns the node element as a parameter
60
64
  */
61
- set treefileicon(v: TemplateRef<any>);
65
+ expanded: EventEmitter<any>;
62
66
  /**
63
- * Getter property. Ergibt das FileIcon für das TreeView
67
+ * Defines whether an icon for the expanded/collapsed status should be displayed.
64
68
  */
65
- get treefileicon(): TemplateRef<any>;
69
+ expandedstate: boolean | string;
66
70
  /**
67
- * Input property für den Namen des TreeView. Type string. Default value: ""
71
+ * A node must be selected
68
72
  */
69
- name: string;
70
- /**
71
- * A flag indicating data is flatten in array and prepare is required.(Default
72
- * is false).
73
- */
74
- prepareData: boolean;
75
- /**
76
- * Attribute for Text in Tree
77
- */
78
- textAttr: string;
79
- /**
80
- * Name of ID property in input data.
81
- */
82
- idAttr: string;
83
- /**
84
- * Name of parent property in input data.
85
- */
86
- parentAttr: string;
87
- /**
88
- * Name of children list property in input data.
89
- */
90
- childrenAttr: string;
91
- /**
92
- * Title des Treeview
93
- */
94
- title: any;
95
- /**
96
- * Collapse or expand all parent nodes.
97
- */
98
- set collapseall(value: boolean);
99
- /**
100
- * Getter für das collapse property. Ergibt boolean Wert, ob die Items collapsed/expand sind.
101
- */
102
- get collapseall(): boolean;
103
- /**
104
- * Select or deselect all nodes.
105
- */
106
- set selectall(value: boolean);
107
- /**
108
- * Input property - setter. Deffiniert das ID des selektierten Item(node)
109
- */
110
- set selectedid(v: any);
73
+ isrequired: boolean;
111
74
  /**
112
- * Getter. Ergibt das ID des selektierten Item(node)
75
+ * Name of the TreeView control
113
76
  */
114
- get selectedId(): any;
115
- /**
116
- * Das Property erhält das selektierte Wert(node). Default value: undefined/null
117
- */
118
- private _selectedNode;
119
- /**
120
- * Setter für das selektierte Wert(node). Wenn aufgerufen das ID und TextAttr des selected Node wird emitted
121
- */
122
- set selectedNode(v: any);
123
- /**
124
- * Getter für das selektierte Wert(node). Ergibt das selektierte Wert(node).
125
- */
126
- get selectedNode(): any;
77
+ name: string;
127
78
  /**
128
- * Output Emitter. Emit das ID des selected Node.
79
+ * Event when a node is selected. Returns the id attribute as a parameter. The event is not triggered if 'attrid' is not set.
129
80
  */
130
- selectedidchange: EventEmitter<any>;
81
+ selected: EventEmitter<any>;
131
82
  /**
132
- * Output Emitter. Emit das TextAttr des selected Node.
83
+ * Event when a node is selected. Returns the node element as a parameter.
133
84
  */
134
- selectedtextchanged: EventEmitter<string>;
85
+ selectednode: EventEmitter<any>;
135
86
  /**
136
- * Output Emitter. Emit wenn ein Node selektiert wird.
87
+ * Defines that the action template is displayed independently of the selected state. If the value is 'true', the action template is displayed for every element.
137
88
  */
138
- selecteditem: EventEmitter<string>;
89
+ showactionalways: any;
139
90
  /**
140
- * A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive.
141
- * Define an ngOnInit() method to handle any additional initialization tasks.
91
+ * Custom template for actions per node. Template parameters are: 'node'
142
92
  */
143
- ngOnInit(): void;
93
+ templateaction: TemplateRef<any>;
144
94
  /**
145
- * Funktion setzt alle parent items recusiv zum selected node
146
- * auf collapsed = false
95
+ * Custom template for the label area per node. Template parameters are: 'node' and 'label'
147
96
  */
148
- private openSelectedNode;
97
+ templatelabel: TemplateRef<any>;
149
98
  /**
150
- * Die Methode vorbereitet die Daten für das TreeView. Die Funktion sollte geändert werden abhängig von dem kommenden Daten (wenn array)
99
+ * Resource Key für Validation Message Required bei Control
151
100
  */
152
- private LoadTree;
101
+ validationmessagerequired: string;
153
102
  /**
154
- * Die Methode collapse/expand den selectierten Node
103
+ * Resource Key für Validation Message Required in Validation Summary
155
104
  */
156
- onCollapseClick(node: any): void;
105
+ validationmessagesummaryrequired: string;
157
106
  /**
158
- * Die Methode set den selektierten Node und emit es.
107
+ * Constructor
108
+ * @param injector Service Injector
159
109
  */
160
- onClick(node: any): void;
110
+ constructor(formlayout: SacFormLayoutCommon, injector: Injector);
111
+ get iconAction(): string;
161
112
  /**
162
- * Die Methode wird ein event mit Meldung zu Parent emit-en.
113
+ * CSS icon for folders in tree there are collabsed
114
+ * @returns css class with icon
163
115
  */
164
- sendMsgToParent(msg: any): void;
116
+ get iconFolderCollabsed(): string;
165
117
  /**
166
- * Die Methode wird alle Nodes collapse
118
+ * CSS icon class for folders without subfolders
119
+ * @returns css class with icon
167
120
  */
168
- collapseAllNode(command: any): void;
121
+ get iconFolderEmpty(): string;
169
122
  /**
170
- * Funktion gibt node aus der liste zurück, welches das Value auf dem gewünschten Attribut hat
171
- * Wenn node nicht gefunden wird, wird null zurück gegeben
172
- * @param data Liste der nodes
173
- * @param searchValue Das gesuchte value
174
- * @param attr Der namen des Attributs auf dem das value gesucht wird
123
+ * CSS icon for folders in tree there are expanded
124
+ * @returns css class with icon
175
125
  */
176
- private findNode;
126
+ get iconFolderOpen(): string;
177
127
  /**
178
- * Die Methode editiert (recursive) alle eingegebene Nodes abhängig von gegebenen Attibute und Value Kriterien.
128
+ * Creates an array of a certain size. Is required for a For in the UI, as Angular does not support counting loops
129
+ * @param size Size of the array
130
+ * @returns Array
179
131
  */
180
- private _recursiveEdit;
132
+ count(size: number): Array<void>;
133
+ getChildren(node: any): any[];
134
+ getStringField(node: any, fieldname: string): any;
135
+ hasChildren(node: any): boolean;
136
+ isDisabledState(node: any): boolean;
137
+ isExpandedState(node: any): boolean;
138
+ isHoverState(node: any): boolean;
139
+ isSelectedState(node: any): boolean;
181
140
  /**
182
- * Die Methode erstellt eine standarte Sicht-Liste von Nodes
141
+ * Method is called by clicking an action
142
+ * @param action action and node
183
143
  */
184
- private _getPreparedData;
144
+ onActionClicked(action: TreeviewAction): void;
145
+ onNodeClicked(node: any): void;
146
+ setHoverState(node: any, state: boolean): void;
147
+ setSelectedState(node: any): void;
148
+ validateData(c: AbstractControl): ValidationErrors | null;
149
+ private invertExpandedState;
150
+ private resetSelectedState;
185
151
  }