@uni-design-system/uni-angular 2.0.4 → 3.0.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni-design-system/uni-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/uni-design-system/uni",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@angular/common": "^21.2.0",
|
|
17
17
|
"@angular/core": "^21.2.0",
|
|
18
18
|
"@emotion/css": "^11.0.0",
|
|
19
|
-
"@uni-design-system/uni-core": "
|
|
19
|
+
"@uni-design-system/uni-core": "3.0.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@floating-ui/dom": "^1.7.6",
|
|
@@ -1,17 +1,188 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, ElementRef, EventEmitter, OnInit, OnDestroy, TemplateRef } from '@angular/core';
|
|
2
|
+
import { Signal, WritableSignal, ElementRef, EventEmitter, OnInit, OnDestroy, TemplateRef, InjectionToken } from '@angular/core';
|
|
3
3
|
import * as _uni_design_system_uni_core from '@uni-design-system/uni-core';
|
|
4
|
-
import { Icons, UniTheme, ComponentName, ComponentTheme, NullableSize, ThemeName, TextRole, ContentColorToken,
|
|
4
|
+
import { Icons, Variant, ContainerColorToken, UniTheme, ComponentName, ComponentTheme, NullableSize, ThemeName, TextRole, ContentColorToken, Size, Thickness, NullableStyleExpression, ColorKey, Typeface, Radius, OptionalSize, Border, Shadow, ZIndexableElements, ColorToken, RadiiSize, Elevation, JustifyContent, StyleExpression, Orientation, OptionalAlignSelf, OptionalAlignItems, OptionalAlignContent, OptionalJustifyContent, OptionalDisplay, OptionalPosition, OptionalOverflow, OptionalFlexDirection, OptionalTextAlign, OptionalWrap } from '@uni-design-system/uni-core';
|
|
5
5
|
import { Placement as Placement$1, OffsetOptions } from '@floating-ui/dom';
|
|
6
6
|
|
|
7
|
+
type SortDirection = 'asc' | 'desc' | 'indet';
|
|
8
|
+
interface Sort<T> {
|
|
9
|
+
column?: keyof T;
|
|
10
|
+
direction: SortDirection;
|
|
11
|
+
}
|
|
12
|
+
declare abstract class UniBaseDatasource<T> {
|
|
13
|
+
abstract records: Signal<T[]>;
|
|
14
|
+
abstract recordCount: Signal<number>;
|
|
15
|
+
selections: WritableSignal<T[]>;
|
|
16
|
+
sort: WritableSignal<Sort<T>>;
|
|
17
|
+
sortColumn: Signal<keyof T>;
|
|
18
|
+
sortDirection: Signal<SortDirection>;
|
|
19
|
+
abstract pageIndex: Signal<number>;
|
|
20
|
+
abstract pageSize: Signal<number>;
|
|
21
|
+
abstract pageCount: Signal<number>;
|
|
22
|
+
pages: Signal<number[]>;
|
|
23
|
+
startIndex: Signal<number>;
|
|
24
|
+
endIndex: Signal<number>;
|
|
25
|
+
disablePrevious: Signal<boolean>;
|
|
26
|
+
disableNext: Signal<boolean>;
|
|
27
|
+
truncatedPages: Signal<(string | number)[]>;
|
|
28
|
+
isSelected(row: T): boolean;
|
|
29
|
+
toggleSelection(row: T): void;
|
|
30
|
+
clearSelections(): void;
|
|
31
|
+
selectAll(): void;
|
|
32
|
+
abstract sortRecords(sort: Sort<T>): void;
|
|
33
|
+
abstract firstPage(): void;
|
|
34
|
+
abstract nextPage(): void;
|
|
35
|
+
abstract previousPage(): void;
|
|
36
|
+
abstract lastPage(): void;
|
|
37
|
+
abstract jumpToPage(page: number): void;
|
|
38
|
+
abstract setPageSize(size: number): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
declare class UniRecordDatasource<T> extends UniBaseDatasource<T> {
|
|
42
|
+
private _pageNumber;
|
|
43
|
+
private _pageSize;
|
|
44
|
+
initialRecords: _angular_core.WritableSignal<T[]>;
|
|
45
|
+
recordCount: _angular_core.Signal<number>;
|
|
46
|
+
filter: _angular_core.WritableSignal<(value: T) => boolean>;
|
|
47
|
+
pageIndex: _angular_core.WritableSignal<number>;
|
|
48
|
+
pageSize: _angular_core.Signal<number>;
|
|
49
|
+
pageCount: _angular_core.Signal<number>;
|
|
50
|
+
records: _angular_core.Signal<T[]>;
|
|
51
|
+
constructor(data: T[]);
|
|
52
|
+
sortRecords(sort: Sort<T>): void;
|
|
53
|
+
firstPage(): void;
|
|
54
|
+
nextPage(): void;
|
|
55
|
+
previousPage(): void;
|
|
56
|
+
lastPage(): void;
|
|
57
|
+
jumpToPage(page: number): void;
|
|
58
|
+
setPageSize(size: number): void;
|
|
59
|
+
setFilter(filter: (value: T) => boolean): void;
|
|
60
|
+
clearFilter(): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface PageRequest {
|
|
64
|
+
pageNumber: number;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
sortColumn?: string;
|
|
67
|
+
sortDirection?: SortDirection;
|
|
68
|
+
filter?: Record<string, any>;
|
|
69
|
+
}
|
|
70
|
+
interface PageResponse<T> {
|
|
71
|
+
data: T[];
|
|
72
|
+
totalRecords: number;
|
|
73
|
+
pageNumber: number;
|
|
74
|
+
pageSize: number;
|
|
75
|
+
}
|
|
76
|
+
type DataLoader<T> = (request: PageRequest) => Promise<PageResponse<T>>;
|
|
77
|
+
declare class UniServerSideDatasource<T> extends UniBaseDatasource<T> {
|
|
78
|
+
private dataLoader;
|
|
79
|
+
private _pageNumber;
|
|
80
|
+
private _pageSize;
|
|
81
|
+
private _sortColumn;
|
|
82
|
+
private _sortDirection;
|
|
83
|
+
private filter;
|
|
84
|
+
sortColumn: _angular_core.Signal<keyof T>;
|
|
85
|
+
sortDirection: _angular_core.Signal<SortDirection>;
|
|
86
|
+
private totalRecords;
|
|
87
|
+
private dataResource;
|
|
88
|
+
pageIndex: _angular_core.Signal<number>;
|
|
89
|
+
pageSize: _angular_core.Signal<number>;
|
|
90
|
+
pageCount: _angular_core.Signal<number>;
|
|
91
|
+
private readonly _records;
|
|
92
|
+
records: _angular_core.Signal<T[]>;
|
|
93
|
+
recordCount: _angular_core.Signal<number>;
|
|
94
|
+
isLoading: _angular_core.Signal<boolean>;
|
|
95
|
+
error: _angular_core.Signal<Error>;
|
|
96
|
+
hasError: _angular_core.Signal<boolean>;
|
|
97
|
+
constructor(dataLoader: DataLoader<T>, initialPageSize?: number);
|
|
98
|
+
sortRecords(sort: Sort<T>): void;
|
|
99
|
+
firstPage(): void;
|
|
100
|
+
nextPage(): void;
|
|
101
|
+
previousPage(): void;
|
|
102
|
+
lastPage(): void;
|
|
103
|
+
jumpToPage(page: number): void;
|
|
104
|
+
setPageSize(size: number): void;
|
|
105
|
+
setFilter(filterValues: Record<string, any>): void;
|
|
106
|
+
clearFilter(): void;
|
|
107
|
+
refresh(): void;
|
|
108
|
+
getPageRequest(): PageRequest;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
type UniDatasource<T> = UniBaseDatasource<T>;
|
|
112
|
+
|
|
113
|
+
declare class LocalStorageService {
|
|
114
|
+
private isLocalStorageAvailable;
|
|
115
|
+
setItem<T>(key: string, value: T): boolean;
|
|
116
|
+
getItem<T>(key: string): T | null;
|
|
117
|
+
removeItem(key: string): boolean;
|
|
118
|
+
clear(): boolean;
|
|
119
|
+
hasKey(key: string): boolean;
|
|
120
|
+
getAllKeys(): string[];
|
|
121
|
+
getSize(): number;
|
|
122
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<LocalStorageService, never>;
|
|
123
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<LocalStorageService>;
|
|
124
|
+
}
|
|
125
|
+
|
|
7
126
|
type IconName = keyof Icons;
|
|
8
127
|
|
|
128
|
+
interface Alert {
|
|
129
|
+
message: string;
|
|
130
|
+
iconName?: IconName;
|
|
131
|
+
symbolName?: string;
|
|
132
|
+
variant?: Variant;
|
|
133
|
+
action?: () => void;
|
|
134
|
+
actionLabel?: string;
|
|
135
|
+
topPosition?: number;
|
|
136
|
+
}
|
|
137
|
+
interface Snackbar {
|
|
138
|
+
message: string;
|
|
139
|
+
action?: () => void;
|
|
140
|
+
actionLabel?: string;
|
|
141
|
+
iconName?: IconName;
|
|
142
|
+
symbolName?: string;
|
|
143
|
+
variant?: Variant;
|
|
144
|
+
timeout?: number | string | 'disabled';
|
|
145
|
+
}
|
|
146
|
+
interface Confirmation {
|
|
147
|
+
title: string;
|
|
148
|
+
message: string;
|
|
149
|
+
action: () => void;
|
|
150
|
+
actionLabel?: string;
|
|
151
|
+
dismissLabel?: string;
|
|
152
|
+
color?: ContainerColorToken;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare class NotificationService {
|
|
156
|
+
alert: _angular_core.WritableSignal<Alert>;
|
|
157
|
+
showAlert: (alert: Alert) => void;
|
|
158
|
+
hideAlert: () => void;
|
|
159
|
+
snackbar: _angular_core.WritableSignal<Snackbar>;
|
|
160
|
+
showSnackbar: (snackbar: Snackbar) => void;
|
|
161
|
+
hideSnackbar: () => void;
|
|
162
|
+
confirmation: _angular_core.WritableSignal<Confirmation>;
|
|
163
|
+
showConfirmation: (confirmation: Confirmation) => void;
|
|
164
|
+
hideConfirmation: () => void;
|
|
165
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NotificationService, never>;
|
|
166
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NotificationService>;
|
|
167
|
+
}
|
|
168
|
+
|
|
9
169
|
interface Option<T = unknown> {
|
|
10
170
|
label: string;
|
|
11
171
|
value: T;
|
|
12
172
|
}
|
|
13
173
|
type Options<T = unknown> = Option<T>[];
|
|
14
174
|
|
|
175
|
+
declare function useTimer(): {
|
|
176
|
+
start: (durationMs: number, onComplete?: () => void) => void;
|
|
177
|
+
pause: () => void;
|
|
178
|
+
resume: () => void;
|
|
179
|
+
stop: () => void;
|
|
180
|
+
msRemaining: _angular_core.WritableSignal<number>;
|
|
181
|
+
isPaused: _angular_core.WritableSignal<boolean>;
|
|
182
|
+
isActive: _angular_core.Signal<boolean>;
|
|
183
|
+
secondsRemaining: _angular_core.Signal<number>;
|
|
184
|
+
};
|
|
185
|
+
|
|
15
186
|
declare class ThemeService {
|
|
16
187
|
private themes;
|
|
17
188
|
private localStorage;
|
|
@@ -479,5 +650,7 @@ declare class UniTooltipComponent extends BaseComponent<UniTooltipOptions> imple
|
|
|
479
650
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniTooltipComponent, "uni-tooltip, Tooltip", never, { "hoverDelay": { "alias": "hoverDelay"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "inlineText": { "alias": "inlineText"; "required": false; "isSignal": true; }; "appendToBody": { "alias": "appendToBody"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
480
651
|
}
|
|
481
652
|
|
|
482
|
-
|
|
483
|
-
|
|
653
|
+
declare const UNI_THEMES: InjectionToken<Record<string, UniTheme>>;
|
|
654
|
+
|
|
655
|
+
export { LocalStorageService, NotificationService, RippleDirective, ThemeService, UNI_THEMES, UniBadgeComponent, UniBaseDatasource, UniBoxComponent, UniButtonComponent, UniCardComponent, UniCardContentComponent, UniCardHeaderComponent, UniCenterComponent, UniDialogButtonsComponent, UniDialogComponent, UniDialogHeaderComponent, UniDividerComponent, UniDropdownComponent, UniGridAreaComponent, UniGridComponent, UniIconComponent, UniMenuComponent, UniRecordDatasource, UniRowComponent, UniServerSideDatasource, UniStackComponent, UniSymbolComponent, UniTextComponent, UniTooltipComponent, UniWrapComponent, useTimer };
|
|
656
|
+
export type { Alert, Confirmation, DataLoader, MenuItem, MenuItemWithLabel, MenuItemWithTemplate, Option, Options, PageRequest, PageResponse, Snackbar, Sort, SortDirection, UniDatasource };
|