@acrodata/gui 0.1.0 → 0.2.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.
@@ -7,6 +7,7 @@
7
7
  display: inline-flex;
8
8
  flex: 1;
9
9
  flex-wrap: wrap;
10
+ align-items: center;
10
11
 
11
12
  >.mat-mdc-form-field {
12
13
  flex: 1;
@@ -1,6 +1,7 @@
1
1
  import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
3
  import { GuiFileUploaderConfig } from './file-uploader-config';
4
+ import { GuiControl } from '../interface';
4
5
  import * as i0 from "@angular/core";
5
6
  export type FileUploadType = 'image' | 'video' | 'audio' | '*';
6
7
  export interface FileUploadContent {
@@ -12,10 +13,11 @@ export declare class GuiFileUploader implements ControlValueAccessor, OnChanges
12
13
  private fileUploaderCfg;
13
14
  private cdr;
14
15
  fileInput: ElementRef<HTMLInputElement>;
16
+ config: Partial<GuiControl>;
17
+ disabled: boolean;
15
18
  type: FileUploadType;
16
19
  name: string;
17
20
  accept: string;
18
- disabled: boolean;
19
21
  fileChange: EventEmitter<string>;
20
22
  url: string;
21
23
  file: FileUploadContent;
@@ -33,5 +35,5 @@ export declare class GuiFileUploader implements ControlValueAccessor, OnChanges
33
35
  onBlur(): void;
34
36
  onClear(): void;
35
37
  static ɵfac: i0.ɵɵFactoryDeclaration<GuiFileUploader, never>;
36
- static ɵcmp: i0.ɵɵComponentDeclaration<GuiFileUploader, "gui-file-uploader", never, { "type": { "alias": "type"; "required": false; }; "name": { "alias": "name"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "fileChange": "fileChange"; }, never, never, false, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<GuiFileUploader, "gui-file-uploader", never, { "config": { "alias": "config"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "type": { "alias": "type"; "required": false; }; "name": { "alias": "name"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; }, { "fileChange": "fileChange"; }, never, never, false, never>;
37
39
  }
@@ -36,8 +36,13 @@
36
36
  left: 0;
37
37
  width: 100%;
38
38
  height: 100%;
39
- text-indent: 9999px;
39
+ opacity: 0;
40
40
  cursor: pointer;
41
41
  }
42
+
43
+ .mat-icon svg {
44
+ width: 24px;
45
+ height: 24px;
46
+ }
42
47
  }
43
48
  }
package/fill/fill.scss CHANGED
@@ -1,14 +1,11 @@
1
- // 预览颜色块
2
1
  .gui-color-block,
3
2
  .gui-color-block-empty {
4
3
  position: relative;
5
4
  display: block;
6
- width: 18px;
7
- height: 18px;
8
- border: 1px solid #000;
5
+ width: 24px;
6
+ height: 24px;
9
7
  }
10
8
 
11
- // 透明颜色棋盘格效果
12
9
  .gui-color-block-empty {
13
10
  position: absolute;
14
11
  background-color: #fff;
@@ -21,10 +18,11 @@
21
18
  background-size: 8px 8px;
22
19
  }
23
20
 
24
- // 解决垂直居中问题
21
+ // fix icon vertical align
25
22
  .gui-fill {
26
- .gui-colorpicker-toggle {
27
- display: flex;
28
- color: #fff;
23
+ .mat-mdc-icon-button {
24
+ display: inline-flex;
25
+ justify-content: center;
26
+ align-items: center;
29
27
  }
30
28
  }
package/gui-form.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
1
+ import { ChangeDetectorRef, 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';
@@ -17,6 +17,10 @@ export declare class GuiForm implements OnChanges, OnInit, OnDestroy {
17
17
  * The model to be represented by the form.
18
18
  */
19
19
  model: any;
20
+ /**
21
+ * Fired on model value change
22
+ */
23
+ modelChange: EventEmitter<any>;
20
24
  formFields: GuiControl[];
21
25
  formSubscription: Subscription;
22
26
  constructor(cdr: ChangeDetectorRef);
@@ -65,5 +69,5 @@ export declare class GuiForm implements OnChanges, OnInit, OnDestroy {
65
69
  */
66
70
  changeTabsMode(e: MouseEvent, tabs: GuiControl, mode?: GuiTabsMode): void;
67
71
  static ɵfac: i0.ɵɵFactoryDeclaration<GuiForm, never>;
68
- static ɵcmp: i0.ɵɵComponentDeclaration<GuiForm, "gui-form", never, { "form": { "alias": "form"; "required": false; }; "config": { "alias": "config"; "required": false; }; "model": { "alias": "model"; "required": false; }; }, {}, never, never, false, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<GuiForm, "gui-form", never, { "form": { "alias": "form"; "required": false; }; "config": { "alias": "config"; "required": false; }; "model": { "alias": "model"; "required": false; }; }, { "modelChange": "modelChange"; }, never, never, false, never>;
69
73
  }
package/gui-form.scss CHANGED
@@ -2,8 +2,8 @@
2
2
  --mat-form-field-container-text-size: 12px;
3
3
  --mat-expansion-header-text-size: 12px;
4
4
  --mat-expansion-container-text-size: 12px;
5
- --mat-expansion-header-collapsed-state-height: 40px;
6
- --mat-expansion-header-expanded-state-height: 40px;
5
+ --mat-expansion-header-collapsed-state-height: 32px;
6
+ --mat-expansion-header-expanded-state-height: 32px;
7
7
 
8
8
  position: relative;
9
9
  font-size: 12px;
@@ -74,6 +74,10 @@
74
74
  position: relative;
75
75
  padding: 0 8px;
76
76
  border-radius: var(--mdc-filled-text-field-container-shape);
77
+
78
+ [dir="rtl"] & {
79
+ padding: 0 8px;
80
+ }
77
81
  }
78
82
 
79
83
  .mat-mdc-form-field-infix {
@@ -108,3 +112,31 @@
108
112
  content: '';
109
113
  }
110
114
  }
115
+
116
+ .gui-menu {
117
+ .mat-mdc-tab-header {
118
+ --mdc-tab-indicator-active-indicator-shape: 4px;
119
+
120
+ padding: 4px;
121
+ background-color: var(--mdc-filled-text-field-container-color);
122
+
123
+ .mdc-tab__ripple::before {
124
+ border-radius: var(--mdc-tab-indicator-active-indicator-shape);
125
+ }
126
+ }
127
+
128
+ .mat-mdc-tab-labels {
129
+ gap: 4px;
130
+ }
131
+
132
+ .mdc-tab-indicator .mdc-tab-indicator__content {
133
+ height: 100%;
134
+ border-width: 0;
135
+ border-radius: var(--mdc-tab-indicator-active-indicator-shape);
136
+ background-color: var(--mdc-tab-indicator-active-indicator-color);
137
+ }
138
+
139
+ .mdc-tab-indicator--active .mdc-tab-indicator__content {
140
+ opacity: .24;
141
+ }
142
+ }
@@ -1,6 +1,6 @@
1
1
  %img {
2
2
  height: 100%;
3
- width: 120px;
3
+ max-width: 120px;
4
4
  object-fit: contain;
5
5
  border-radius: 4px;
6
6
  background-color: var(--mat-option-hover-state-layer-color);
@@ -1,5 +1,9 @@
1
1
  .gui-input-number {
2
2
  .mat-mdc-text-field-wrapper {
3
3
  padding-right: 0;
4
+
5
+ [dir="rtl"] & {
6
+ padding-left: 0;
7
+ }
4
8
  }
5
9
  }
package/interface.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type GuiFieldType = 'group' | 'inline' | 'tabs' | 'tab' | 'menu' | 'menuItem' | 'text' | 'number' | 'switch' | 'select' | 'imageSelect' | 'buttonToggle' | 'slider' | 'fill' | 'image' | 'video' | 'audio' | 'file' | 'textarea' | 'hidden';
1
+ export type GuiFieldType = 'group' | 'inline' | 'tabs' | 'tab' | 'menu' | 'menuItem' | 'text' | 'number' | 'switch' | 'slider' | 'fill' | 'select' | 'buttonToggle' | 'imageSelect' | 'textarea' | 'hidden' | 'image' | 'video' | 'audio' | 'file';
2
2
  export type GuiFillMode = 'flat' | 'gradient' | 'image';
3
3
  export type GuiSliderMode = 'normal' | 'range';
4
4
  export type GuiTabsMode = 'nav' | 'list';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrodata/gui",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "A lightweight GUI library for Angular",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -14,5 +14,6 @@
14
14
  .mat-pseudo-checkbox {
15
15
  width: 16px;
16
16
  height: 16px;
17
+ border-width: 1px;
17
18
  }
18
19
  }
@@ -5,22 +5,19 @@
5
5
  --mdc-slider-inactive-track-height: 2px;
6
6
  --mdc-slider-active-track-height: 2px;
7
7
 
8
- flex: 1;
8
+ flex: 3;
9
+ min-width: auto;
9
10
  height: calc(var(--mdc-slider-handle-width) * 2);
10
11
  margin: 0 calc(var(--mdc-slider-handle-width) / 2);
11
12
 
12
13
  +.mat-mdc-form-field {
13
- width: 80px;
14
- max-width: 80px;
14
+ flex: 2;
15
15
  }
16
16
 
17
17
  &.mdc-slider--range {
18
- flex: 2;
19
-
20
18
  +.mat-mdc-form-field,
21
19
  +.mat-mdc-form-field+.mat-mdc-form-field {
22
- width: 60px;
23
- max-width: 60px;
20
+ flex: 1.5;
24
21
  }
25
22
  }
26
23
 
@@ -46,4 +43,10 @@
46
43
  appearance: none;
47
44
  }
48
45
  }
46
+
47
+ .mat-mdc-form-field-hint {
48
+ width: 100%;
49
+ padding: 0 8px;
50
+ line-height: var(--mat-form-field-subscript-text-line-height);
51
+ }
49
52
  }
@@ -5,4 +5,8 @@
5
5
  --mdc-switch-handle-height: 14px;
6
6
  --mdc-switch-state-layer-size: 24px;
7
7
  }
8
+
9
+ .mat-mdc-slide-toggle {
10
+ line-height: 1;
11
+ }
8
12
  }