@sdcorejs/angular 21.1.3 → 21.1.4
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/README.md +17 -14
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +14 -14
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +332 -0
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-badge.mjs +1 -0
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +121 -0
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +68 -0
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +18 -23
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +6 -4
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +495 -838
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +24 -34
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs +97 -0
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +10 -20
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +61 -4
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +1438 -218
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +39 -2
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +16 -22
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +48 -4
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +96 -63
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +186 -17
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +15 -22
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +4 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +29 -41
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +7 -7
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +20 -71
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +6 -3
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +6 -3
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +16 -13
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +42 -65
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +51 -66
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +384 -0
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +7 -5
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +290 -56
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-models.mjs +155 -2
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +44 -66
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +6 -20
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +19 -64
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +6 -5
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs +277 -0
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-time.mjs +307 -0
- package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +210 -0
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms.mjs +73 -4
- package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +355 -10
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +12 -17
- package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +861 -80
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-pipes.mjs +5 -7
- package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +407 -137
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +515 -105
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +5 -7
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-docx.mjs +7 -10
- package/fesm2022/sdcorejs-angular-services-docx.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +339 -74
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-notify.mjs +7 -10
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-persistence.mjs +899 -0
- package/fesm2022/sdcorejs-angular-services-persistence.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-storage.mjs +324 -122
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-task.mjs +389 -0
- package/fesm2022/sdcorejs-angular-services-task.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +255 -0
- package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services-viewport.mjs +76 -0
- package/fesm2022/sdcorejs-angular-services-viewport.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-services.mjs +4 -0
- package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
- package/package.json +49 -1
- package/types/sdcorejs-angular-components-audit-diff.d.ts +74 -0
- package/types/sdcorejs-angular-components-badge.d.ts +1 -1
- package/types/sdcorejs-angular-components-breadcrumb.d.ts +53 -0
- package/types/sdcorejs-angular-components-data-state.d.ts +44 -0
- package/types/sdcorejs-angular-components-document-builder.d.ts +5 -5
- package/types/sdcorejs-angular-components-form-generic.d.ts +67 -104
- package/types/sdcorejs-angular-components-import-excel.d.ts +4 -14
- package/types/sdcorejs-angular-components-job-progress.d.ts +38 -0
- package/types/sdcorejs-angular-components-mini-editor.d.ts +9 -9
- package/types/sdcorejs-angular-components-modal.d.ts +7 -1
- package/types/sdcorejs-angular-components-preview.d.ts +181 -28
- package/types/sdcorejs-angular-components-side-drawer.d.ts +7 -1
- package/types/sdcorejs-angular-components-tab.d.ts +9 -2
- package/types/sdcorejs-angular-components-table.d.ts +8 -7
- package/types/sdcorejs-angular-components-tree.d.ts +24 -2
- package/types/sdcorejs-angular-components-upload-file.d.ts +5 -4
- package/types/sdcorejs-angular-components.d.ts +4 -0
- package/types/sdcorejs-angular-directives.d.ts +10 -8
- package/types/sdcorejs-angular-forms-autocomplete.d.ts +3 -4
- package/types/sdcorejs-angular-forms-checkbox.d.ts +4 -8
- package/types/sdcorejs-angular-forms-date-range.d.ts +6 -7
- package/types/sdcorejs-angular-forms-date.d.ts +2 -2
- package/types/sdcorejs-angular-forms-datetime.d.ts +2 -2
- package/types/sdcorejs-angular-forms-entity-picker.d.ts +128 -0
- package/types/sdcorejs-angular-forms-input-number.d.ts +1 -1
- package/types/sdcorejs-angular-forms-input.d.ts +74 -11
- package/types/sdcorejs-angular-forms-models.d.ts +86 -3
- package/types/sdcorejs-angular-forms-radio.d.ts +12 -8
- package/types/sdcorejs-angular-forms-switch.d.ts +4 -7
- package/types/sdcorejs-angular-forms-time-range.d.ts +98 -0
- package/types/sdcorejs-angular-forms-time.d.ts +117 -0
- package/types/sdcorejs-angular-forms-tree-select.d.ts +76 -0
- package/types/sdcorejs-angular-forms.d.ts +15 -5
- package/types/sdcorejs-angular-i18n.d.ts +68 -2
- package/types/sdcorejs-angular-interceptors.d.ts +5 -6
- package/types/sdcorejs-angular-modules-layout.d.ts +288 -15
- package/types/sdcorejs-angular-pipes.d.ts +2 -2
- package/types/sdcorejs-angular-services-api.d.ts +68 -24
- package/types/sdcorejs-angular-services-cache.d.ts +52 -16
- package/types/sdcorejs-angular-services-confirm.d.ts +3 -2
- package/types/sdcorejs-angular-services-docx.d.ts +2 -3
- package/types/sdcorejs-angular-services-loading.d.ts +16 -8
- package/types/sdcorejs-angular-services-persistence.d.ts +159 -0
- package/types/sdcorejs-angular-services-storage.d.ts +26 -8
- package/types/sdcorejs-angular-services-task.d.ts +104 -0
- package/types/sdcorejs-angular-services-unsaved-changes.d.ts +83 -0
- package/types/sdcorejs-angular-services-viewport.d.ts +42 -0
- package/types/sdcorejs-angular-services.d.ts +4 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { InjectionToken, PipeTransform } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import * as i1 from '@angular/router';
|
|
5
5
|
import { Params } from '@angular/router';
|
|
6
|
-
import { SdStorage
|
|
6
|
+
import { SdStorage } from '@sdcorejs/angular/services';
|
|
7
|
+
import { SdViewport } from '@sdcorejs/angular/services/viewport';
|
|
7
8
|
import * as _sdcorejs_angular_modules_layout from '@sdcorejs/angular/modules/layout';
|
|
8
9
|
import { MaybeAsync } from '@sdcorejs/utils/models';
|
|
9
10
|
|
|
@@ -56,18 +57,43 @@ interface SdLayoutChildrenMenu {
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
declare class SdLayoutStorageService {
|
|
59
|
-
private
|
|
60
|
-
isShowSidebar: SdStorage<boolean>;
|
|
61
|
-
menuLockStatus: SdStorage<boolean>;
|
|
62
|
-
lastActiveMenuGroupId: SdStorage<string>;
|
|
63
|
-
pinnedMenuGroup: SdStorage<SdLayoutChildrenMenu>;
|
|
64
|
-
|
|
60
|
+
#private;
|
|
61
|
+
readonly isShowSidebar: SdStorage<boolean>;
|
|
62
|
+
readonly menuLockStatus: SdStorage<boolean>;
|
|
63
|
+
readonly lastActiveMenuGroupId: SdStorage<string>;
|
|
64
|
+
readonly pinnedMenuGroup: SdStorage<SdLayoutChildrenMenu>;
|
|
65
|
+
readonly pinnedMenuKeys: SdStorage<string[]>;
|
|
66
|
+
readonly recentMenuKeys: SdStorage<string[]>;
|
|
67
|
+
readonly versionStates: SdStorage<Record<string, SdLayoutVersionState>>;
|
|
68
|
+
readPinnedMenuKeys(menus: SdLayoutMenu[]): string[];
|
|
69
|
+
writePinnedMenuKeys(keys: string[]): void;
|
|
70
|
+
readRecentMenuKeys(menus: SdLayoutMenu[], maximum?: number): string[];
|
|
71
|
+
writeRecentMenuKeys(keys: string[]): void;
|
|
72
|
+
readVersionState(version: 1 | 2 | 3): SdLayoutVersionState;
|
|
73
|
+
patchVersionState(version: 1 | 2 | 3, patch: SdLayoutVersionState): SdLayoutVersionState;
|
|
65
74
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutStorageService, never>;
|
|
66
75
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutStorageService>;
|
|
67
76
|
}
|
|
77
|
+
interface SdLayoutVersionState {
|
|
78
|
+
activeGroupKey?: string;
|
|
79
|
+
locked?: boolean;
|
|
80
|
+
collapsed?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type SdLayoutViewport = SdViewport;
|
|
84
|
+
declare const SD_LAYOUT_VIEWPORT: _angular_core.InjectionToken<SdViewport | null>;
|
|
85
|
+
/** @deprecated Prefer `SdViewportService` from `@sdcorejs/angular/services/viewport`. */
|
|
86
|
+
declare class SdLayoutResponsiveService {
|
|
87
|
+
#private;
|
|
88
|
+
readonly viewportWidth: _angular_core.Signal<number>;
|
|
89
|
+
isMobile(breakpoint: number): boolean;
|
|
90
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutResponsiveService, never>;
|
|
91
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutResponsiveService>;
|
|
92
|
+
}
|
|
68
93
|
|
|
69
94
|
interface ISdLayoutConfiguration {
|
|
70
95
|
homeUrl?: string;
|
|
96
|
+
mobileBreakpoint?: number;
|
|
71
97
|
sidebar: ISdSidebarConfiguration | (() => MaybeAsync<ISdSidebarConfiguration>);
|
|
72
98
|
userInfo: SdLayoutUserInfo | (() => MaybeAsync<SdLayoutUserInfo>);
|
|
73
99
|
signout: () => void | Promise<void>;
|
|
@@ -96,8 +122,18 @@ interface SdLayoutUserInfo {
|
|
|
96
122
|
*/
|
|
97
123
|
avatar?: string;
|
|
98
124
|
}
|
|
99
|
-
|
|
100
|
-
interface
|
|
125
|
+
declare const DEFAULT_LAYOUT_MOBILE_BREAKPOINT = 1024;
|
|
126
|
+
interface SidebarConfigurationBase {
|
|
127
|
+
brandColor?: string;
|
|
128
|
+
brandLightColor?: string;
|
|
129
|
+
logoUrl?: string;
|
|
130
|
+
defaultTitle?: string;
|
|
131
|
+
pin?: {
|
|
132
|
+
enabled?: boolean;
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
type ISdSidebarConfiguration = SidebarConfigurationV1 | SidebarConfigurationV2 | SidebarConfigurationV3;
|
|
136
|
+
interface SidebarConfigurationV1 extends SidebarConfigurationBase {
|
|
101
137
|
version: 1;
|
|
102
138
|
/**
|
|
103
139
|
* Màu brand chính.
|
|
@@ -130,12 +166,56 @@ interface SidebarConfigurationV1 {
|
|
|
130
166
|
enabled?: boolean;
|
|
131
167
|
};
|
|
132
168
|
}
|
|
169
|
+
interface SidebarConfigurationV2 extends SidebarConfigurationBase {
|
|
170
|
+
version: 2;
|
|
171
|
+
interaction?: 'click' | 'hover-lock';
|
|
172
|
+
primaryMenuIds?: string[];
|
|
173
|
+
}
|
|
174
|
+
interface SidebarConfigurationV3 extends SidebarConfigurationBase {
|
|
175
|
+
version: 3;
|
|
176
|
+
defaultCollapsed?: boolean;
|
|
177
|
+
recent?: {
|
|
178
|
+
enabled?: boolean;
|
|
179
|
+
maxItems?: number;
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
interface ResolvedSidebarRecentConfiguration {
|
|
183
|
+
enabled: boolean;
|
|
184
|
+
maxItems: number;
|
|
185
|
+
}
|
|
186
|
+
declare function normalizeLayoutMobileBreakpoint(value: number | undefined): number;
|
|
187
|
+
declare function resolveSidebarV2Interaction(sidebar: SidebarConfigurationV2): 'click' | 'hover-lock';
|
|
188
|
+
declare function resolveSidebarV3Recent(sidebar: SidebarConfigurationV3): ResolvedSidebarRecentConfiguration;
|
|
189
|
+
declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV1): SidebarConfigurationV1;
|
|
190
|
+
declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV2): SidebarConfigurationV2;
|
|
191
|
+
declare function normalizeSidebarConfiguration(_sidebar: SidebarConfigurationV3): SidebarConfigurationV3;
|
|
133
192
|
declare const SD_LAYOUT_CONFIGURATION: InjectionToken<ISdLayoutConfiguration>;
|
|
134
193
|
|
|
194
|
+
declare class SdLayoutNavigationStateService {
|
|
195
|
+
#private;
|
|
196
|
+
readonly pinnedKeys: _angular_core.WritableSignal<string[]>;
|
|
197
|
+
readonly recentKeys: _angular_core.WritableSignal<string[]>;
|
|
198
|
+
readonly pinnedMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
199
|
+
readonly recentMenus: _angular_core.Signal<(_sdcorejs_angular_modules_layout.SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
200
|
+
hydrate(menus: SdLayoutMenu[], recentMaximum?: number): void;
|
|
201
|
+
togglePinned(menu: SdLayoutMenu): void;
|
|
202
|
+
recordRecent(menu: SdLayoutMenu, configuration: ResolvedSidebarRecentConfiguration): void;
|
|
203
|
+
patchVersionState(version: 1 | 2 | 3, patch: SdLayoutVersionState): void;
|
|
204
|
+
versionState(version: 1 | 2 | 3): SdLayoutVersionState;
|
|
205
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutNavigationStateService, never>;
|
|
206
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutNavigationStateService>;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare function getMenuStableKey(menu: SdLayoutMenu | null | undefined, ancestors?: string[]): string;
|
|
210
|
+
declare function searchMenuLeaves(menus: SdLayoutMenu[], query: string): SdLayoutRootMenu[];
|
|
211
|
+
declare function selectPrimaryMenuGroups(menus: SdLayoutMenu[], requestedIds: string[] | undefined, maximum?: number): SdLayoutMenu[];
|
|
212
|
+
declare function resolveMenuKeys(menus: SdLayoutMenu[], keys: string[]): (SdLayoutRootMenu | SdLayoutChildrenMenu)[];
|
|
213
|
+
declare function flattenMenuLeaves(menus: SdLayoutMenu[]): SdLayoutRootMenu[];
|
|
214
|
+
|
|
135
215
|
declare class SdLayoutService {
|
|
136
216
|
#private;
|
|
137
217
|
userInfo: _angular_core.WritableSignal<SdLayoutUserInfo | undefined>;
|
|
138
|
-
sidebar: _angular_core.WritableSignal<
|
|
218
|
+
sidebar: _angular_core.WritableSignal<ISdSidebarConfiguration | undefined>;
|
|
139
219
|
constructor();
|
|
140
220
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutService, never>;
|
|
141
221
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdLayoutService>;
|
|
@@ -156,8 +236,12 @@ declare class SdLayoutComponent {
|
|
|
156
236
|
menusInput: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
157
237
|
menus: _angular_core.Signal<SdLayoutMenu[]>;
|
|
158
238
|
userInfo: _angular_core.WritableSignal<_sdcorejs_angular_modules_layout.SdLayoutUserInfo | undefined>;
|
|
159
|
-
sidebar: _angular_core.WritableSignal<_sdcorejs_angular_modules_layout.
|
|
160
|
-
|
|
239
|
+
sidebar: _angular_core.WritableSignal<_sdcorejs_angular_modules_layout.ISdSidebarConfiguration | undefined>;
|
|
240
|
+
sidebarV1: _angular_core.Signal<SidebarConfigurationV1 | undefined>;
|
|
241
|
+
sidebarV2: _angular_core.Signal<SidebarConfigurationV2 | undefined>;
|
|
242
|
+
sidebarV3: _angular_core.Signal<SidebarConfigurationV3 | undefined>;
|
|
243
|
+
mobileBreakpoint: number;
|
|
244
|
+
isMobile: _angular_core.Signal<boolean>;
|
|
161
245
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutComponent, never>;
|
|
162
246
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdLayoutComponent, "sd-layout", never, { "menusInput": { "alias": "menus"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
163
247
|
}
|
|
@@ -213,11 +297,200 @@ declare class SidebarMobileOverlayComponent {
|
|
|
213
297
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarMobileOverlayComponent, "sd-sidebar-mobile-overlay", never, { "isShowSidebar": { "alias": "isShowSidebar"; "required": false; "isSignal": true; }; "menus": { "alias": "menus"; "required": true; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, { "showSideBar": "showSideBar"; "expandSideBar": "expandSideBar"; "popupUserMenuOpened": "popupUserMenuOpened"; "popupUserMenuClosed": "popupUserMenuClosed"; "titleMenuGroupChanged": "titleMenuGroupChanged"; }, never, never, true, never>;
|
|
214
298
|
}
|
|
215
299
|
|
|
300
|
+
interface SdLayoutMenuTreeNode {
|
|
301
|
+
menu: SdLayoutMenu;
|
|
302
|
+
key: string;
|
|
303
|
+
title: string;
|
|
304
|
+
depth: number;
|
|
305
|
+
paddingLeft: number;
|
|
306
|
+
isGroup: boolean;
|
|
307
|
+
isActive: boolean;
|
|
308
|
+
isPinned: boolean;
|
|
309
|
+
}
|
|
310
|
+
declare class SdLayoutMenuTreeComponent {
|
|
311
|
+
#private;
|
|
312
|
+
menus: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
313
|
+
query: _angular_core.InputSignal<string>;
|
|
314
|
+
activePath: _angular_core.InputSignal<string>;
|
|
315
|
+
pinnedKeys: _angular_core.InputSignal<string[]>;
|
|
316
|
+
showPin: _angular_core.InputSignal<boolean>;
|
|
317
|
+
navigate: _angular_core.OutputEmitterRef<SdLayoutRootMenu>;
|
|
318
|
+
togglePinned: _angular_core.OutputEmitterRef<SdLayoutMenu>;
|
|
319
|
+
nodes: _angular_core.Signal<SdLayoutMenuTreeNode[]>;
|
|
320
|
+
onNavigate(menu: SdLayoutMenu): void;
|
|
321
|
+
onTogglePinned(event: MouseEvent, menu: SdLayoutMenu): void;
|
|
322
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutMenuTreeComponent, never>;
|
|
323
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdLayoutMenuTreeComponent, "sd-layout-menu-tree", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; "isSignal": true; }; "activePath": { "alias": "activePath"; "required": false; "isSignal": true; }; "pinnedKeys": { "alias": "pinnedKeys"; "required": false; "isSignal": true; }; "showPin": { "alias": "showPin"; "required": false; "isSignal": true; }; }, { "navigate": "navigate"; "togglePinned": "togglePinned"; }, never, never, true, never>;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
declare class SdLayoutUserMenuComponent {
|
|
327
|
+
#private;
|
|
328
|
+
private readonly trigger;
|
|
329
|
+
private readonly menu;
|
|
330
|
+
userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
|
|
331
|
+
signout: _angular_core.InputSignal<(() => void | Promise<void>) | undefined>;
|
|
332
|
+
changePassword: _angular_core.InputSignal<(() => void | Promise<void>) | undefined>;
|
|
333
|
+
compact: _angular_core.InputSignal<boolean>;
|
|
334
|
+
isOpen: _angular_core.WritableSignal<boolean>;
|
|
335
|
+
avatar: _angular_core.Signal<string | undefined>;
|
|
336
|
+
displayName: _angular_core.Signal<string>;
|
|
337
|
+
signoutAction: _angular_core.Signal<(() => void | Promise<void>) | undefined>;
|
|
338
|
+
changePasswordAction: _angular_core.Signal<(() => void | Promise<void>) | undefined>;
|
|
339
|
+
constructor();
|
|
340
|
+
open(): void;
|
|
341
|
+
toggle(): void;
|
|
342
|
+
close(restoreFocus?: boolean): void;
|
|
343
|
+
onMenuKeydown(event: KeyboardEvent): void;
|
|
344
|
+
runChangePassword(): void;
|
|
345
|
+
runSignout(): void;
|
|
346
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutUserMenuComponent, never>;
|
|
347
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdLayoutUserMenuComponent, "sd-layout-user-menu", never, { "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "signout": { "alias": "signout"; "required": false; "isSignal": true; }; "changePassword": { "alias": "changePassword"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface SidebarV2RailItem {
|
|
351
|
+
menu: SdLayoutMenu;
|
|
352
|
+
key: string;
|
|
353
|
+
title: string;
|
|
354
|
+
}
|
|
355
|
+
declare class SidebarV2Component {
|
|
356
|
+
#private;
|
|
357
|
+
menus: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
358
|
+
userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
|
|
359
|
+
sidebar: _angular_core.InputSignal<SidebarConfigurationV2>;
|
|
360
|
+
activeGroupKey: _angular_core.WritableSignal<string>;
|
|
361
|
+
isFlyoutOpen: _angular_core.WritableSignal<boolean>;
|
|
362
|
+
isFlyoutLocked: _angular_core.WritableSignal<boolean>;
|
|
363
|
+
searchText: _angular_core.WritableSignal<string>;
|
|
364
|
+
activePath: _angular_core.WritableSignal<string>;
|
|
365
|
+
interaction: _angular_core.Signal<"click" | "hover-lock">;
|
|
366
|
+
railItems: _angular_core.Signal<SidebarV2RailItem[]>;
|
|
367
|
+
activeGroup: _angular_core.Signal<SdLayoutMenu | undefined>;
|
|
368
|
+
contextMenus: _angular_core.Signal<SdLayoutMenu[]>;
|
|
369
|
+
pinnedKeys: _angular_core.WritableSignal<string[]>;
|
|
370
|
+
constructor();
|
|
371
|
+
selectGroup(menu: SdLayoutMenu): void;
|
|
372
|
+
previewGroup(menu: SdLayoutMenu): void;
|
|
373
|
+
leaveFlyout(): void;
|
|
374
|
+
closeFromBackdrop(): void;
|
|
375
|
+
closeFromEscape(): void;
|
|
376
|
+
closeFromNavigation(): void;
|
|
377
|
+
onNavigate(menu: SdLayoutMenu): void;
|
|
378
|
+
onTogglePinned(menu: SdLayoutMenu): void;
|
|
379
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarV2Component, never>;
|
|
380
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarV2Component, "sidebar-v2", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
declare class SidebarMobileV2Component {
|
|
384
|
+
#private;
|
|
385
|
+
menus: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
386
|
+
userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
|
|
387
|
+
sidebar: _angular_core.InputSignal<SidebarConfigurationV2>;
|
|
388
|
+
primaryMenus: _angular_core.Signal<SdLayoutMenu[]>;
|
|
389
|
+
overflowMenus: _angular_core.Signal<SdLayoutMenu[]>;
|
|
390
|
+
isSheetOpen: _angular_core.WritableSignal<boolean>;
|
|
391
|
+
sheetGroupKey: _angular_core.WritableSignal<string>;
|
|
392
|
+
sheetTitle: _angular_core.WritableSignal<string>;
|
|
393
|
+
sheetMenus: _angular_core.WritableSignal<SdLayoutMenu[]>;
|
|
394
|
+
searchText: _angular_core.WritableSignal<string>;
|
|
395
|
+
activePath: _angular_core.WritableSignal<string>;
|
|
396
|
+
pinnedKeys: _angular_core.WritableSignal<string[]>;
|
|
397
|
+
constructor();
|
|
398
|
+
openMore(trigger?: EventTarget | null): void;
|
|
399
|
+
activateMenu(menu: SdLayoutMenu, trigger?: EventTarget | null): void;
|
|
400
|
+
closeSheet(restoreFocus?: boolean): void;
|
|
401
|
+
onSheetKeydown(event: KeyboardEvent): void;
|
|
402
|
+
onNavigate(menu: SdLayoutMenu): void;
|
|
403
|
+
onTogglePinned(menu: SdLayoutMenu): void;
|
|
404
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMobileV2Component, never>;
|
|
405
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarMobileV2Component, "sidebar-mobile-v2", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
declare class SidebarV3Component {
|
|
409
|
+
#private;
|
|
410
|
+
menus: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
411
|
+
userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
|
|
412
|
+
sidebar: _angular_core.InputSignal<SidebarConfigurationV3>;
|
|
413
|
+
isCollapsed: _angular_core.WritableSignal<boolean>;
|
|
414
|
+
searchText: _angular_core.WritableSignal<string>;
|
|
415
|
+
activePath: _angular_core.WritableSignal<string>;
|
|
416
|
+
searchResults: _angular_core.Signal<SdLayoutRootMenu[]>;
|
|
417
|
+
recentConfiguration: _angular_core.Signal<_sdcorejs_angular_modules_layout.ResolvedSidebarRecentConfiguration>;
|
|
418
|
+
pinnedKeys: _angular_core.WritableSignal<string[]>;
|
|
419
|
+
pinnedMenus: _angular_core.Signal<(SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
420
|
+
recentMenus: _angular_core.Signal<(SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
421
|
+
collapsedItems: _angular_core.Signal<{
|
|
422
|
+
menu: SdLayoutMenu;
|
|
423
|
+
key: string;
|
|
424
|
+
title: string;
|
|
425
|
+
}[]>;
|
|
426
|
+
constructor();
|
|
427
|
+
toggleCollapsed(): void;
|
|
428
|
+
activateCollapsedMenu(menu: SdLayoutMenu): void;
|
|
429
|
+
navigateMenu(menu: SdLayoutMenu): void;
|
|
430
|
+
onTogglePinned(menu: SdLayoutMenu): void;
|
|
431
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarV3Component, never>;
|
|
432
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarV3Component, "sidebar-v3", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
declare class SidebarMobileV3Component {
|
|
436
|
+
#private;
|
|
437
|
+
private readonly trigger;
|
|
438
|
+
menus: _angular_core.InputSignal<SdLayoutMenu[]>;
|
|
439
|
+
userInfo: _angular_core.InputSignal<SdLayoutUserInfo>;
|
|
440
|
+
sidebar: _angular_core.InputSignal<SidebarConfigurationV3>;
|
|
441
|
+
isDrawerOpen: _angular_core.WritableSignal<boolean>;
|
|
442
|
+
searchText: _angular_core.WritableSignal<string>;
|
|
443
|
+
activePath: _angular_core.WritableSignal<string>;
|
|
444
|
+
searchResults: _angular_core.Signal<SdLayoutRootMenu[]>;
|
|
445
|
+
recentConfiguration: _angular_core.Signal<_sdcorejs_angular_modules_layout.ResolvedSidebarRecentConfiguration>;
|
|
446
|
+
pinnedKeys: _angular_core.WritableSignal<string[]>;
|
|
447
|
+
pinnedMenus: _angular_core.Signal<(SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
448
|
+
recentMenus: _angular_core.Signal<(SdLayoutRootMenu | _sdcorejs_angular_modules_layout.SdLayoutChildrenMenu)[]>;
|
|
449
|
+
constructor();
|
|
450
|
+
openDrawer(trigger?: EventTarget | null): void;
|
|
451
|
+
closeFromBackdrop(): void;
|
|
452
|
+
closeFromEscape(): void;
|
|
453
|
+
closeFromNavigation(): void;
|
|
454
|
+
onDrawerKeydown(event: KeyboardEvent): void;
|
|
455
|
+
navigateMenu(menu: SdLayoutMenu): void;
|
|
456
|
+
onTogglePinned(menu: SdLayoutMenu): void;
|
|
457
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SidebarMobileV3Component, never>;
|
|
458
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SidebarMobileV3Component, "sidebar-mobile-v3", never, { "menus": { "alias": "menus"; "required": false; "isSignal": true; }; "userInfo": { "alias": "userInfo"; "required": true; "isSignal": true; }; "sidebar": { "alias": "sidebar"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
declare class MenuPipe implements PipeTransform {
|
|
462
|
+
#private;
|
|
463
|
+
private permissionService;
|
|
464
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
465
|
+
constructor(...args: unknown[]);
|
|
466
|
+
transform(menus: SdLayoutMenu[]): SdLayoutMenu[];
|
|
467
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuPipe, never>;
|
|
468
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MenuPipe, "menu", true>;
|
|
469
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MenuPipe>;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
declare class MenuFocusPipe implements PipeTransform {
|
|
473
|
+
#private;
|
|
474
|
+
transform(routePath: string, menuItem: SdLayoutMenu): boolean;
|
|
475
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MenuFocusPipe, never>;
|
|
476
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<MenuFocusPipe, "menuFocus", true>;
|
|
477
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MenuFocusPipe>;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
declare class HighlightSearchPipe implements PipeTransform {
|
|
481
|
+
#private;
|
|
482
|
+
transform(value: string, keyword: string, args?: {
|
|
483
|
+
color?: string;
|
|
484
|
+
}): string;
|
|
485
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HighlightSearchPipe, never>;
|
|
486
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HighlightSearchPipe, "highLightSearch", true>;
|
|
487
|
+
}
|
|
488
|
+
|
|
216
489
|
declare class SdLayoutModule {
|
|
217
490
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdLayoutModule, never>;
|
|
218
491
|
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<SdLayoutModule, never, [typeof i1.RouterModule], never>;
|
|
219
492
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<SdLayoutModule>;
|
|
220
493
|
}
|
|
221
494
|
|
|
222
|
-
export { ForbiddenModule, HomeModule, NotFoundModule, SD_LAYOUT_CONFIGURATION, SdLayoutComponent, SdLayoutModule, SdLayoutService, SdLayoutStorageService, SdPageComponent, SidebarMobileOverlayComponent, SidebarMobileV1Component };
|
|
223
|
-
export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, SdLayoutChildrenMenu, SdLayoutMenu, SdLayoutRootMenu, SdLayoutUserInfo, SidebarConfigurationV1 };
|
|
495
|
+
export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SidebarMobileOverlayComponent, SidebarMobileV1Component, SidebarMobileV2Component, SidebarMobileV3Component, SidebarV2Component, SidebarV3Component, flattenMenuLeaves, getMenuStableKey, normalizeLayoutMobileBreakpoint, normalizeSidebarConfiguration, resolveMenuKeys, resolveSidebarV2Interaction, resolveSidebarV3Recent, searchMenuLeaves, selectPrimaryMenuGroups };
|
|
496
|
+
export type { ISdLayoutConfiguration, ISdSidebarConfiguration, Menus, ResolvedSidebarRecentConfiguration, SdLayoutChildrenMenu, SdLayoutMenu, SdLayoutRootMenu, SdLayoutUserInfo, SdLayoutVersionState, SdLayoutViewport, SidebarConfigurationBase, SidebarConfigurationV1, SidebarConfigurationV2, SidebarConfigurationV3 };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { PipeTransform } from '@angular/core';
|
|
3
3
|
import * as _angular_platform_browser from '@angular/platform-browser';
|
|
4
|
-
import { DomSanitizer } from '@angular/platform-browser';
|
|
5
4
|
import { Observable } from 'rxjs';
|
|
6
5
|
|
|
7
6
|
declare class SdFormatDatePipe implements PipeTransform {
|
|
@@ -28,7 +27,8 @@ declare class SdFormatNumberPipe implements PipeTransform {
|
|
|
28
27
|
|
|
29
28
|
declare class SdSafeHtmlPipe implements PipeTransform {
|
|
30
29
|
private sanitizer;
|
|
31
|
-
|
|
30
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
31
|
+
constructor(...args: unknown[]);
|
|
32
32
|
transform(html: string | number | undefined | null): _angular_platform_browser.SafeHtml | undefined;
|
|
33
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdSafeHtmlPipe, never>;
|
|
34
34
|
static ɵpipe: i0.ɵɵPipeDeclaration<SdSafeHtmlPipe, "sdSafeHtml", true>;
|
|
@@ -1,62 +1,106 @@
|
|
|
1
|
-
import { HttpRequest, HttpResponse, HttpErrorResponse, HttpClient, HttpInterceptor, HttpHandler, HttpEvent } from '@angular/common/http';
|
|
1
|
+
import { HttpRequest, HttpResponse, HttpErrorResponse, HttpHeaders, HttpContext, HttpParams, HttpClient, HttpInterceptor, HttpHandler, HttpEvent } from '@angular/common/http';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken } from '@angular/core';
|
|
4
4
|
import { SdCacheOption } from '@sdcorejs/angular/services/cache';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
7
|
+
type SdApiResponseType = 'arraybuffer' | 'blob' | 'json' | 'text';
|
|
8
|
+
type SdApiBivariantCallback<TArgument, TResult> = {
|
|
9
|
+
bivarianceHack(argument: TArgument): TResult;
|
|
10
|
+
}['bivarianceHack'];
|
|
11
|
+
interface SdApiHttpOption {
|
|
12
|
+
headers?: HttpHeaders | Record<string, string | string[]>;
|
|
13
|
+
context?: HttpContext;
|
|
14
|
+
params?: HttpParams | Record<string, string | number | boolean | readonly (string | number | boolean)[]>;
|
|
15
|
+
observe?: 'body';
|
|
16
|
+
reportProgress?: boolean;
|
|
17
|
+
responseType?: SdApiResponseType;
|
|
18
|
+
withCredentials?: boolean;
|
|
19
|
+
transferCache?: {
|
|
20
|
+
includeHeaders?: string[];
|
|
21
|
+
} | boolean;
|
|
22
|
+
}
|
|
23
|
+
interface SdApiRetryOption {
|
|
24
|
+
/** Number of retries after the initial request. Values are clamped to a finite safe limit. */
|
|
25
|
+
attempts: number;
|
|
26
|
+
/** Delay before the first retry. Defaults to 0. */
|
|
27
|
+
delayMs?: number;
|
|
28
|
+
/** Multiplier applied to each subsequent delay. Defaults to 1. */
|
|
29
|
+
backoff?: number;
|
|
30
|
+
/** Overrides the default transient HTTP-status predicate. `attempt` is one-based. */
|
|
31
|
+
retryWhen?: (error: unknown, attempt: number) => boolean;
|
|
32
|
+
/** Required to retry POST, PUT, PATCH, or DELETE. */
|
|
33
|
+
mutations?: boolean;
|
|
34
|
+
}
|
|
7
35
|
interface SdApiOption {
|
|
8
36
|
cacheOption?: SdCacheOption;
|
|
9
37
|
timeout?: number;
|
|
38
|
+
/** Cancels only this caller; a shared HTTP request continues while another caller remains. */
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
/** Enables request deduplication. Defaults to true for GET and false for mutations. */
|
|
41
|
+
dedupe?: boolean;
|
|
42
|
+
/** Keeps a successful dedupe result replayable for this duration. Defaults to 1000ms. */
|
|
43
|
+
dedupeWindowMs?: number;
|
|
44
|
+
/** Opt-in bounded retry policy. The default is no retries. */
|
|
45
|
+
retry?: SdApiRetryOption;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use `dedupe`. When both are provided, `dedupe` takes precedence.
|
|
48
|
+
* Explicit `true` remains a compatibility opt-in for mutation deduplication.
|
|
49
|
+
*/
|
|
10
50
|
autoCache?: boolean;
|
|
11
51
|
}
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
type
|
|
15
|
-
type
|
|
16
|
-
type
|
|
17
|
-
type
|
|
18
|
-
type HttpDeleteOption = Parameters<HttpClient['delete']>[1];
|
|
19
|
-
type SdDeleteOption = HttpDeleteOption & SdApiOption;
|
|
52
|
+
type SdGetOption = SdApiHttpOption & SdApiOption;
|
|
53
|
+
type SdPostOption = SdApiHttpOption & SdApiOption;
|
|
54
|
+
type SdPutOption = SdApiHttpOption & SdApiOption;
|
|
55
|
+
type SdPatchOption = SdApiHttpOption & SdApiOption;
|
|
56
|
+
type SdDeleteOption = SdApiHttpOption & SdApiOption;
|
|
57
|
+
type SdApiRequestUpdate = Parameters<HttpRequest<unknown>['clone']>[0];
|
|
20
58
|
interface SdApiHandler {
|
|
21
59
|
/** Danh sách host URL mà handler này sẽ xử lý */
|
|
22
60
|
hosts: string[];
|
|
23
61
|
/** Can thiệp request: gắn header, token, transform body... */
|
|
24
|
-
intercept?:
|
|
62
|
+
intercept?: SdApiBivariantCallback<HttpRequest<unknown>, HttpRequest<unknown> | SdApiRequestUpdate>;
|
|
25
63
|
/** Hook chạy TRƯỚC khi gửi request (dùng để log, tracking...) */
|
|
26
|
-
beforeRemote?:
|
|
64
|
+
beforeRemote?: SdApiBivariantCallback<HttpRequest<unknown>, void | Promise<void>>;
|
|
27
65
|
/** Hook chạy SAU khi nhận response (xử lý lỗi, notify...) */
|
|
28
|
-
afterRemote?:
|
|
66
|
+
afterRemote?: SdApiBivariantCallback<HttpResponse<unknown> | HttpErrorResponse | Error, void | Promise<void>>;
|
|
29
67
|
/** Transform response body thành kiểu dữ liệu mong muốn */
|
|
30
|
-
mapResponse?: <
|
|
31
|
-
/** Timeout tính bằng milliseconds. Mặc định:
|
|
68
|
+
mapResponse?: SdApiBivariantCallback<unknown, unknown>;
|
|
69
|
+
/** Timeout tính bằng milliseconds. Mặc định: 60000 (60 giây) */
|
|
32
70
|
timeout?: number;
|
|
33
71
|
}
|
|
34
72
|
interface ISdApiConfiguration {
|
|
35
|
-
handlers
|
|
73
|
+
handlers?: SdApiHandler[];
|
|
36
74
|
}
|
|
37
75
|
declare const SD_API_CONFIG: InjectionToken<ISdApiConfiguration>;
|
|
76
|
+
/** @deprecated Use `SD_API_CONFIG`. This is the same injection token. */
|
|
38
77
|
declare const SD_API_CONFIGURATION: InjectionToken<ISdApiConfiguration>;
|
|
39
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Response generics intentionally default to `unknown` for type safety.
|
|
81
|
+
* Callers should specify `T`; migration guidance is tracked for Task 13.
|
|
82
|
+
*/
|
|
40
83
|
declare class SdApiService {
|
|
41
84
|
#private;
|
|
42
85
|
constructor();
|
|
43
86
|
get http(): HttpClient;
|
|
44
|
-
get: <T =
|
|
45
|
-
post: <T =
|
|
46
|
-
put: <T =
|
|
47
|
-
|
|
48
|
-
|
|
87
|
+
get: <T = unknown>(url: string, option?: SdGetOption) => Promise<T>;
|
|
88
|
+
post: <T = unknown>(url: string, body?: unknown, option?: SdPostOption) => Promise<T>;
|
|
89
|
+
put: <T = unknown>(url: string, body?: unknown, option?: SdPutOption) => Promise<T>;
|
|
90
|
+
patch: <T = unknown>(url: string, body?: unknown, option?: SdPatchOption) => Promise<T>;
|
|
91
|
+
delete: <T = unknown>(url: string, option?: SdDeleteOption) => Promise<T>;
|
|
92
|
+
upload: <T = unknown>(url: string, option?: {
|
|
49
93
|
extensions?: string[];
|
|
50
94
|
maxSizeInMb?: number;
|
|
51
|
-
}) => Promise<
|
|
52
|
-
uploadFile: (url: string, file: File) => Promise<
|
|
95
|
+
}) => Promise<T | null | undefined>;
|
|
96
|
+
uploadFile: <T = unknown>(url: string, file: File | null | undefined) => Promise<T | null>;
|
|
53
97
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdApiService, never>;
|
|
54
98
|
static ɵprov: i0.ɵɵInjectableDeclaration<SdApiService>;
|
|
55
99
|
}
|
|
56
100
|
|
|
57
101
|
declare class SdHttpInterceptor implements HttpInterceptor {
|
|
58
102
|
#private;
|
|
59
|
-
intercept(request: HttpRequest<
|
|
103
|
+
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>>;
|
|
60
104
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdHttpInterceptor, never>;
|
|
61
105
|
static ɵprov: i0.ɵɵInjectableDeclaration<SdHttpInterceptor>;
|
|
62
106
|
}
|
|
@@ -68,4 +112,4 @@ declare class SdApiModule {
|
|
|
68
112
|
}
|
|
69
113
|
|
|
70
114
|
export { SD_API_CONFIG, SD_API_CONFIGURATION, SdApiModule, SdApiService, SdHttpInterceptor };
|
|
71
|
-
export type { ISdApiConfiguration, SdApiHandler, SdApiOption, SdDeleteOption, SdGetOption, SdPostOption, SdPutOption };
|
|
115
|
+
export type { ISdApiConfiguration, SdApiHandler, SdApiHttpOption, SdApiOption, SdApiRequestUpdate, SdApiResponseType, SdApiRetryOption, SdDeleteOption, SdGetOption, SdPatchOption, SdPostOption, SdPutOption };
|
|
@@ -1,43 +1,79 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken } from '@angular/core';
|
|
3
|
+
import { SdPersistenceSerializer, SdPersistenceIdentityCanonicalizer } from '@sdcorejs/angular/services/persistence';
|
|
3
4
|
import { Observable } from 'rxjs';
|
|
4
5
|
|
|
5
|
-
interface SdCacheOption<T =
|
|
6
|
+
interface SdCacheOption<T = unknown> {
|
|
6
7
|
type?: 'memory' | 'session' | 'local';
|
|
7
8
|
hours?: number;
|
|
9
|
+
ttlMs?: number;
|
|
8
10
|
default?: T;
|
|
9
|
-
args?: Record<string,
|
|
11
|
+
args?: Readonly<Record<string, unknown>>;
|
|
12
|
+
namespace?: string;
|
|
13
|
+
version?: string | number;
|
|
14
|
+
serializer?: SdPersistenceSerializer;
|
|
15
|
+
identityCanonicalizer?: SdPersistenceIdentityCanonicalizer;
|
|
10
16
|
}
|
|
11
|
-
interface SdCache<T =
|
|
12
|
-
get: () => T;
|
|
17
|
+
interface SdCache<T = unknown> {
|
|
18
|
+
get: () => T | undefined;
|
|
19
|
+
snapshot: () => SdCacheSnapshot<T>;
|
|
13
20
|
set: (data: T) => void;
|
|
14
21
|
has: () => boolean;
|
|
15
22
|
remove: () => void;
|
|
23
|
+
/** Releases only this facade while preserving its backing cache entry. */
|
|
24
|
+
release: () => void;
|
|
16
25
|
destroy: () => void;
|
|
17
26
|
observer: Observable<T | undefined>;
|
|
18
27
|
load: (callback: () => Promise<T>) => Promise<T>;
|
|
19
28
|
}
|
|
29
|
+
type SdCacheSnapshot<T> = {
|
|
30
|
+
present: false;
|
|
31
|
+
} | {
|
|
32
|
+
present: true;
|
|
33
|
+
value: T;
|
|
34
|
+
};
|
|
35
|
+
interface SdCacheWithDefault<T> extends Omit<SdCache<T>, 'get' | 'observer'> {
|
|
36
|
+
get: () => T;
|
|
37
|
+
observer: Observable<T>;
|
|
38
|
+
}
|
|
39
|
+
interface SdCacheStoredValue<T = unknown> {
|
|
40
|
+
data: T;
|
|
41
|
+
createdOn: Date;
|
|
42
|
+
}
|
|
43
|
+
type SdCacheSetCallback = (key: string, value: SdCacheStoredValue<unknown>, option?: SdCacheOption<unknown>) => Promise<void> | void;
|
|
44
|
+
type SdCacheGetCallback = (key: string, option?: SdCacheOption<unknown>) => Promise<SdCacheStoredValue<unknown> | undefined>;
|
|
45
|
+
type SdCacheRemoveCallback = (key: string, option?: SdCacheOption<unknown>) => Promise<void> | void;
|
|
20
46
|
interface ISdCacheConfiguration {
|
|
21
47
|
convertKey?: (key: string) => string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}>;
|
|
30
|
-
remove?: (key: string, option?: SdCacheOption) => Promise<void>;
|
|
48
|
+
namespace?: string;
|
|
49
|
+
version?: string | number;
|
|
50
|
+
serializer?: SdPersistenceSerializer;
|
|
51
|
+
identityCanonicalizer?: SdPersistenceIdentityCanonicalizer;
|
|
52
|
+
set?: SdCacheSetCallback;
|
|
53
|
+
get?: SdCacheGetCallback;
|
|
54
|
+
remove?: SdCacheRemoveCallback;
|
|
31
55
|
}
|
|
32
56
|
declare const SD_CACHE_CONFIG: InjectionToken<ISdCacheConfiguration>;
|
|
57
|
+
interface SdLegacyCacheCallbacks<T> {
|
|
58
|
+
matches: (key: string, option?: SdCacheOption<unknown>) => boolean;
|
|
59
|
+
isValue: (value: unknown) => value is T;
|
|
60
|
+
set?: (key: string, value: SdCacheStoredValue<T>, option?: SdCacheOption<unknown>) => Promise<void> | void;
|
|
61
|
+
get?: (key: string, option?: SdCacheOption<unknown>) => Promise<SdCacheStoredValue<T> | undefined>;
|
|
62
|
+
remove?: (key: string, option?: SdCacheOption<unknown>) => Promise<void> | void;
|
|
63
|
+
}
|
|
64
|
+
/** @deprecated Prefer globally safe unknown callbacks on `ISdCacheConfiguration`. */
|
|
65
|
+
declare function adaptLegacySdCacheCallbacks<T>(callbacks: SdLegacyCacheCallbacks<T>): ISdCacheConfiguration;
|
|
33
66
|
|
|
34
67
|
declare class SdCacheService {
|
|
35
68
|
#private;
|
|
36
69
|
constructor();
|
|
37
|
-
create<T
|
|
70
|
+
create<T>(key: string | object, option: SdCacheOption<T> & {
|
|
71
|
+
default: T;
|
|
72
|
+
}): SdCacheWithDefault<T>;
|
|
73
|
+
create<T = unknown>(key: string | object, option?: SdCacheOption<unknown>): SdCache<T>;
|
|
38
74
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdCacheService, never>;
|
|
39
75
|
static ɵprov: i0.ɵɵInjectableDeclaration<SdCacheService>;
|
|
40
76
|
}
|
|
41
77
|
|
|
42
|
-
export { SD_CACHE_CONFIG, SdCacheService };
|
|
43
|
-
export type { ISdCacheConfiguration, SdCache, SdCacheOption };
|
|
78
|
+
export { SD_CACHE_CONFIG, SdCacheService, adaptLegacySdCacheCallbacks };
|
|
79
|
+
export type { ISdCacheConfiguration, SdCache, SdCacheGetCallback, SdCacheOption, SdCacheRemoveCallback, SdCacheSetCallback, SdCacheSnapshot, SdCacheStoredValue, SdCacheWithDefault, SdLegacyCacheCallbacks };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MatDialogRef
|
|
1
|
+
import { MatDialogRef } from '@angular/material/dialog';
|
|
2
2
|
import { Color } from '@sdcorejs/utils/models';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
|
|
@@ -66,7 +66,8 @@ declare class DialogConfirmComponent {
|
|
|
66
66
|
declare class SdConfirmService {
|
|
67
67
|
#private;
|
|
68
68
|
private dialog;
|
|
69
|
-
|
|
69
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
70
|
+
constructor(...args: unknown[]);
|
|
70
71
|
confirm: (message: string, option?: {
|
|
71
72
|
title?: string;
|
|
72
73
|
yesTitle?: string;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { SdNotifyService } from '@sdcorejs/angular/services/notify';
|
|
2
|
-
import { SdLoadingService } from '@sdcorejs/angular/services/loading';
|
|
3
1
|
import * as i0 from '@angular/core';
|
|
4
2
|
|
|
5
3
|
interface SdDocxConvertOptions {
|
|
@@ -16,7 +14,8 @@ declare class SdDocxService {
|
|
|
16
14
|
#private;
|
|
17
15
|
private notifyService;
|
|
18
16
|
private loadingService;
|
|
19
|
-
|
|
17
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
18
|
+
constructor(...args: unknown[]);
|
|
20
19
|
open(options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null>;
|
|
21
20
|
convertToHtml(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<SdDocxConvertResult | null>;
|
|
22
21
|
convertToHtmlString(input: File | Blob | ArrayBuffer, options?: SdDocxConvertOptions): Promise<string | null>;
|