@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.
- package/button-toggle/button-toggle.scss +7 -2
- package/button-toggle/icon.scss +3 -3
- package/esm2022/button-toggle/button-toggle.mjs +2 -2
- package/esm2022/button-toggle/icon.mjs +2 -2
- package/esm2022/field-group/field-group.mjs +2 -2
- package/esm2022/file-uploader/file-uploader.mjs +10 -7
- package/esm2022/fill/fill.mjs +2 -2
- package/esm2022/gui-form.mjs +11 -4
- package/esm2022/gui-icons.mjs +11 -1
- package/esm2022/image-select/image-select.mjs +3 -3
- package/esm2022/input-number/input-number.mjs +2 -2
- package/esm2022/interface.mjs +1 -1
- package/esm2022/select/select.mjs +2 -2
- package/esm2022/slider/slider.mjs +3 -3
- package/esm2022/switch/switch.mjs +2 -2
- package/fesm2022/acrodata-gui.mjs +46 -26
- package/fesm2022/acrodata-gui.mjs.map +1 -1
- package/field-group/field-group.scss +1 -0
- package/file-uploader/file-uploader.d.ts +4 -2
- package/file-uploader/file-uploader.scss +6 -1
- package/fill/fill.scss +7 -9
- package/gui-form.d.ts +6 -2
- package/gui-form.scss +34 -2
- package/image-select/image-select.scss +1 -1
- package/input-number/input-number.scss +4 -0
- package/interface.d.ts +1 -1
- package/package.json +1 -1
- package/select/select.scss +1 -0
- package/slider/slider.scss +10 -7
- package/switch/switch.scss +4 -0
|
@@ -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, { "
|
|
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
|
}
|
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:
|
|
7
|
-
height:
|
|
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
|
-
.
|
|
27
|
-
display: flex;
|
|
28
|
-
|
|
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:
|
|
6
|
-
--mat-expansion-header-expanded-state-height:
|
|
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
|
+
}
|
package/interface.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type GuiFieldType = 'group' | 'inline' | 'tabs' | 'tab' | 'menu' | 'menuItem' | 'text' | 'number' | 'switch' | '
|
|
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
package/select/select.scss
CHANGED
package/slider/slider.scss
CHANGED
|
@@ -5,22 +5,19 @@
|
|
|
5
5
|
--mdc-slider-inactive-track-height: 2px;
|
|
6
6
|
--mdc-slider-active-track-height: 2px;
|
|
7
7
|
|
|
8
|
-
flex:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
}
|