@alauda/ui 6.3.1-beta.7 → 6.3.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/checkbox/checkbox-group/checkbox-group.component.d.ts +0 -1
- package/checkbox/checkbox.component.d.ts +0 -1
- package/color-picker/color-picker.component.d.ts +0 -1
- package/esm2020/autocomplete/autocomplete.component.mjs +2 -2
- package/esm2020/checkbox/checkbox-group/checkbox-group.component.mjs +3 -6
- package/esm2020/checkbox/checkbox.component.mjs +13 -15
- package/esm2020/color-picker/color-picker.component.mjs +4 -8
- package/esm2020/date-picker/calendar/date-picker-panel/component.mjs +3 -3
- package/esm2020/date-picker/calendar/range-picker-panel/component.mjs +3 -3
- package/esm2020/date-picker/calendar/util.mjs +5 -2
- package/esm2020/date-picker/date-picker/date-picker.component.mjs +4 -4
- package/esm2020/date-picker/range-picker/range-picker.component.mjs +4 -4
- package/esm2020/dialog/dialog.component.mjs +2 -2
- package/esm2020/drawer/component/drawer.component.mjs +2 -2
- package/esm2020/form/common-form.mjs +15 -15
- package/esm2020/input/number-input/number-input.component.mjs +8 -8
- package/esm2020/input/tags-input/tags-input.component.mjs +16 -21
- package/esm2020/notification/notification.component.mjs +3 -3
- package/esm2020/radio/base-radio.mjs +2 -2
- package/esm2020/radio/radio-group/radio-group.component.mjs +2 -5
- package/esm2020/select/multi-select/multi-select.component.mjs +33 -30
- package/esm2020/select/select.component.mjs +9 -9
- package/esm2020/switch/switch.component.mjs +4 -7
- package/esm2020/table/table.component.mjs +2 -2
- package/esm2020/time-picker/component.mjs +2 -2
- package/esm2020/time-picker/panel/panel.component.mjs +8 -8
- package/esm2020/time-picker/time-picker.type.mjs +3 -3
- package/esm2020/tree-select/tree-select.component.mjs +9 -9
- package/fesm2015/alauda-ui.mjs +140 -151
- package/fesm2015/alauda-ui.mjs.map +1 -1
- package/fesm2020/alauda-ui.mjs +140 -151
- package/fesm2020/alauda-ui.mjs.map +1 -1
- package/form/common-form.d.ts +13 -16
- package/input/number-input/number-input.component.d.ts +1 -1
- package/input/tags-input/tags-input.component.d.ts +2 -6
- package/package.json +1 -1
- package/radio/radio-group/radio-group.component.d.ts +0 -1
- package/select/multi-select/multi-select.component.d.ts +4 -3
- package/select/select.component.d.ts +1 -1
- package/switch/switch.component.d.ts +0 -1
- package/theme/_mixin.scss +11 -1
- package/theme/style.css +5 -1
- package/tree-select/tree-select.component.d.ts +1 -1
package/form/common-form.d.ts
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
1
|
import { ChangeDetectorRef, EventEmitter } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
|
-
import {
|
|
3
|
+
import { ReplaySubject } from 'rxjs';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
/**
|
|
6
6
|
* form control 内部不保持 value 属性,当不使用 ngModel 时可以通过 [(value)] 实现双向绑定;
|
|
7
7
|
* 也可以分别传入 value 和 监听 valueChange 事件以实现阻断用户操作的功能。
|
|
8
8
|
*/
|
|
9
|
-
export declare class CommonFormControl<
|
|
9
|
+
export declare class CommonFormControl<V, M = V> implements ControlValueAccessor {
|
|
10
10
|
protected cdr: ChangeDetectorRef;
|
|
11
11
|
get disabled(): boolean | '';
|
|
12
12
|
set disabled(val: boolean | '');
|
|
13
13
|
get readonly(): boolean | "";
|
|
14
14
|
set readonly(val: boolean | "");
|
|
15
|
-
get propValue():
|
|
16
|
-
set propValue(val:
|
|
17
|
-
valueChange: EventEmitter<
|
|
18
|
-
protected onChange: (_:
|
|
15
|
+
get propValue(): V;
|
|
16
|
+
set propValue(val: V);
|
|
17
|
+
valueChange: EventEmitter<V>;
|
|
18
|
+
protected onChange: (_: V) => void;
|
|
19
19
|
protected onTouched: () => void;
|
|
20
|
-
protected value$$: ReplaySubject<V>;
|
|
21
20
|
private _propValue;
|
|
22
21
|
private _disabled;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
value$: Observable<V>;
|
|
22
|
+
model: M;
|
|
23
|
+
model$: ReplaySubject<M>;
|
|
27
24
|
constructor(cdr: ChangeDetectorRef);
|
|
28
|
-
registerOnChange(fn: (_:
|
|
25
|
+
registerOnChange(fn: (_: V) => void): void;
|
|
29
26
|
registerOnTouched(fn: () => void): void;
|
|
30
27
|
setDisabledState(isDisabled: boolean): void;
|
|
31
|
-
writeValue(value:
|
|
28
|
+
writeValue(value: V): void;
|
|
29
|
+
emitModel(model: M): void;
|
|
32
30
|
emitValue(value: V): void;
|
|
33
|
-
|
|
34
|
-
protected
|
|
35
|
-
protected valueOut(v: V): T;
|
|
31
|
+
protected valueIn(value: V): M;
|
|
32
|
+
protected modelOut(model: M): V;
|
|
36
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<CommonFormControl<any, any>, never>;
|
|
37
34
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CommonFormControl<any, any>, never, never, { "disabled": "disabled"; "readonly": "readonly"; "propValue": "value"; }, { "valueChange": "valueChange"; }, never>;
|
|
38
35
|
}
|
|
@@ -17,7 +17,7 @@ export declare class NumberInputComponent extends CommonFormControl<number> impl
|
|
|
17
17
|
isFocus: boolean;
|
|
18
18
|
ngAfterViewInit(): void;
|
|
19
19
|
valueIn(v: number): number;
|
|
20
|
-
|
|
20
|
+
modelOut(value: number): number;
|
|
21
21
|
inputChanged(value: string): void;
|
|
22
22
|
takeOneStep(positive: boolean): void;
|
|
23
23
|
private parsePrecision;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, ElementRef, Injector, OnChanges, Renderer2, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { AsyncValidatorFn, FormBuilder, NgControl, ValidatorFn, FormControl } from '@angular/forms';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
3
|
import { CommonFormControl } from '../../form/public-api';
|
|
5
4
|
import { ComponentSize } from '../../types';
|
|
6
5
|
import { Bem } from '../../utils';
|
|
@@ -31,11 +30,8 @@ export declare class TagsInputComponent extends CommonFormControl<string[]> impl
|
|
|
31
30
|
get hostDisplay(): string;
|
|
32
31
|
get maxHeight(): string;
|
|
33
32
|
private readonly withMaxRowCount;
|
|
34
|
-
snapshot: {
|
|
35
|
-
value: string[];
|
|
36
|
-
};
|
|
37
|
-
value$: Observable<string[]>;
|
|
38
33
|
focused: boolean;
|
|
34
|
+
model: string[];
|
|
39
35
|
readonly inputControl: FormControl;
|
|
40
36
|
controlContainer: NgControl;
|
|
41
37
|
get rootClass(): string;
|
|
@@ -44,13 +40,13 @@ export declare class TagsInputComponent extends CommonFormControl<string[]> impl
|
|
|
44
40
|
constructor(cdr: ChangeDetectorRef, fb: FormBuilder, renderer: Renderer2, injector: Injector);
|
|
45
41
|
ngOnChanges({ inputValidator, inputAsyncValidator, disabled, }: SimpleChanges): void;
|
|
46
42
|
ngAfterViewInit(): void;
|
|
47
|
-
writeValue(val: string[]): void;
|
|
48
43
|
onRemove(index: number): void;
|
|
49
44
|
onInput(): void;
|
|
50
45
|
onKeyDown(event: KeyboardEvent): void;
|
|
51
46
|
onInputFocus(): void;
|
|
52
47
|
onInputBlur(event: Event): void;
|
|
53
48
|
trackByValue(_: number, value: string): string;
|
|
49
|
+
protected valueIn(v: string[]): string[];
|
|
54
50
|
private sortByReadonly;
|
|
55
51
|
private pushValue;
|
|
56
52
|
private syncControlStatus;
|
package/package.json
CHANGED
|
@@ -17,7 +17,6 @@ export declare class RadioGroupComponent extends CommonFormControl<any> {
|
|
|
17
17
|
size$: Observable<RadioSize>;
|
|
18
18
|
isPlain$: Observable<boolean>;
|
|
19
19
|
name$: Observable<string>;
|
|
20
|
-
writeValue(value: any): void;
|
|
21
20
|
onRadioChange(value: any): void;
|
|
22
21
|
onRadioBlur(): void;
|
|
23
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<RadioGroupComponent, never>;
|
|
@@ -15,8 +15,8 @@ export declare class MultiSelectComponent<T = unknown> extends BaseSelect<T, T[]
|
|
|
15
15
|
hasEnabledOptions$: Observable<boolean>;
|
|
16
16
|
private _allowSelectAll;
|
|
17
17
|
isMulti: boolean;
|
|
18
|
-
|
|
19
|
-
values$:
|
|
18
|
+
model: T[];
|
|
19
|
+
values$: import("rxjs").ReplaySubject<T[]>;
|
|
20
20
|
tagClassFn: TagClassFn<T>;
|
|
21
21
|
maxRowCount: number;
|
|
22
22
|
customRowHeight: number;
|
|
@@ -44,12 +44,13 @@ export declare class MultiSelectComponent<T = unknown> extends BaseSelect<T, T[]
|
|
|
44
44
|
onInputFocus(): void;
|
|
45
45
|
onInputBlur(): void;
|
|
46
46
|
onKeyDown(event: KeyboardEvent): void;
|
|
47
|
-
writeValue(val: T[]): void;
|
|
48
47
|
selectOption(option: OptionComponent<T>): void;
|
|
49
48
|
addValue(value: T): void;
|
|
50
49
|
removeValue(value: T): void;
|
|
51
50
|
clearValue(event: Event): void;
|
|
52
51
|
onSelectAllClick(): void;
|
|
52
|
+
private includes;
|
|
53
|
+
protected valueIn(v: T[]): T[];
|
|
53
54
|
private resetInput;
|
|
54
55
|
private setInputWidth;
|
|
55
56
|
static ɵfac: i0.ɵɵFactoryDeclaration<MultiSelectComponent<any>, never>;
|
|
@@ -16,7 +16,7 @@ export declare class SelectComponent<T = unknown> extends BaseSelect<T> implemen
|
|
|
16
16
|
ngAfterContentInit(): void;
|
|
17
17
|
onShowOptions(): void;
|
|
18
18
|
onHideOptions(): void;
|
|
19
|
-
|
|
19
|
+
protected valueIn(v: T): T;
|
|
20
20
|
selectOption(option: OptionComponent<T>): void;
|
|
21
21
|
clearValue(event: Event): void;
|
|
22
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectComponent<any>, never>;
|
|
@@ -4,7 +4,6 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class SwitchComponent extends CommonFormControl<boolean> {
|
|
5
5
|
bem: Bem;
|
|
6
6
|
loading: boolean;
|
|
7
|
-
writeValue(value: boolean): void;
|
|
8
7
|
onSwitch(): void;
|
|
9
8
|
onBlur(): void;
|
|
10
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<SwitchComponent, never>;
|
package/theme/_mixin.scss
CHANGED
|
@@ -94,6 +94,15 @@
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
@mixin modal-backdrop() {
|
|
98
|
+
@include theme-light {
|
|
99
|
+
background-color: use-rgba(origin-shadow, 0.4);
|
|
100
|
+
}
|
|
101
|
+
@include theme-dark {
|
|
102
|
+
background-color: use-rgba(origin-shadow, 0.75);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
97
106
|
@mixin transition($target: all) {
|
|
98
107
|
transition: $target $animation-duration $animation-interpolation;
|
|
99
108
|
}
|
|
@@ -106,13 +115,14 @@
|
|
|
106
115
|
transform: translate(-50%, -50%);
|
|
107
116
|
}
|
|
108
117
|
|
|
109
|
-
@mixin scroll-bar($color: rgba(
|
|
118
|
+
@mixin scroll-bar($color: #{use-rgba(n-1, 0.2)}) {
|
|
110
119
|
&::-webkit-scrollbar {
|
|
111
120
|
width: 4px;
|
|
112
121
|
height: 4px;
|
|
113
122
|
}
|
|
114
123
|
|
|
115
124
|
&::-webkit-scrollbar-thumb {
|
|
125
|
+
border-radius: 2px;
|
|
116
126
|
background-color: $color;
|
|
117
127
|
}
|
|
118
128
|
}
|
package/theme/style.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
******************************
|
|
16
16
|
*/
|
|
17
17
|
:root {
|
|
18
|
+
color-scheme: light;
|
|
18
19
|
--aui-color-blue: 0, 122, 245;
|
|
19
20
|
--aui-color-b-0: 0, 103, 208;
|
|
20
21
|
--aui-color-b-1: 38, 141, 246;
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
html[aui-theme-mode=light] {
|
|
73
|
+
color-scheme: light;
|
|
72
74
|
--aui-color-blue: 0, 122, 245;
|
|
73
75
|
--aui-color-b-0: 0, 103, 208;
|
|
74
76
|
--aui-color-b-1: 38, 141, 246;
|
|
@@ -124,6 +126,7 @@ html[aui-theme-mode=light] {
|
|
|
124
126
|
|
|
125
127
|
@media (prefers-color-scheme: dark) {
|
|
126
128
|
html[aui-theme-mode=system] {
|
|
129
|
+
color-scheme: dark;
|
|
127
130
|
--aui-color-blue: 61, 142, 255;
|
|
128
131
|
--aui-color-b-0: 54, 116, 204;
|
|
129
132
|
--aui-color-b-1: 109, 170, 255;
|
|
@@ -178,6 +181,7 @@ html[aui-theme-mode=light] {
|
|
|
178
181
|
}
|
|
179
182
|
}
|
|
180
183
|
html[aui-theme-mode=dark] {
|
|
184
|
+
color-scheme: dark;
|
|
181
185
|
--aui-color-blue: 61, 142, 255;
|
|
182
186
|
--aui-color-b-0: 54, 116, 204;
|
|
183
187
|
--aui-color-b-1: 109, 170, 255;
|
|
@@ -285,7 +289,7 @@ html[aui-theme-mode=dark] {
|
|
|
285
289
|
}
|
|
286
290
|
|
|
287
291
|
body {
|
|
288
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica,
|
|
292
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Ubuntu, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
|
289
293
|
font-size: 14px;
|
|
290
294
|
font-weight: 400;
|
|
291
295
|
line-height: 1.43;
|
|
@@ -56,7 +56,7 @@ export declare class TreeSelectComponent<T = unknown> extends CommonFormControl<
|
|
|
56
56
|
closeOption(): void;
|
|
57
57
|
updateSelectDisplay(value: any): void;
|
|
58
58
|
clearValue(event: Event): void;
|
|
59
|
-
|
|
59
|
+
protected valueIn(v: T): T;
|
|
60
60
|
getPlaceholder(): string;
|
|
61
61
|
getInputValue(): string;
|
|
62
62
|
trackByLabel: (_: number, node: TreeNode<T>) => string;
|