@acrodata/gui 0.3.1 → 0.4.0

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/gui-form.d.ts CHANGED
@@ -1,10 +1,9 @@
1
- import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
1
+ import { EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { FormArray, FormGroup } from '@angular/forms';
3
3
  import { Subscription } from 'rxjs';
4
4
  import { GuiControl, GuiFieldType, GuiFields, GuiTabsMode } from './interface';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class GuiForm implements OnChanges, OnInit, OnDestroy {
7
- private cdr;
8
7
  /**
9
8
  * The form instance which allow to track model value and validation status.
10
9
  */
@@ -24,7 +23,6 @@ export declare class GuiForm implements OnChanges, OnInit, OnDestroy {
24
23
  formFields: GuiControl[];
25
24
  formSubscription: Subscription;
26
25
  controlSubscriptions: Subscription[];
27
- constructor(cdr: ChangeDetectorRef);
28
26
  ngOnChanges(changes: SimpleChanges): void;
29
27
  ngOnInit(): void;
30
28
  ngOnDestroy(): void;
@@ -36,31 +34,28 @@ export declare class GuiForm implements OnChanges, OnInit, OnDestroy {
36
34
  * @param model The value of the form control
37
35
  * @param defaultValue The default value of the form field
38
36
  * @param parentType The type of the form field parent
39
- * @param options The reactive form options
40
37
  * @returns
41
38
  */
42
- getFormFieldArray(form: FormGroup | FormArray, config?: GuiFields | GuiControl[], model?: Record<string, any>, defaultValue?: any, parentType?: GuiFieldType, options?: {
43
- onlySelf?: boolean;
44
- emitEvent?: boolean;
45
- }): GuiControl[];
39
+ getFormFieldArray(form: FormGroup | FormArray, config?: GuiFields | GuiControl[], model?: Record<string, any>, defaultValue?: any, parentType?: GuiFieldType): GuiControl[];
46
40
  /**
47
41
  * Add a tab item.
48
42
  *
49
- * @param e The mouse event
50
- * @param form The reactive form instance
51
- * @param tabs The config of the tabs field
52
- * @param index The index of the tabs array
43
+ * @param e The mouse event
44
+ * @param formArray The reactive form instance
45
+ * @param tabs The config of the tabs field
46
+ * @param copy Whether to copy the current tab
47
+ * @param index The index of the tabs array
53
48
  */
54
- addTab(e: MouseEvent, form: FormArray, tabs: GuiControl, index?: number): void;
49
+ addTab(e: MouseEvent, formArray: FormArray, tabs: GuiControl, copy?: boolean, index?: number): void;
55
50
  /**
56
51
  * Remove a tab item.
57
52
  *
58
- * @param e The mouse event
59
- * @param form The reactive form instance
60
- * @param tabs The config of the tabs field
61
- * @param index The index of the tabs array
53
+ * @param e The mouse event
54
+ * @param formArray The reactive form instance
55
+ * @param tabs The config of the tabs field
56
+ * @param index The index of the tabs array
62
57
  */
63
- removeTab(e: MouseEvent, form: FormArray, tabs: GuiControl, index?: number): void;
58
+ removeTab(e: MouseEvent, formArray: FormArray, tabs: GuiControl, index?: number): void;
64
59
  /**
65
60
  * Change the display mode of tabs.
66
61
  *
package/gui-form.scss CHANGED
@@ -28,6 +28,9 @@
28
28
 
29
29
  gui-field-label {
30
30
  flex: 1;
31
+ overflow: hidden;
32
+ white-space: nowrap;
33
+ text-overflow: ellipsis;
31
34
  }
32
35
  }
33
36
  }
@@ -104,10 +107,6 @@
104
107
  padding: 0 12px;
105
108
  line-height: 24px;
106
109
 
107
- .gui-list-item-title {
108
- flex: 1;
109
- }
110
-
111
110
  &::before {
112
111
  position: absolute;
113
112
  left: 0;
@@ -118,6 +117,15 @@
118
117
  }
119
118
  }
120
119
 
120
+ .gui-list-item-title {
121
+ flex: 1;
122
+ cursor: pointer;
123
+
124
+ .gui-list-item-active & {
125
+ font-weight: bold;
126
+ }
127
+ }
128
+
121
129
  .gui-menu {
122
130
  .mat-mdc-tab-header {
123
131
  --mdc-tab-indicator-active-indicator-shape: 4px;
package/interface.d.ts CHANGED
@@ -55,6 +55,7 @@ export interface GuiControl extends GuiField {
55
55
  index?: number;
56
56
  children?: GuiControl[];
57
57
  template?: Partial<GuiControl>;
58
+ selectedIndex?: number;
58
59
  }
59
60
  export interface GuiControls {
60
61
  [key: string]: GuiControl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrodata/gui",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "A lightweight GUI library for Angular",
5
5
  "publishConfig": {
6
6
  "access": "public"