@sdcorejs/angular 20.2.15 → 20.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/README.md +9 -7
- package/assets/STYLE-GUIDE.md +6 -3
- package/assets/THEME.md +166 -0
- package/assets/fonts/fonts.scss +1 -1
- package/assets/scss/ckeditor5.scss +2 -2
- package/assets/scss/core/_inline-edit.scss +3 -3
- package/assets/scss/core/_read-state-panel.scss +2 -2
- package/assets/scss/core/color.scss +4 -2
- package/assets/scss/core/form.scss +35 -12
- package/assets/scss/core/scrollbar.scss +3 -3
- package/assets/scss/core/utilities/_base.scss +5 -5
- package/assets/scss/core/utilities/_typography.scss +22 -22
- package/assets/scss/sd-core.scss +12 -0
- package/assets/scss/themes/_component-tokens.scss +261 -0
- package/assets/scss/themes/_presets.scss +3 -0
- package/assets/scss/themes/_ramps.scss +56 -0
- package/assets/scss/themes/_scales.scss +90 -0
- package/assets/scss/themes/_semantic.scss +22 -0
- package/assets/scss/themes/default.scss +113 -10
- package/assets/scss/themes/material-theme.scss +3 -0
- package/components/breadcrumb/index.d.ts +2 -1
- package/components/data-state/index.d.ts +6 -2
- package/components/file-explorer/index.d.ts +450 -57
- package/components/form-generic/index.d.ts +949 -834
- package/components/highlight/index.d.ts +27 -0
- package/components/image-editor/index.d.ts +478 -0
- package/components/index.d.ts +3 -0
- package/components/inform/index.d.ts +5 -2
- package/components/kanban/index.d.ts +179 -0
- package/components/mini-editor/index.d.ts +1 -1
- package/components/preview/index.d.ts +51 -2
- package/components/query-builder/index.d.ts +1 -1
- package/components/section/index.d.ts +7 -2
- package/components/tab/index.d.ts +3 -1
- package/components/table/index.d.ts +6 -0
- package/directives/index.d.ts +8 -0
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +6 -6
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-audit-diff.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-autoid-inspector.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-avatar.mjs +34 -27
- package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-badge.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs +35 -5
- package/fesm2022/sdcorejs-angular-components-breadcrumb.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +13 -11
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-card.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-card.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +8 -4
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +12 -4
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2260 -133
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +6502 -6557
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-highlight.mjs +63 -0
- package/fesm2022/sdcorejs-angular-components-highlight.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-history.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs +2088 -0
- package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +9 -5
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-job-progress.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-kanban.mjs +441 -0
- package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +40 -22
- package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-operator.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +129 -7
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +33 -24
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-quick-action.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +14 -9
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +28 -4
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +7 -3
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +12 -4
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +308 -113
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +14 -5
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +3 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +99 -13
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +149 -6
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +19 -4
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +19 -4
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +17 -7
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +17 -7
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs +3 -3
- package/fesm2022/sdcorejs-angular-forms-inline-text.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +18 -4
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +29 -5
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-label.mjs +27 -2
- package/fesm2022/sdcorejs-angular-forms-label.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs +244 -0
- package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-forms-select.mjs +498 -7
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +22 -4
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms.mjs +8 -0
- package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +1729 -271
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-auth.mjs +35 -3
- package/fesm2022/sdcorejs-angular-modules-auth.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +19 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +39 -48
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-permission.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +196 -8
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +10 -3
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +5 -0
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-notify.mjs +107 -7
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +458 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs +169 -0
- package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-utilities.mjs +1 -0
- package/fesm2022/sdcorejs-angular-utilities.mjs.map +1 -1
- package/forms/autocomplete/index.d.ts +19 -1
- package/forms/chip/index.d.ts +13 -2
- package/forms/chip-calendar/index.d.ts +13 -2
- package/forms/date/index.d.ts +7 -2
- package/forms/datetime/index.d.ts +7 -2
- package/forms/index.d.ts +8 -6
- package/forms/inline-text/index.d.ts +1 -1
- package/forms/input/index.d.ts +21 -5
- package/forms/input-number/index.d.ts +12 -2
- package/forms/label/index.d.ts +16 -1
- package/forms/models/index.d.ts +16 -1
- package/forms/segmented/index.d.ts +90 -0
- package/forms/select/index.d.ts +66 -4
- package/forms/textarea/index.d.ts +9 -2
- package/i18n/index.d.ts +344 -54
- package/modules/auth/index.d.ts +3 -3
- package/modules/icon/index.d.ts +11 -1
- package/modules/layout/index.d.ts +2 -2
- package/modules/permission/index.d.ts +3 -2
- package/package.json +22 -2
- package/services/api/index.d.ts +49 -2
- package/services/confirm/index.d.ts +15 -0
- package/services/notify/index.d.ts +8 -0
- package/utilities/extensions/index.d.ts +68 -1
- package/utilities/index.d.ts +1 -0
- package/utilities/theme/index.d.ts +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdcorejs/angular",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.3.1",
|
|
4
4
|
"description": "Angular component library: data table, query bar/builder, 20+ signal-based form controls, layout, auth and workflow services. Standalone, OnPush, signals-first. Published in parallel lines for Angular 19, 20, 21 and 22.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@sdcorejs/angular-material-datetime": "1.0.4",
|
|
44
|
-
"@sdcorejs/utils": "1.
|
|
44
|
+
"@sdcorejs/utils": "1.2.5",
|
|
45
45
|
"@lucide/angular": "^1.22.0",
|
|
46
46
|
"@ckeditor/ckeditor5-angular": "11.1.2",
|
|
47
47
|
"ckeditor5": "48.0.0",
|
|
@@ -132,10 +132,18 @@
|
|
|
132
132
|
"types": "./components/form-generic/index.d.ts",
|
|
133
133
|
"default": "./fesm2022/sdcorejs-angular-components-form-generic.mjs"
|
|
134
134
|
},
|
|
135
|
+
"./components/highlight": {
|
|
136
|
+
"types": "./components/highlight/index.d.ts",
|
|
137
|
+
"default": "./fesm2022/sdcorejs-angular-components-highlight.mjs"
|
|
138
|
+
},
|
|
135
139
|
"./components/history": {
|
|
136
140
|
"types": "./components/history/index.d.ts",
|
|
137
141
|
"default": "./fesm2022/sdcorejs-angular-components-history.mjs"
|
|
138
142
|
},
|
|
143
|
+
"./components/image-editor": {
|
|
144
|
+
"types": "./components/image-editor/index.d.ts",
|
|
145
|
+
"default": "./fesm2022/sdcorejs-angular-components-image-editor.mjs"
|
|
146
|
+
},
|
|
139
147
|
"./components/import-excel": {
|
|
140
148
|
"types": "./components/import-excel/index.d.ts",
|
|
141
149
|
"default": "./fesm2022/sdcorejs-angular-components-import-excel.mjs"
|
|
@@ -148,6 +156,10 @@
|
|
|
148
156
|
"types": "./components/job-progress/index.d.ts",
|
|
149
157
|
"default": "./fesm2022/sdcorejs-angular-components-job-progress.mjs"
|
|
150
158
|
},
|
|
159
|
+
"./components/kanban": {
|
|
160
|
+
"types": "./components/kanban/index.d.ts",
|
|
161
|
+
"default": "./fesm2022/sdcorejs-angular-components-kanban.mjs"
|
|
162
|
+
},
|
|
151
163
|
"./components/mini-editor": {
|
|
152
164
|
"types": "./components/mini-editor/index.d.ts",
|
|
153
165
|
"default": "./fesm2022/sdcorejs-angular-components-mini-editor.mjs"
|
|
@@ -300,6 +312,10 @@
|
|
|
300
312
|
"types": "./forms/radio/index.d.ts",
|
|
301
313
|
"default": "./fesm2022/sdcorejs-angular-forms-radio.mjs"
|
|
302
314
|
},
|
|
315
|
+
"./forms/segmented": {
|
|
316
|
+
"types": "./forms/segmented/index.d.ts",
|
|
317
|
+
"default": "./fesm2022/sdcorejs-angular-forms-segmented.mjs"
|
|
318
|
+
},
|
|
303
319
|
"./forms/select": {
|
|
304
320
|
"types": "./forms/select/index.d.ts",
|
|
305
321
|
"default": "./fesm2022/sdcorejs-angular-forms-select.mjs"
|
|
@@ -431,6 +447,10 @@
|
|
|
431
447
|
"./utilities/read-state": {
|
|
432
448
|
"types": "./utilities/read-state/index.d.ts",
|
|
433
449
|
"default": "./fesm2022/sdcorejs-angular-utilities-read-state.mjs"
|
|
450
|
+
},
|
|
451
|
+
"./utilities/theme": {
|
|
452
|
+
"types": "./utilities/theme/index.d.ts",
|
|
453
|
+
"default": "./fesm2022/sdcorejs-angular-utilities-theme.mjs"
|
|
434
454
|
}
|
|
435
455
|
}
|
|
436
456
|
}
|
package/services/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { InjectionToken } from '@angular/core';
|
|
3
|
+
import { InjectionToken, Type, EnvironmentProviders } from '@angular/core';
|
|
4
4
|
import { SdCacheOption } from '@sdcorejs/angular/services/cache';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
6
|
|
|
@@ -90,6 +90,53 @@ declare class SdApiError<TBody = unknown> extends Error {
|
|
|
90
90
|
constructor(body: TBody, message?: string);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Handler API đăng ký lúc runtime, sống ở root injector.
|
|
95
|
+
*
|
|
96
|
+
* why: `SdHttpInterceptor` được đăng ký qua `HTTP_INTERCEPTORS` ở ROOT, nên
|
|
97
|
+
* `inject(SD_API_CONFIG)` của nó chỉ thấy provider ở root. Library nào khai
|
|
98
|
+
* `{ provide: SD_API_CONFIG, multi: true }` trong NgModule mà shell nạp bằng
|
|
99
|
+
* `loadChildren` thì provider nằm ở child injector của lazy route — interceptor không
|
|
100
|
+
* bao giờ thấy, nên mất `intercept` / `beforeRemote` / `afterRemote` trong im lặng.
|
|
101
|
+
* Registry này là điểm hẹn ở root mà mọi scope (root, eager, lazy) đều ghi vào được.
|
|
102
|
+
*
|
|
103
|
+
* Registry tự nhặt `SD_API_CONFIG` khai trong injector của lazy route (`Route.providers`,
|
|
104
|
+
* NgModule của `loadChildren`) trong chính navigation Router tạo injector đó — trước guard,
|
|
105
|
+
* resolver và component — và gỡ khi injector bị huỷ;
|
|
106
|
+
* library giữ nguyên cách khai multi provider, không cần biết shell mount nó eager hay lazy.
|
|
107
|
+
*/
|
|
108
|
+
declare class SdApiHandlerRegistry {
|
|
109
|
+
#private;
|
|
110
|
+
/** Các configuration đang được đăng ký, theo thứ tự đăng ký. */
|
|
111
|
+
readonly configurations: i0.Signal<ISdApiConfiguration[]>;
|
|
112
|
+
constructor();
|
|
113
|
+
/**
|
|
114
|
+
* Đăng ký một configuration. Trả về hàm gỡ đăng ký (gọi nhiều lần vẫn an toàn); dùng
|
|
115
|
+
* {@link provideSdApiConfiguration} để việc gỡ gắn với vòng đời của scope.
|
|
116
|
+
*/
|
|
117
|
+
register(configuration: ISdApiConfiguration): () => void;
|
|
118
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdApiHandlerRegistry, never>;
|
|
119
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SdApiHandlerRegistry>;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Đăng ký handler API cho scope hiện tại: root (`bootstrapApplication` / `AppModule`),
|
|
123
|
+
* NgModule nạp eager, hay `Route.providers` / NgModule của lazy route.
|
|
124
|
+
*
|
|
125
|
+
* Configuration được đăng ký vào {@link SdApiHandlerRegistry} ngay khi injector của scope
|
|
126
|
+
* được tạo — tức trước mọi request scope đó phát ra — và gỡ khi injector bị huỷ. Truyền
|
|
127
|
+
* class thì class được provide trong chính scope đó, nên nó inject được dependency của scope.
|
|
128
|
+
*
|
|
129
|
+
* ```ts
|
|
130
|
+
* // library
|
|
131
|
+
* @NgModule({ providers: [provideSdApiConfiguration(ApiConfiguration)] })
|
|
132
|
+
* export class OrdersModule {}
|
|
133
|
+
*
|
|
134
|
+
* // hoặc route
|
|
135
|
+
* { path: 'orders', providers: [provideSdApiConfiguration(ApiConfiguration)], loadComponent: ... }
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare function provideSdApiConfiguration(configuration: Type<ISdApiConfiguration> | ISdApiConfiguration): EnvironmentProviders;
|
|
139
|
+
|
|
93
140
|
/**
|
|
94
141
|
* Response generics intentionally default to `unknown` for type safety.
|
|
95
142
|
* Callers should specify `T`; migration guidance is tracked for Task 13.
|
|
@@ -131,5 +178,5 @@ declare class SdApiModule {
|
|
|
131
178
|
static ɵinj: i0.ɵɵInjectorDeclaration<SdApiModule>;
|
|
132
179
|
}
|
|
133
180
|
|
|
134
|
-
export { SD_API_CONFIG, SD_API_CONFIGURATION, SD_API_MISSING_HTTP_CLIENT_MESSAGE, SdApiError, SdApiModule, SdApiService, SdHttpInterceptor };
|
|
181
|
+
export { SD_API_CONFIG, SD_API_CONFIGURATION, SD_API_MISSING_HTTP_CLIENT_MESSAGE, SdApiError, SdApiHandlerRegistry, SdApiModule, SdApiService, SdHttpInterceptor, provideSdApiConfiguration };
|
|
135
182
|
export type { ISdApiConfiguration, SdApiHandler, SdApiHttpOption, SdApiOption, SdApiRequestUpdate, SdApiResponseType, SdApiRetryOption, SdDeleteOption, SdGetOption, SdPatchOption, SdPostOption, SdPutOption };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { MatDialogRef } from '@angular/material/dialog';
|
|
2
2
|
import { Color } from '@sdcorejs/utils/models';
|
|
3
|
+
import { SdIconShape } from '@sdcorejs/angular/modules/icon';
|
|
3
4
|
import * as i0 from '@angular/core';
|
|
4
5
|
|
|
5
6
|
interface DialogData {
|
|
6
7
|
icon?: string;
|
|
8
|
+
iconShape?: SdIconShape;
|
|
7
9
|
title?: string;
|
|
8
10
|
message?: string;
|
|
9
11
|
yesTitle?: string;
|
|
@@ -58,6 +60,7 @@ declare class DialogConfirmComponent {
|
|
|
58
60
|
readonly dialogRef: MatDialogRef<any, any>;
|
|
59
61
|
readonly data: DialogData;
|
|
60
62
|
readonly iconTone: Color;
|
|
63
|
+
readonly iconShape: SdIconShape;
|
|
61
64
|
readonly resolvedIcon: string;
|
|
62
65
|
readonly hasFields: boolean;
|
|
63
66
|
constructor();
|
|
@@ -75,6 +78,8 @@ declare class SdConfirmService {
|
|
|
75
78
|
confirm: (message: string, option?: {
|
|
76
79
|
title?: string;
|
|
77
80
|
icon?: string;
|
|
81
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
82
|
+
iconShape?: SdIconShape;
|
|
78
83
|
yesTitle?: string;
|
|
79
84
|
noTitle?: string;
|
|
80
85
|
yesButtonColor?: Color;
|
|
@@ -85,6 +90,8 @@ declare class SdConfirmService {
|
|
|
85
90
|
withInput: (message?: string, option?: {
|
|
86
91
|
title?: string;
|
|
87
92
|
icon?: string;
|
|
93
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
94
|
+
iconShape?: SdIconShape;
|
|
88
95
|
yesTitle?: string;
|
|
89
96
|
noTitle?: string;
|
|
90
97
|
required?: boolean;
|
|
@@ -99,6 +106,8 @@ declare class SdConfirmService {
|
|
|
99
106
|
withRadio: (message?: string, option?: {
|
|
100
107
|
title?: string;
|
|
101
108
|
icon?: string;
|
|
109
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
110
|
+
iconShape?: SdIconShape;
|
|
102
111
|
yesTitle?: string;
|
|
103
112
|
noTitle?: string;
|
|
104
113
|
required?: boolean;
|
|
@@ -114,6 +123,8 @@ declare class SdConfirmService {
|
|
|
114
123
|
withSelect: (message?: string, option?: {
|
|
115
124
|
title?: string;
|
|
116
125
|
icon?: string;
|
|
126
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
127
|
+
iconShape?: SdIconShape;
|
|
117
128
|
yesTitle?: string;
|
|
118
129
|
noTitle?: string;
|
|
119
130
|
required?: boolean;
|
|
@@ -130,6 +141,8 @@ declare class SdConfirmService {
|
|
|
130
141
|
withDate: (message?: string, option?: {
|
|
131
142
|
title?: string;
|
|
132
143
|
icon?: string;
|
|
144
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
145
|
+
iconShape?: SdIconShape;
|
|
133
146
|
yesTitle?: string;
|
|
134
147
|
noTitle?: string;
|
|
135
148
|
required?: boolean;
|
|
@@ -144,6 +157,8 @@ declare class SdConfirmService {
|
|
|
144
157
|
withDatetime: (message?: string, option?: {
|
|
145
158
|
title?: string;
|
|
146
159
|
icon?: string;
|
|
160
|
+
/** Hình nền ô icon; bỏ trống thì dùng `defaultShape` của `provideSdIcon`. */
|
|
161
|
+
iconShape?: SdIconShape;
|
|
147
162
|
yesTitle?: string;
|
|
148
163
|
noTitle?: string;
|
|
149
164
|
required?: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SdIconShape } from '@sdcorejs/angular/modules/icon';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
3
|
|
|
3
4
|
type ToastType = 'success' | 'info' | 'warning' | 'error';
|
|
@@ -17,6 +18,8 @@ interface ToastData {
|
|
|
17
18
|
* TIN CẬY (do dev tự viết); KHÔNG truyền data người dùng vào đây.
|
|
18
19
|
*/
|
|
19
20
|
html?: boolean;
|
|
21
|
+
/** Hình nền ô icon; bỏ trống thì toast dùng `defaultShape` của `provideSdIcon`. */
|
|
22
|
+
iconShape?: SdIconShape;
|
|
20
23
|
}
|
|
21
24
|
interface NotifyOption {
|
|
22
25
|
duration?: number;
|
|
@@ -32,6 +35,11 @@ interface NotifyOption {
|
|
|
32
35
|
* Chỉ dùng cho markup tin cậy. Xem `ToastData.html`.
|
|
33
36
|
*/
|
|
34
37
|
html?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Hình nền ô icon: `square` | `circle` | `none`. Bỏ trống thì dùng `defaultShape` của `provideSdIcon`.
|
|
40
|
+
* Với `warning`/`error` (gom theo debounce), option của lời gọi cuối được dùng — giống `title`/`duration`.
|
|
41
|
+
*/
|
|
42
|
+
iconShape?: SdIconShape;
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
declare class SdNotifyService {
|
|
@@ -113,5 +113,72 @@ declare function sdMatchesSecureRoute(url: string | null | undefined, routes: re
|
|
|
113
113
|
* `/api/v1beta`. A bare `/` prefix covers everything on that origin.
|
|
114
114
|
*/
|
|
115
115
|
declare function sdIsPathPrefix(prefix: string, pathname: string): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* True khi `value` an toàn để làm `href` tải xuống, `src` của media, hoặc đích điều hướng.
|
|
118
|
+
*
|
|
119
|
+
* why: các chỗ tải xuống/xem trước trước đây gán thẳng URL của consumer (hoặc của server) vào
|
|
120
|
+
* `<a href>` rồi `click()`, hay vào `src` của media. `javascript:`/`vbscript:` chạy script trong
|
|
121
|
+
* origin của app, còn `data:text/html` mở một trang do kẻ tấn công dựng.
|
|
122
|
+
*
|
|
123
|
+
* Cho phép:
|
|
124
|
+
* - `http:`/`https:` không kèm credential nhúng (`https://real.com@evil.tld` bị từ chối);
|
|
125
|
+
* - URL tương đối, resolve theo `baseOrigin` (mặc định là origin của document, hoặc
|
|
126
|
+
* {@link SD_NON_BROWSER_ORIGIN} khi chạy SSR);
|
|
127
|
+
* - `blob:`, `data:image/*`, `data:application/pdf`.
|
|
128
|
+
*
|
|
129
|
+
* Mọi thứ khác bị từ chối, kể cả `mailto:`/`tel:` (không phải tài nguyên), `file:` và giá trị
|
|
130
|
+
* không parse được.
|
|
131
|
+
*/
|
|
132
|
+
declare function sdIsSafeResourceUrl(value: string | null | undefined, baseOrigin?: string): boolean;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Lọc HTML đầu ra của editor theo allowlist.
|
|
136
|
+
*
|
|
137
|
+
* - Thẻ ngoài allowlist bị gỡ vỏ (giữ text); nhóm nguy hiểm (`script`, `style`, `iframe`, form
|
|
138
|
+
* control, SVG động...) bị bỏ cả nội dung. Comment bị bỏ.
|
|
139
|
+
* - Thuộc tính ngoài allowlist bị bỏ, kể cả mọi `on*`, `srcdoc`, `formaction`, `xlink:href`.
|
|
140
|
+
* - `href`: http, https, mailto, tel, tương đối, `#fragment`. `src`/`srcset`: http, https, blob,
|
|
141
|
+
* tương đối, `data:image/*`.
|
|
142
|
+
* - Nội dung đã sạch và ở dạng chuẩn (như output CKEditor) được trả NGUYÊN chuỗi đầu vào, không
|
|
143
|
+
* serialize lại; hàm idempotent.
|
|
144
|
+
* - Không có `DOMParser` (SSR): trả text đã escape HTML — fail closed.
|
|
145
|
+
*/
|
|
146
|
+
declare function sdSanitizeEditorHtml(html: string | null | undefined): string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Tìm kiếm không phân biệt dấu / hoa-thường cho tiếng Việt, kèm vị trí khớp trên chuỗi GỐC.
|
|
150
|
+
*
|
|
151
|
+
* why: các chỗ highlight cũ (vd pipe `highLightSearch` của layout) bỏ dấu cả chuỗi rồi dựng
|
|
152
|
+
* `new RegExp(keyword)` từ input người dùng. Ký tự như `(`, `[`, `*` làm RegExp ném lỗi hoặc khớp
|
|
153
|
+
* sai, và index trên chuỗi đã bỏ dấu chỉ trùng với chuỗi gốc khi mỗi ký tự giữ nguyên độ dài. Ở đây
|
|
154
|
+
* chuẩn hoá theo từng code point, giữ bảng map về index gốc, và so khớp bằng `indexOf` — không có
|
|
155
|
+
* RegExp nào được dựng từ input.
|
|
156
|
+
*/
|
|
157
|
+
/** Một đoạn khớp trên chuỗi gốc: `[start, end)` theo index UTF-16. */
|
|
158
|
+
interface SdHighlightRange {
|
|
159
|
+
/** Index bắt đầu (bao gồm) trên chuỗi gốc. */
|
|
160
|
+
start: number;
|
|
161
|
+
/** Index kết thúc (không bao gồm) trên chuỗi gốc. */
|
|
162
|
+
end: number;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Chuẩn hoá chuỗi để so khớp: chữ thường, bỏ dấu (kể cả đ/Đ -> d), giữ nguyên khoảng trắng và ký
|
|
166
|
+
* tự khác. `null`/`undefined` trả `''`.
|
|
167
|
+
*
|
|
168
|
+
* @example sdNormalizeSearchText('Đà Nẵng') // 'da nang'
|
|
169
|
+
*/
|
|
170
|
+
declare function sdNormalizeSearchText(value: string | null | undefined): string;
|
|
171
|
+
/**
|
|
172
|
+
* Tìm mọi đoạn khớp (không chồng nhau, trái sang phải) của `term` trong `text`, không phân biệt
|
|
173
|
+
* dấu và hoa-thường. Kết quả là index trên chuỗi GỐC, dùng trực tiếp để cắt `text`.
|
|
174
|
+
*
|
|
175
|
+
* - `term` được trim; term rỗng (hoặc chỉ có khoảng trắng / chỉ có dấu) trả `[]`.
|
|
176
|
+
* - Ký tự đặc biệt của RegExp (`.`, `*`, `(`…) được so như ký tự thường.
|
|
177
|
+
* - Không bao giờ ném lỗi.
|
|
178
|
+
*
|
|
179
|
+
* @example sdFindHighlightRanges('Nguyễn Văn Đức', 'duc') // [{ start: 11, end: 14 }]
|
|
180
|
+
*/
|
|
181
|
+
declare function sdFindHighlightRanges(text: string | null | undefined, term: string | null | undefined): SdHighlightRange[];
|
|
116
182
|
|
|
117
|
-
export { ObjectUtilities, SD_NON_BROWSER_ORIGIN, SdUtilities, sdIsAllowedOrigin, sdIsExternalHttpUrl, sdIsPathPrefix, sdMatchesSecureRoute, sdOpenExternal, sdParseUrl, sdResolveBaseOrigin };
|
|
183
|
+
export { ObjectUtilities, SD_NON_BROWSER_ORIGIN, SdUtilities, sdFindHighlightRanges, sdIsAllowedOrigin, sdIsExternalHttpUrl, sdIsPathPrefix, sdIsSafeResourceUrl, sdMatchesSecureRoute, sdNormalizeSearchText, sdOpenExternal, sdParseUrl, sdResolveBaseOrigin, sdSanitizeEditorHtml };
|
|
184
|
+
export type { SdHighlightRange };
|
package/utilities/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export * from '@sdcorejs/angular/utilities/extensions';
|
|
|
2
2
|
export * from '@sdcorejs/angular/utilities/models';
|
|
3
3
|
export * from '@sdcorejs/angular/utilities/data-state';
|
|
4
4
|
export * from '@sdcorejs/angular/utilities/read-state';
|
|
5
|
+
export * from '@sdcorejs/angular/utilities/theme';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Danh sách token màu public của Core UI (không kèm tiền tố `--sd-`): palette gốc của 2.15, ramp 50–950 và
|
|
3
|
+
* các vai trò semantic. `scripts/theme-token-list.test.mjs` giữ danh sách này khớp với output của `sd.theme()`.
|
|
4
|
+
*
|
|
5
|
+
* Token component (`--sd-{component}-{role}`) và thang space/radius/typography… không nằm ở đây: chúng là hook
|
|
6
|
+
* tuỳ biến, không phải màu nền tảng để app tự dùng.
|
|
7
|
+
*/
|
|
8
|
+
declare const SD_COLOR_TOKENS: readonly ["primary", "primary-light", "primary-dark", "primary-contrast", "secondary", "secondary-light", "secondary-dark", "secondary-contrast", "info", "info-light", "info-dark", "info-contrast", "success", "success-light", "success-dark", "success-contrast", "warning", "warning-light", "warning-dark", "warning-contrast", "error", "error-light", "error-dark", "error-contrast", "surface", "surface-muted", "text", "text-secondary", "text-muted", "border", "border-strong", "disabled-bg", "disabled-text", "primary-50", "primary-100", "primary-200", "primary-300", "primary-400", "primary-500", "primary-600", "primary-700", "primary-800", "primary-900", "primary-950", "secondary-50", "secondary-100", "secondary-200", "secondary-300", "secondary-400", "secondary-500", "secondary-600", "secondary-700", "secondary-800", "secondary-900", "secondary-950", "info-50", "info-100", "info-200", "info-300", "info-400", "info-500", "info-600", "info-700", "info-800", "info-900", "info-950", "success-50", "success-100", "success-200", "success-300", "success-400", "success-500", "success-600", "success-700", "success-800", "success-900", "success-950", "warning-50", "warning-100", "warning-200", "warning-300", "warning-400", "warning-500", "warning-600", "warning-700", "warning-800", "warning-900", "warning-950", "error-50", "error-100", "error-200", "error-300", "error-400", "error-500", "error-600", "error-700", "error-800", "error-900", "error-950", "neutral-50", "neutral-100", "neutral-200", "neutral-300", "neutral-400", "neutral-500", "neutral-600", "neutral-700", "neutral-800", "neutral-900", "neutral-950", "status-info-bg", "status-info-fg", "status-success-bg", "status-success-fg", "status-warning-bg", "status-warning-fg", "status-error-bg", "status-error-fg", "link", "surface-inverse", "text-on-solid", "border-focus", "border-danger", "overlay-backdrop", "focus-ring-color"];
|
|
9
|
+
/** Tên một token màu public của Core UI, ví dụ `'primary'`, `'primary-600'`, `'status-error-fg'`. */
|
|
10
|
+
type SdColorToken = (typeof SD_COLOR_TOKENS)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Đọc giá trị của các token màu từ computed style của `element` (mặc định `<html>`).
|
|
13
|
+
*
|
|
14
|
+
* - Giá trị là text của custom property sau khi trình duyệt đã thay mọi `var()` — ví dụ `'#005cbb'`, hoặc
|
|
15
|
+
* `'color-mix(in srgb, #005cbb 14%, white)'` với token dẫn xuất (gán cho một thuộc tính màu để có màu cụ thể).
|
|
16
|
+
* - Chỉ trả những token đang có giá trị trên phần tử đó (theme chưa được include thì thiếu).
|
|
17
|
+
* - Không có `document` / `window` (SSR), hoặc phần tử thuộc một document không hiển thị: trả `{}`.
|
|
18
|
+
*
|
|
19
|
+
* @example readSdTokens()['primary'] // '#005cbb'
|
|
20
|
+
* @example readSdTokens(dialogEl, ['surface', 'text']) // giá trị trong scope của dialog (vd scope dark)
|
|
21
|
+
*/
|
|
22
|
+
declare function readSdTokens(element?: Element | null, tokens?: readonly SdColorToken[]): Partial<Record<SdColorToken, string>>;
|
|
23
|
+
|
|
24
|
+
export { SD_COLOR_TOKENS, readSdTokens };
|
|
25
|
+
export type { SdColorToken };
|