@acrodata/gui 0.3.1 → 0.4.1

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/fill/fill.scss CHANGED
@@ -29,7 +29,7 @@
29
29
  opacity: .12;
30
30
  content: '';
31
31
 
32
- [dir="rtl"] & {
32
+ [dir='rtl'] & {
33
33
  border-radius: 0;
34
34
  border-top-right-radius: var(--mdc-filled-text-field-container-shape);
35
35
  border-bottom-right-radius: var(--mdc-filled-text-field-container-shape);
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
@@ -26,8 +26,16 @@
26
26
  align-items: center;
27
27
  padding-right: 8px;
28
28
 
29
+ [dir='rtl'] & {
30
+ padding-right: 0;
31
+ padding-left: 8px;
32
+ }
33
+
29
34
  gui-field-label {
30
35
  flex: 1;
36
+ overflow: hidden;
37
+ white-space: nowrap;
38
+ text-overflow: ellipsis;
31
39
  }
32
40
  }
33
41
  }
@@ -80,7 +88,7 @@
80
88
  padding: 0 8px;
81
89
  border-radius: var(--mdc-filled-text-field-container-shape);
82
90
 
83
- [dir="rtl"] & {
91
+ [dir='rtl'] & {
84
92
  padding: 0 8px;
85
93
  }
86
94
  }
@@ -104,10 +112,6 @@
104
112
  padding: 0 12px;
105
113
  line-height: 24px;
106
114
 
107
- .gui-list-item-title {
108
- flex: 1;
109
- }
110
-
111
115
  &::before {
112
116
  position: absolute;
113
117
  left: 0;
@@ -115,6 +119,20 @@
115
119
  height: 16px;
116
120
  background-color: var(--mat-expansion-header-text-color);
117
121
  content: '';
122
+
123
+ [dir='rtl'] & {
124
+ left: auto;
125
+ right: 0;
126
+ }
127
+ }
128
+ }
129
+
130
+ .gui-list-item-title {
131
+ flex: 1;
132
+ cursor: pointer;
133
+
134
+ .gui-list-item-active & {
135
+ font-weight: bold;
118
136
  }
119
137
  }
120
138
 
@@ -2,7 +2,7 @@
2
2
  .mat-mdc-text-field-wrapper {
3
3
  padding-right: 0;
4
4
 
5
- [dir="rtl"] & {
5
+ [dir='rtl'] & {
6
6
  padding-left: 0;
7
7
  }
8
8
  }
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.1",
4
4
  "description": "A lightweight GUI library for Angular",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -4,10 +4,15 @@
4
4
 
5
5
  .mat-mdc-option {
6
6
  min-height: var(--mat-option-label-text-line-height);
7
- padding: 0 8px;
7
+ padding: 0 8px !important;
8
8
 
9
9
  .mat-pseudo-checkbox-full {
10
10
  margin-right: 8px;
11
+
12
+ [dir='rtl'] & {
13
+ margin-right: 0;
14
+ margin-left: 8px;
15
+ }
11
16
  }
12
17
  }
13
18
 
@@ -38,6 +38,11 @@
38
38
  .mat-mdc-form-field {
39
39
  margin-left: 6px;
40
40
 
41
+ [dir='rtl'] & {
42
+ margin-left: 0;
43
+ margin-right: 6px;
44
+ }
45
+
41
46
  input::-webkit-outer-spin-button,
42
47
  input::-webkit-inner-spin-button {
43
48
  appearance: none;