@alauda/ui 6.3.1-beta.2 → 6.3.1-beta.22
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 +5 -8
- 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/base-select.mjs +1 -1
- package/esm2020/select/multi-select/multi-select.component.mjs +49 -32
- package/esm2020/select/option/option.component.mjs +4 -1
- package/esm2020/select/select.component.mjs +10 -10
- package/esm2020/select/select.types.mjs +1 -1
- 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 +162 -156
- package/fesm2015/alauda-ui.mjs.map +1 -1
- package/fesm2020/alauda-ui.mjs +162 -156
- 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/base-select.d.ts +1 -1
- package/select/multi-select/multi-select.component.d.ts +4 -3
- package/select/option/option.component.d.ts +4 -2
- package/select/select.component.d.ts +1 -1
- package/select/select.types.d.ts +1 -0
- package/switch/switch.component.d.ts +0 -1
- package/theme/_mixin.scss +22 -10
- 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>;
|
package/select/base-select.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare abstract class BaseSelect<T, V = T> extends CommonFormControl<V>
|
|
|
33
33
|
hide: EventEmitter<void>;
|
|
34
34
|
protected selectRef: ElementRef<HTMLElement>;
|
|
35
35
|
protected tooltipRef: TooltipDirective;
|
|
36
|
-
protected optionListRef: ElementRef
|
|
36
|
+
protected optionListRef: ElementRef<HTMLDivElement>;
|
|
37
37
|
protected inputtingOption: OptionComponent<T>;
|
|
38
38
|
protected optionContent?: OptionContentDirective;
|
|
39
39
|
customOptions: QueryList<OptionComponent<T>>;
|
|
@@ -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>;
|
|
@@ -13,16 +13,17 @@ export declare class OptionComponent<T> {
|
|
|
13
13
|
private readonly label$$;
|
|
14
14
|
private readonly labelContext$$;
|
|
15
15
|
private readonly value$$;
|
|
16
|
+
private readonly disabled$$;
|
|
16
17
|
get label(): string | TemplateRef<unknown>;
|
|
17
18
|
set label(val: string | TemplateRef<unknown>);
|
|
18
19
|
get labelContext(): unknown;
|
|
19
20
|
set labelContext(val: unknown);
|
|
20
21
|
get value(): T;
|
|
21
22
|
set value(val: T);
|
|
22
|
-
get disabled(): boolean
|
|
23
|
+
get disabled(): boolean;
|
|
23
24
|
set disabled(val: boolean | '');
|
|
24
25
|
isMulti: boolean;
|
|
25
|
-
elRef: ElementRef
|
|
26
|
+
elRef: ElementRef<HTMLDivElement>;
|
|
26
27
|
private readonly select;
|
|
27
28
|
selected: boolean;
|
|
28
29
|
visible: boolean;
|
|
@@ -31,6 +32,7 @@ export declare class OptionComponent<T> {
|
|
|
31
32
|
value$: Observable<T>;
|
|
32
33
|
label$: Observable<string | TemplateRef<unknown>>;
|
|
33
34
|
labelContext$: Observable<unknown>;
|
|
35
|
+
disabled$: Observable<boolean>;
|
|
34
36
|
selected$: Observable<boolean>;
|
|
35
37
|
size$: Observable<ComponentSize>;
|
|
36
38
|
visible$: Observable<boolean>;
|
|
@@ -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>;
|
package/select/select.types.d.ts
CHANGED
|
@@ -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
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
@import 'base-var';
|
|
2
2
|
@import 'var';
|
|
3
3
|
|
|
4
|
-
@function theme-selector($
|
|
5
|
-
$scope: &;
|
|
6
|
-
|
|
4
|
+
@function theme-selector($theme, $scope) {
|
|
7
5
|
@if ($scope) {
|
|
8
|
-
@return selector-nest($
|
|
6
|
+
@return selector-nest($theme, $scope);
|
|
9
7
|
} @else {
|
|
10
|
-
@return $
|
|
8
|
+
@return $theme;
|
|
11
9
|
}
|
|
12
10
|
}
|
|
13
11
|
|
|
14
12
|
@mixin theme-light {
|
|
13
|
+
$scope: &;
|
|
14
|
+
|
|
15
15
|
@at-root {
|
|
16
|
-
#{theme-selector(':root')} {
|
|
16
|
+
#{theme-selector(':root', $scope)} {
|
|
17
17
|
@content;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
#{theme-selector('html[aui-theme-mode=light]')} {
|
|
20
|
+
#{theme-selector('html[aui-theme-mode=light]', $scope)} {
|
|
21
21
|
@content;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
@mixin theme-dark {
|
|
27
|
+
$scope: &;
|
|
28
|
+
|
|
27
29
|
@at-root {
|
|
28
30
|
@media (prefers-color-scheme: dark) {
|
|
29
|
-
#{theme-selector('html[aui-theme-mode=system]')} {
|
|
31
|
+
#{theme-selector('html[aui-theme-mode=system]', $scope)} {
|
|
30
32
|
@content;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
#{theme-selector('html[aui-theme-mode=dark]')} {
|
|
36
|
+
#{theme-selector('html[aui-theme-mode=dark]', $scope)} {
|
|
35
37
|
@content;
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -92,6 +94,15 @@
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
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
|
+
|
|
95
106
|
@mixin transition($target: all) {
|
|
96
107
|
transition: $target $animation-duration $animation-interpolation;
|
|
97
108
|
}
|
|
@@ -104,13 +115,14 @@
|
|
|
104
115
|
transform: translate(-50%, -50%);
|
|
105
116
|
}
|
|
106
117
|
|
|
107
|
-
@mixin scroll-bar($color: rgba(
|
|
118
|
+
@mixin scroll-bar($color: #{use-rgba(n-1, 0.2)}) {
|
|
108
119
|
&::-webkit-scrollbar {
|
|
109
120
|
width: 4px;
|
|
110
121
|
height: 4px;
|
|
111
122
|
}
|
|
112
123
|
|
|
113
124
|
&::-webkit-scrollbar-thumb {
|
|
125
|
+
border-radius: 2px;
|
|
114
126
|
background-color: $color;
|
|
115
127
|
}
|
|
116
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;
|