@sdcorejs/angular 20.1.5 → 20.2.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/README.md +12 -4
- package/assets/scss/core/menu.scss +18 -0
- package/assets/scss/core/utilities/_misc.scss +15 -0
- package/assets/scss/sd-core.scss +1 -0
- package/components/anchor/index.d.ts +3 -1
- package/components/badge/index.d.ts +1 -0
- package/components/ckeditor-styles/index.d.ts +1 -1
- package/components/form-generic/index.d.ts +44 -33
- package/components/import-excel/index.d.ts +1 -0
- package/components/index.d.ts +6 -1
- package/components/mini-editor/index.d.ts +1 -1
- package/components/modal/index.d.ts +3 -2
- package/components/modal-resizable/index.d.ts +92 -0
- package/components/org-chart/index.d.ts +6 -0
- package/components/preview/index.d.ts +1 -0
- package/components/query-bar/index.d.ts +55 -17
- package/components/query-builder/index.d.ts +150 -98
- package/components/section/index.d.ts +3 -0
- package/components/tab-router/index.d.ts +19 -19
- package/components/table/index.d.ts +252 -110
- package/components/tree/index.d.ts +48 -30
- package/components/upload-file/index.d.ts +6 -3
- package/configurations/index.d.ts +1 -2
- package/fesm2022/sdcorejs-angular-components-anchor.mjs +37 -13
- package/fesm2022/sdcorejs-angular-components-anchor.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-badge.mjs +15 -2
- package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-code-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-data-state.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-editor.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +324 -192
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-history.mjs +4 -4
- package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs +13 -5
- package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-inform.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +164 -8
- package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-modal.mjs +30 -18
- package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs +60 -13
- package/fesm2022/sdcorejs-angular-components-org-chart.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +58 -19
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs +192 -30
- package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs +187 -127
- package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-section.mjs +16 -2
- package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +83 -24
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-splitter.mjs +57 -21
- package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-stepper.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-stepper.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +68 -20
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +3 -2
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +557 -255
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tree.mjs +80 -17
- package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs +48 -13
- package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +6 -1
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-directives.mjs +45 -8
- package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +40 -29
- package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +5 -5
- package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +67 -50
- package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-chip.mjs +57 -43
- package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs +234 -64
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +209 -42
- package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs +131 -27
- package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +40 -16
- package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs +16 -5
- package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs +24 -9
- package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-input.mjs +58 -10
- package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-models.mjs +279 -6
- package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-radio.mjs +4 -4
- package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +136 -38
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-switch.mjs +18 -3
- package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs +51 -62
- package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs +57 -12
- package/fesm2022/sdcorejs-angular-forms-time-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-time.mjs +16 -5
- package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +100 -9
- package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms.mjs +91 -46
- package/fesm2022/sdcorejs-angular-forms.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-handlers.mjs +18 -3
- package/fesm2022/sdcorejs-angular-handlers.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +510 -68
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-interceptors.mjs +87 -29
- package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-auth.mjs +25 -15
- package/fesm2022/sdcorejs-angular-modules-auth.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +2 -2
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-keycloak.mjs +32 -3
- package/fesm2022/sdcorejs-angular-modules-keycloak.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +441 -135
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-permission.mjs +177 -40
- package/fesm2022/sdcorejs-angular-modules-permission.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-pipes.mjs +62 -28
- package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-api.mjs +123 -13
- package/fesm2022/sdcorejs-angular-services-api.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-cache.mjs +53 -3
- package/fesm2022/sdcorejs-angular-services-cache.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-confirm.mjs +25 -73
- package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-excel.mjs +12 -10
- package/fesm2022/sdcorejs-angular-services-excel.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-loading.mjs +75 -84
- package/fesm2022/sdcorejs-angular-services-loading.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-notify.mjs +46 -5
- package/fesm2022/sdcorejs-angular-services-notify.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services-storage.mjs +4 -0
- package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-services.mjs +0 -1
- package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs +225 -80
- package/fesm2022/sdcorejs-angular-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-utilities-models.mjs +1 -63
- package/fesm2022/sdcorejs-angular-utilities-models.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular.mjs +17 -10
- package/fesm2022/sdcorejs-angular.mjs.map +1 -1
- package/forms/autocomplete/index.d.ts +5 -2
- package/forms/chip-calendar/index.d.ts +10 -0
- package/forms/date/index.d.ts +21 -3
- package/forms/date-range/index.d.ts +14 -2
- package/forms/datetime/index.d.ts +13 -2
- package/forms/entity-picker/index.d.ts +9 -3
- package/forms/index.d.ts +22 -13
- package/forms/input/index.d.ts +3 -0
- package/forms/input-color/index.d.ts +4 -0
- package/forms/input-number/index.d.ts +3 -0
- package/forms/models/index.d.ts +146 -5
- package/forms/select/index.d.ts +27 -4
- package/forms/switch/index.d.ts +7 -1
- package/forms/textarea/index.d.ts +5 -3
- package/forms/time-range/index.d.ts +22 -1
- package/forms/tree-select/index.d.ts +36 -5
- package/i18n/index.d.ts +99 -16
- package/index.d.ts +11 -2
- package/interceptors/index.d.ts +13 -3
- package/modules/auth/index.d.ts +1 -1
- package/modules/keycloak/index.d.ts +1 -0
- package/modules/layout/index.d.ts +103 -28
- package/modules/permission/index.d.ts +66 -4
- package/package.json +40 -25
- package/pipes/index.d.ts +27 -5
- package/services/api/index.d.ts +21 -1
- package/services/cache/index.d.ts +11 -1
- package/services/index.d.ts +0 -1
- package/services/notify/index.d.ts +1 -1
- package/utilities/extensions/index.d.ts +83 -61
- package/utilities/models/index.d.ts +2 -76
- package/components/base/index.d.ts +0 -11
- package/components/document-builder/index.d.ts +0 -252
- package/fesm2022/sdcorejs-angular-components-base.mjs +0 -23
- package/fesm2022/sdcorejs-angular-components-base.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs +0 -5038
- package/fesm2022/sdcorejs-angular-components-document-builder.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-models.mjs +0 -6
- package/fesm2022/sdcorejs-angular-models.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-services-docx.mjs +0 -291
- package/fesm2022/sdcorejs-angular-services-docx.mjs.map +0 -1
- package/fesm2022/sdcorejs-angular-services-license.mjs +0 -97
- package/fesm2022/sdcorejs-angular-services-license.mjs.map +0 -1
- package/models/index.d.ts +0 -2
- package/services/docx/index.d.ts +0 -27
- package/services/license/index.d.ts +0 -12
package/README.md
CHANGED
|
@@ -21,6 +21,16 @@ Install the package major that matches your Angular application.
|
|
|
21
21
|
|
|
22
22
|
The package manifests accept Angular 19–21 peers, while releases provide an Angular-aligned package line for each major. The first version number is reserved for Angular compatibility, so read the [changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md) for explicitly labeled breaking changes before upgrading.
|
|
23
23
|
|
|
24
|
+
### Peer dependencies
|
|
25
|
+
|
|
26
|
+
The package declares these peers. A standard Angular CLI application already provides all of them except `@angular/material` and `@angular/material-date-fns-adapter`, which is why only those two appear in the install commands above.
|
|
27
|
+
|
|
28
|
+
| Peer | Range |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| `@angular/animations` · `@angular/cdk` · `@angular/common` · `@angular/core` · `@angular/forms` · `@angular/platform-browser` · `@angular/router` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
|
|
31
|
+
| `@angular/material` · `@angular/material-date-fns-adapter` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
|
|
32
|
+
| `rxjs` | `^7.8.0` |
|
|
33
|
+
|
|
24
34
|
## Installation and setup
|
|
25
35
|
|
|
26
36
|
The examples below use Angular 19; replace `19` with your application's Angular major.
|
|
@@ -176,17 +186,15 @@ export const appConfig: ApplicationConfig = {
|
|
|
176
186
|
| [Versions registry](https://sdcorejs.github.io/sdcorejs-angular/docs/versions.json) | Select docs matching an installed package version |
|
|
177
187
|
| [Machine-readable catalog](https://sdcorejs.github.io/sdcorejs-angular/docs/catalog.json) | Discover documentation across maintained package lines |
|
|
178
188
|
| [E2E attributes](https://github.com/sdcorejs/sdcorejs-angular/blob/main/versions/v19/projects/sdcorejs-angular/docs/E2E-ATTRIBUTES.md) | Stable runtime selectors and state attributes |
|
|
179
|
-
| [
|
|
180
|
-
| [1.4 migration guide](https://github.com/sdcorejs/sdcorejs-angular/blob/main/docs/migrations/1.4.md) | Dedupe, loading, persistence, connector, responsive, and signal migrations |
|
|
189
|
+
| [Release notes for this version](https://sdcorejs.github.io/sdcorejs-angular/docs/latest/CHANGELOG.md) | What changed in this release and how it differs from the previous one |
|
|
181
190
|
|
|
182
191
|
## Versioning
|
|
183
192
|
|
|
184
193
|
- Use `@sdcorejs/angular@^19`, `@^20`, or `@^21` to match the application's Angular major.
|
|
185
194
|
- Maintained package lines are released from the same feature surface with required Angular-major adaptations.
|
|
186
195
|
- Consumer-breaking changes and migration notes are recorded in the [changelog](https://github.com/sdcorejs/sdcorejs-angular/blob/main/CHANGELOG.md).
|
|
187
|
-
- Before adopting the `1.5` suffix, follow the [1.5 migration guide](https://github.com/sdcorejs/sdcorejs-angular/blob/main/docs/migrations/1.5.md).
|
|
188
|
-
- Before adopting the `1.4` suffix, follow the [1.4 migration guide](https://github.com/sdcorejs/sdcorejs-angular/blob/main/docs/migrations/1.4.md).
|
|
189
196
|
- Version-pinned reference docs remain available under `https://sdcorejs.github.io/sdcorejs-angular/docs/<package-version>/`.
|
|
197
|
+
- Every published version is self-contained: `docs/<package-version>/CHANGELOG.md` carries that release's notes and a source diff link against the previous release.
|
|
190
198
|
|
|
191
199
|
## Contributing
|
|
192
200
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// why: Material tạo khoảng cách giữa leading icon và nhãn của menu item bằng `margin-right` đặt trên
|
|
2
|
+
// `.mat-icon`. Với `<sd-icon>` thì `.mat-icon` nằm BÊN TRONG host, nên margin đó không đẩy nhãn ra —
|
|
3
|
+
// nó chỉ làm glyph lệch và bị xén trong host (sd-icon đã trung hoà margin đó ở cấp component). Rule
|
|
4
|
+
// dưới đây trả khoảng cách về đúng cấp: host `<sd-icon>` khi nó là icon dẫn đầu của menu item.
|
|
5
|
+
//
|
|
6
|
+
// Đặt ở cấp host nên Material font icon và Lucide SVG hành xử giống hệt nhau — Lucide không render
|
|
7
|
+
// `.mat-icon` nên trước đây không nhận được khoảng cách nào từ Material.
|
|
8
|
+
//
|
|
9
|
+
// Chỉ nhắm con TRỰC TIẾP: menu tự bọc icon trong wrapper flex có `gap` riêng (sd-table command,
|
|
10
|
+
// sd-tree command) không được cộng thêm margin. Angular slot nội dung không phải `mat-icon` vào
|
|
11
|
+
// trong `.mat-mdc-menu-item-text`, nên phải liệt kê cả hai cấp.
|
|
12
|
+
//
|
|
13
|
+
// Bọc trong `:where()` để specificity bằng 0: bất kỳ rule nào của menu cụ thể — kể cả một class đơn —
|
|
14
|
+
// cũng thắng, nên đây là default an toàn chứ không phải thứ phải đi vá bằng `!important`.
|
|
15
|
+
:where(.mat-mdc-menu-item > sd-icon:first-child),
|
|
16
|
+
:where(.mat-mdc-menu-item > .mat-mdc-menu-item-text > sd-icon:first-child) {
|
|
17
|
+
margin-right: var(--mat-menu-item-spacing, 12px);
|
|
18
|
+
}
|
|
@@ -18,3 +18,18 @@
|
|
|
18
18
|
// --------------------------------------------------------------------------
|
|
19
19
|
.visible { visibility: visible !important; }
|
|
20
20
|
.invisible { visibility: hidden !important; }
|
|
21
|
+
|
|
22
|
+
// --------------------------------------------------------------------------
|
|
23
|
+
// Screen-reader-only text (visually hidden, still in the accessibility tree)
|
|
24
|
+
// --------------------------------------------------------------------------
|
|
25
|
+
.sd-visually-hidden {
|
|
26
|
+
position: absolute !important;
|
|
27
|
+
width: 1px !important;
|
|
28
|
+
height: 1px !important;
|
|
29
|
+
padding: 0 !important;
|
|
30
|
+
margin: -1px !important;
|
|
31
|
+
overflow: hidden !important;
|
|
32
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
33
|
+
white-space: nowrap !important;
|
|
34
|
+
border: 0 !important;
|
|
35
|
+
}
|
package/assets/scss/sd-core.scss
CHANGED
|
@@ -30,13 +30,15 @@ declare class SdAnchor implements OnDestroy {
|
|
|
30
30
|
ellipsis: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
31
31
|
overScroll: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
32
32
|
hideNav: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
33
|
+
hideNavOnMobile: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
33
34
|
color: _angular_core.InputSignal<Color>;
|
|
35
|
+
readonly navHidden: _angular_core.Signal<boolean>;
|
|
34
36
|
activeSectionId: _angular_core.WritableSignal<string>;
|
|
35
37
|
constructor();
|
|
36
38
|
scrollSectionByClick(idSectionTarget: string): void;
|
|
37
39
|
ngOnDestroy(): void;
|
|
38
40
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdAnchor, never>;
|
|
39
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdAnchor, "sd-anchor", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "overScroll": { "alias": "overScroll"; "required": false; "isSignal": true; }; "hideNav": { "alias": "hideNav"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, ["sections"], ["*"], true, never>;
|
|
41
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdAnchor, "sd-anchor", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "overScroll": { "alias": "overScroll"; "required": false; "isSignal": true; }; "hideNav": { "alias": "hideNav"; "required": false; "isSignal": true; }; "hideNavOnMobile": { "alias": "hideNavOnMobile"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, ["sections"], ["*"], true, never>;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
export { SdAnchor, SdAnchorItem };
|
|
@@ -22,6 +22,7 @@ declare class SdBadge {
|
|
|
22
22
|
size: _angular_core.InputSignalWithTransform<Size, Size | null | undefined>;
|
|
23
23
|
readonly click: EventEmitter<Event>;
|
|
24
24
|
onClick: (event: Event) => void;
|
|
25
|
+
onActivateKey: (event: Event) => void;
|
|
25
26
|
effectiveColor: _angular_core.Signal<Color>;
|
|
26
27
|
baseColorClasses: _angular_core.Signal<{
|
|
27
28
|
'c-primary': boolean;
|
|
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
|
|
|
7
7
|
* - CKEditor's CSS must be global (applies to body-rendered overlays, dialogs, balloons),
|
|
8
8
|
* which means whichever Angular component declares it must use ViewEncapsulation.None.
|
|
9
9
|
* - Switching encapsulation on the main editor components (`<sd-editor>`, `<sd-mini-editor>`,
|
|
10
|
-
* `<sd-
|
|
10
|
+
* `<sd-mini-editor>`) would un-scope all their local styles too.
|
|
11
11
|
* - Instead, this tiny no-render component owns the global CSS. The editor components embed
|
|
12
12
|
* `<sd-ckeditor-styles>` at the top of their template; the CSS is injected once into <head>
|
|
13
13
|
* the first time any editor instance mounts. Editor components themselves keep
|
|
@@ -3,7 +3,7 @@ import { InjectionToken, OnDestroy, OnInit, AfterViewInit, QueryList } from '@an
|
|
|
3
3
|
import { SdSearch, SdCustomValidator } from '@sdcorejs/angular/forms/models';
|
|
4
4
|
import { SdTableColumn, SdTableOption, SdTable } from '@sdcorejs/angular/components/table';
|
|
5
5
|
import { SdUploadFile } from '@sdcorejs/angular/components/upload-file';
|
|
6
|
-
import { Operator
|
|
6
|
+
import { Operator, ValidationPatternType, Color } from '@sdcorejs/utils/models';
|
|
7
7
|
import { SdUnwrapSignal } from '@sdcorejs/angular/utilities/models';
|
|
8
8
|
import { CdkDropList, CdkDragMove, CdkDragDrop, CdkDragEnter, CdkDragSortEvent, CdkDrag } from '@angular/cdk/drag-drop';
|
|
9
9
|
import { FormGroup } from '@angular/forms';
|
|
@@ -17,7 +17,7 @@ type SdFormRenderEntity = Record<string, any> & {
|
|
|
17
17
|
sdRaw?: Record<string, any>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
interface SdFormGenericSelectionItem<T =
|
|
20
|
+
interface SdFormGenericSelectionItem<T = unknown> {
|
|
21
21
|
value: string;
|
|
22
22
|
display: string;
|
|
23
23
|
disabled?: boolean;
|
|
@@ -28,8 +28,8 @@ interface SdFormGenericSelectionStaticItem {
|
|
|
28
28
|
value: string;
|
|
29
29
|
label: string;
|
|
30
30
|
}
|
|
31
|
-
type SdFormGenericDefinitionSelection<T =
|
|
32
|
-
interface SelectionVariables<T =
|
|
31
|
+
type SdFormGenericDefinitionSelection<T = unknown, TArgs = unknown> = SelectionValues<T> | SelectionLazyValues<T> | SelectionValuesKey<TArgs> | SelectionLazyValuesKey<TArgs>;
|
|
32
|
+
interface SelectionVariables<T = unknown> {
|
|
33
33
|
items?: {
|
|
34
34
|
value: Extract<keyof T, string>;
|
|
35
35
|
display: string;
|
|
@@ -57,10 +57,10 @@ interface SelectionLazyValuesKey<TArgs> extends SelecttionBase {
|
|
|
57
57
|
lazyValuesKey: string;
|
|
58
58
|
args?: TArgs;
|
|
59
59
|
}
|
|
60
|
-
interface SelectionValues<T =
|
|
60
|
+
interface SelectionValues<T = unknown> extends SelecttionBase {
|
|
61
61
|
values: (args: SdFormGenericArgs) => Promise<SdFormGenericSelectionItem<T>[]>;
|
|
62
62
|
}
|
|
63
|
-
interface SelectionLazyValues<T =
|
|
63
|
+
interface SelectionLazyValues<T = unknown> extends SelecttionBase {
|
|
64
64
|
lazyValues: (searchArgs: Parameters<SdSearch>[0], args: SdFormGenericArgs) => Promise<SdFormGenericSelectionItem<T>[]>;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -74,13 +74,13 @@ interface SdFormGenericExpressionCondition {
|
|
|
74
74
|
key: string;
|
|
75
75
|
type: 'condition';
|
|
76
76
|
field?: string;
|
|
77
|
-
operator: Operator
|
|
77
|
+
operator: Operator;
|
|
78
78
|
value: any;
|
|
79
79
|
dayInfo: DayInfo;
|
|
80
80
|
}
|
|
81
|
-
type
|
|
82
|
-
declare const
|
|
83
|
-
value:
|
|
81
|
+
type SdFormGenericOperator = 'EQUAL' | 'NOT_EQUAL' | 'GREATER_THAN' | 'LESS_THAN' | 'GREATER_OR_EQUAL' | 'LESS_OR_EQUAL' | 'NULL' | 'NOT_NULL';
|
|
82
|
+
declare const SdFormGenericOperators: {
|
|
83
|
+
value: SdFormGenericOperator;
|
|
84
84
|
symbol?: string;
|
|
85
85
|
display: string;
|
|
86
86
|
}[];
|
|
@@ -107,16 +107,16 @@ interface DayInfo {
|
|
|
107
107
|
related?: 'LASTDAY' | 'NEXTDAY' | 'LASTWEEK' | 'NEXTWEEK' | 'LASTMONTH' | 'NEXTMONTH';
|
|
108
108
|
relatedValue?: number;
|
|
109
109
|
}
|
|
110
|
-
declare const
|
|
110
|
+
declare const SD_DAY_INFO_TYPES: {
|
|
111
111
|
value: string;
|
|
112
112
|
display: string;
|
|
113
113
|
}[];
|
|
114
|
-
declare const
|
|
114
|
+
declare const SD_DAY_INFO_PREVIOUSES: {
|
|
115
115
|
value: string;
|
|
116
116
|
display: string;
|
|
117
117
|
format: (n: number) => string;
|
|
118
118
|
}[];
|
|
119
|
-
declare const
|
|
119
|
+
declare const sdGetDatetimeValue: (value: string) => string | undefined;
|
|
120
120
|
interface AttributeValues {
|
|
121
121
|
value: string;
|
|
122
122
|
display: string;
|
|
@@ -126,20 +126,24 @@ interface AttributeValues {
|
|
|
126
126
|
display: string;
|
|
127
127
|
}[];
|
|
128
128
|
}
|
|
129
|
-
declare const
|
|
130
|
-
value:
|
|
129
|
+
declare const SD_ATTRIBUTE_OPERATORS: Record<Attribute['type'], {
|
|
130
|
+
value: SdFormGenericOperator;
|
|
131
131
|
symbol?: string;
|
|
132
132
|
display: string;
|
|
133
133
|
}[]>;
|
|
134
|
-
declare const
|
|
135
|
-
declare const
|
|
136
|
-
declare const
|
|
137
|
-
declare const
|
|
134
|
+
declare const sdGetAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => Attribute[];
|
|
135
|
+
declare const sdTemplateToCondition: (template: string | undefined | null, entity: Record<string, any>) => string | undefined;
|
|
136
|
+
declare const sdEvaluateExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition, entity: Record<string, any>) => boolean | undefined;
|
|
137
|
+
declare const sdExpressionToJavascriptExpression: (condition: SdFormGenericExpression | SdFormGenericExpressionCondition) => string | undefined;
|
|
138
138
|
|
|
139
139
|
type SdFormGenericValidation = ValidationExpression | ValidationFunction;
|
|
140
140
|
interface ValidationBase {
|
|
141
141
|
alert: 'warning' | 'error';
|
|
142
142
|
}
|
|
143
|
+
declare const ValidationAlerts: {
|
|
144
|
+
value: string;
|
|
145
|
+
display: string;
|
|
146
|
+
}[];
|
|
143
147
|
interface ValidationExpression extends ValidationBase {
|
|
144
148
|
type: 'expression';
|
|
145
149
|
expression: SdFormGenericExpression;
|
|
@@ -179,9 +183,9 @@ interface SdFormGenericLayout {
|
|
|
179
183
|
columns: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
180
184
|
mobileColumns?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10' | '11' | '12' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
181
185
|
}
|
|
182
|
-
declare const
|
|
183
|
-
declare const
|
|
184
|
-
declare const
|
|
186
|
+
declare const sdGenerateId: () => string;
|
|
187
|
+
declare const sdGenerateKey: () => string;
|
|
188
|
+
declare const sdFormatComponent: (component: SdFormGenericComponent | SdFormGenericGroup) => void;
|
|
185
189
|
interface SdFormGenericVariable {
|
|
186
190
|
id: string;
|
|
187
191
|
key: string;
|
|
@@ -333,7 +337,7 @@ interface FormRenderComponentTableColumnValues {
|
|
|
333
337
|
query?: Record<string, any>;
|
|
334
338
|
}
|
|
335
339
|
type SdFormGenericTableColumn<T = any> = TableColumnString<T> | TableColumnNumber<T> | TableColumnBool<T> | TableColumnDate<T> | TableColumnDatetime<T> | TableColumnRadio<T> | TableColumnValues<T> | TableColumnImage<T> | TableColumnFile<T>;
|
|
336
|
-
declare const
|
|
340
|
+
declare const SD_TABLE_COLUMN_TYPES: {
|
|
337
341
|
value: string;
|
|
338
342
|
display: string;
|
|
339
343
|
}[];
|
|
@@ -463,17 +467,17 @@ interface FormBuilderComponent {
|
|
|
463
467
|
group: FormBuilderComponentGroup;
|
|
464
468
|
name: string;
|
|
465
469
|
}
|
|
466
|
-
declare const
|
|
470
|
+
declare const SD_FORM_BUILDER_COMPONENTS: FormBuilderComponent[];
|
|
467
471
|
/** Lookup: component type → Material icon + label, used by attribute panel header. */
|
|
468
|
-
declare const
|
|
472
|
+
declare const SD_COMPONENT_ICONS: Record<string, {
|
|
469
473
|
symbol: string;
|
|
470
474
|
label: string;
|
|
471
475
|
}>;
|
|
472
|
-
declare const
|
|
476
|
+
declare const sdGetComponentAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => {
|
|
473
477
|
value: string;
|
|
474
478
|
display: string;
|
|
475
479
|
}[];
|
|
476
|
-
declare const
|
|
480
|
+
declare const sdGetVariableAttributes: (variables: SdFormGenericVariable[]) => {
|
|
477
481
|
value: string;
|
|
478
482
|
display: string;
|
|
479
483
|
}[];
|
|
@@ -525,7 +529,7 @@ interface SdFormGenericDefinitionHtmlQuery {
|
|
|
525
529
|
}[];
|
|
526
530
|
}
|
|
527
531
|
|
|
528
|
-
interface IWorkflowConfigurationForm<TSelectionArgs =
|
|
532
|
+
interface IWorkflowConfigurationForm<TSelectionArgs = unknown> {
|
|
529
533
|
templates: SdFormGenericTemplate[];
|
|
530
534
|
selections: SdFormGenericDefinitionSelection<any, TSelectionArgs>[] | (() => SdFormGenericDefinitionSelection<any, TSelectionArgs>[]) | (() => Promise<SdFormGenericDefinitionSelection[]>);
|
|
531
535
|
getValues?: (key: string, selectionArgs?: TSelectionArgs) => Promise<SdFormGenericSelectionItem[]>;
|
|
@@ -595,7 +599,7 @@ declare class TableComponent implements AfterViewInit, OnDestroy, OnInit {
|
|
|
595
599
|
readonly modelChange: _angular_core.OutputEmitterRef<any[]>;
|
|
596
600
|
tableOption?: SdTableOption;
|
|
597
601
|
row: any;
|
|
598
|
-
columnValues: Record<string, SdFormGenericSelectionItem[] | SdSearch$1
|
|
602
|
+
columnValues: Record<string, SdFormGenericSelectionItem[] | SdSearch$1<SdFormGenericSelectionItem>>;
|
|
599
603
|
formRenderColumn: Record<string, SdFormGenericTableColumn>;
|
|
600
604
|
fileKeys: string[];
|
|
601
605
|
imageKeys: string[];
|
|
@@ -604,6 +608,11 @@ declare class TableComponent implements AfterViewInit, OnDestroy, OnInit {
|
|
|
604
608
|
ngOnInit(): void;
|
|
605
609
|
ngAfterViewInit(): void;
|
|
606
610
|
ngOnDestroy(): void;
|
|
611
|
+
/**
|
|
612
|
+
* Tiêu đề của side-drawer phải nói đúng tác vụ đang làm — trước đây nó cứng là "Chi tiết" cho cả
|
|
613
|
+
* thêm mới lẫn sửa, còn dòng "Tạo mới/cập nhật" thì rơi vào thân drawer vì gắn nhầm slot.
|
|
614
|
+
*/
|
|
615
|
+
get detailTitle(): string;
|
|
607
616
|
onDetail: (row?: any) => void;
|
|
608
617
|
onCancel: () => void;
|
|
609
618
|
onAccept: (addable?: boolean) => void;
|
|
@@ -797,7 +806,7 @@ declare class SdFormBuilder implements OnInit, OnDestroy {
|
|
|
797
806
|
placeholderColumnsFor: (item: FormBuilderComponent | SdFormGenericComponent | SdFormGenericGroup | DragDropRowItem | undefined) => number;
|
|
798
807
|
/** True nếu component có expression điều kiện — drives the "conditional" status chip. */
|
|
799
808
|
hasConditional: (item: SdFormGenericComponent | SdFormGenericGroup) => boolean;
|
|
800
|
-
/** Map
|
|
809
|
+
/** Map Color preset → 2 CSS var names cho header-bg và header-fg của group card. */
|
|
801
810
|
groupColorVars: (color: string | undefined | null) => {
|
|
802
811
|
bg: string;
|
|
803
812
|
fg: string;
|
|
@@ -805,6 +814,7 @@ declare class SdFormBuilder implements OnInit, OnDestroy {
|
|
|
805
814
|
/** Segmented Design/Preview toggle (replaces play_circle/stop_circle). */
|
|
806
815
|
setMode: (preview: boolean) => void;
|
|
807
816
|
/** Mở canvas thiết kế riêng cho 1 group (chỉ children của nó). Snapshot để Cancel revert. */
|
|
817
|
+
onEnterGroupEditKeydown: (group: SdFormGenericGroup, event: KeyboardEvent) => void;
|
|
808
818
|
enterGroupEdit: (group: SdFormGenericGroup) => void;
|
|
809
819
|
/** OK: giữ thay đổi children, quay về canvas chính. */
|
|
810
820
|
confirmGroupEdit: () => void;
|
|
@@ -817,6 +827,7 @@ declare class SdFormBuilder implements OnInit, OnDestroy {
|
|
|
817
827
|
/** Xoá component theo scope hiện tại (top-level hoặc children của group đang Detail). */
|
|
818
828
|
removeComponent: (id: string) => void;
|
|
819
829
|
selectComponent: (item?: SdFormGenericComponent | SdFormGenericGroup) => void;
|
|
830
|
+
onPaletteItemKeydown: (item: FormBuilderComponent, event: KeyboardEvent) => void;
|
|
820
831
|
onClickedOutside: (e: any) => void;
|
|
821
832
|
clickFormContentEmpty: () => void;
|
|
822
833
|
drop: (event: CdkDragDrop<any[]>) => void;
|
|
@@ -867,7 +878,7 @@ declare class SdFeelExpression implements OnInit {
|
|
|
867
878
|
modal?: SdModal;
|
|
868
879
|
form: FormGroup<{}>;
|
|
869
880
|
attributeOperators: Record<"string" | "number" | "boolean" | "datetime" | "values", {
|
|
870
|
-
value: _sdcorejs_angular_components_form_generic.
|
|
881
|
+
value: _sdcorejs_angular_components_form_generic.SdFormGenericOperator;
|
|
871
882
|
symbol?: string;
|
|
872
883
|
display: string;
|
|
873
884
|
}[]>;
|
|
@@ -905,5 +916,5 @@ declare class SdFormRenderService {
|
|
|
905
916
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<SdFormRenderService>;
|
|
906
917
|
}
|
|
907
918
|
|
|
908
|
-
export {
|
|
909
|
-
export type { Attribute, DayInfo, FormBuilderComponent, FormBuilderComponentGroup, FormRenderComponentTableColumnValues, ISdFormGenericConfiguration, IWorkflowConfigurationForm,
|
|
919
|
+
export { SD_ATTRIBUTE_OPERATORS, SD_COMPONENT_ICONS, SD_DAY_INFO_PREVIOUSES, SD_DAY_INFO_TYPES, SD_FORM_BUILDER_COMPONENTS, SD_FORM_GENERIC_CONFIGURATION, SD_TABLE_COLUMN_TYPES, SdFeelExpression, SdFormBuilder, SdFormGenericOperators, SdFormRender, SdFormRenderService, ValidationAlerts, sdEvaluateExpression, sdExpressionToJavascriptExpression, sdFormatComponent, sdGenerateId, sdGenerateKey, sdGetAttributes, sdGetComponentAttributes, sdGetDatetimeValue, sdGetVariableAttributes, sdTemplateToCondition };
|
|
920
|
+
export type { Attribute, DayInfo, FormBuilderComponent, FormBuilderComponentGroup, FormRenderComponentTableColumnValues, ISdFormGenericConfiguration, IWorkflowConfigurationForm, SdFormGeneric, SdFormGenericArgs, SdFormGenericBreak, SdFormGenericCheckbox, SdFormGenericChecklist, SdFormGenericChipCalendar, SdFormGenericChipString, SdFormGenericComponent, SdFormGenericComponentBase, SdFormGenericDatetime, SdFormGenericDefinitionHtml, SdFormGenericDefinitionSelection, SdFormGenericDefinitionTable, SdFormGenericExpression, SdFormGenericExpressionCondition, SdFormGenericGroup, SdFormGenericHtml, SdFormGenericLayout, SdFormGenericNumber, SdFormGenericOperator, SdFormGenericRadio, SdFormGenericSelect, SdFormGenericSelectionItem, SdFormGenericSelectionStaticItem, SdFormGenericTable, SdFormGenericTableColumn, SdFormGenericTemplate, SdFormGenericTextarea, SdFormGenericTextfield, SdFormGenericUpload, SdFormGenericValidation, SdFormGenericValidationConfiguration, SdFormGenericValidationFunction, SdFormGenericValues, SdFormGenericVariable, SdFormRenderConfiguration, SdFormRenderEntity };
|
|
@@ -139,6 +139,7 @@ declare class SdImportExcel implements OnInit, OnDestroy {
|
|
|
139
139
|
accept: () => void;
|
|
140
140
|
setValidation: (validations: SdImportExcelValidation[]) => void;
|
|
141
141
|
view: (showing?: "ALL" | "SUCCESS" | "WARNING" | "ERROR") => void;
|
|
142
|
+
onDownloadTemplateKeydown: (event: KeyboardEvent) => void;
|
|
142
143
|
downloadTemplate: () => Promise<void>;
|
|
143
144
|
export: () => Promise<void>;
|
|
144
145
|
onClosed: () => void;
|
package/components/index.d.ts
CHANGED
|
@@ -11,12 +11,12 @@ export * from '@sdcorejs/angular/components/query-bar';
|
|
|
11
11
|
export * from '@sdcorejs/angular/components/upload-file';
|
|
12
12
|
export * from '@sdcorejs/angular/components/section';
|
|
13
13
|
export * from '@sdcorejs/angular/components/inform';
|
|
14
|
+
export * from '@sdcorejs/angular/components/form-generic';
|
|
14
15
|
export * from '@sdcorejs/angular/components/anchor';
|
|
15
16
|
export * from '@sdcorejs/angular/components/query-builder';
|
|
16
17
|
export * from '@sdcorejs/angular/components/org-chart';
|
|
17
18
|
export * from '@sdcorejs/angular/components/tree';
|
|
18
19
|
export * from '@sdcorejs/angular/components/import-excel';
|
|
19
|
-
export * from '@sdcorejs/angular/components/document-builder';
|
|
20
20
|
export * from '@sdcorejs/angular/components/mini-editor';
|
|
21
21
|
export * from '@sdcorejs/angular/components/view';
|
|
22
22
|
export * from '@sdcorejs/angular/components/code-editor';
|
|
@@ -29,3 +29,8 @@ export * from '@sdcorejs/angular/components/breadcrumb';
|
|
|
29
29
|
export * from '@sdcorejs/angular/components/data-state';
|
|
30
30
|
export * from '@sdcorejs/angular/components/job-progress';
|
|
31
31
|
export * from '@sdcorejs/angular/components/audit-diff';
|
|
32
|
+
export * from '@sdcorejs/angular/components/ckeditor-styles';
|
|
33
|
+
export * from '@sdcorejs/angular/components/history';
|
|
34
|
+
export * from '@sdcorejs/angular/components/operator';
|
|
35
|
+
export * from '@sdcorejs/angular/components/stepper';
|
|
36
|
+
export * from '@sdcorejs/angular/components/tab';
|
|
@@ -18,7 +18,7 @@ interface SdMiniEditorMentionConfig {
|
|
|
18
18
|
attributes?: Record<string, string>;
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
type SdMiniEditorMentionItem<T =
|
|
21
|
+
type SdMiniEditorMentionItem<T = unknown> = MentionFeedObjectItem & {
|
|
22
22
|
data?: T;
|
|
23
23
|
};
|
|
24
24
|
interface SdMiniEditorOption {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, ElementRef } from '@angular/core';
|
|
2
|
+
import { OnDestroy, TemplateRef, ElementRef } from '@angular/core';
|
|
3
3
|
import { Color } from '@sdcorejs/utils/models';
|
|
4
4
|
|
|
5
5
|
type SdModalBeforeClose = () => boolean | Promise<boolean>;
|
|
6
|
-
declare class SdModal {
|
|
6
|
+
declare class SdModal implements OnDestroy {
|
|
7
7
|
#private;
|
|
8
8
|
static index: _angular_core.WritableSignal<number>;
|
|
9
9
|
templateRef: _angular_core.Signal<TemplateRef<any>>;
|
|
@@ -27,6 +27,7 @@ declare class SdModal {
|
|
|
27
27
|
isOpened: _angular_core.WritableSignal<boolean>;
|
|
28
28
|
alreadyOpened: _angular_core.WritableSignal<boolean>;
|
|
29
29
|
constructor();
|
|
30
|
+
ngOnDestroy(): void;
|
|
30
31
|
open: () => void;
|
|
31
32
|
close: () => void;
|
|
32
33
|
requestClose: () => Promise<boolean>;
|
|
@@ -1,12 +1,94 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { CdkPortal } from '@angular/cdk/portal';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* `<sd-modal-resizable>` — right-docked, non-modal panel that can be minimized, expanded or pushed
|
|
6
|
+
* fullscreen. Several panels stack side by side along the right edge of the viewport, so the user
|
|
7
|
+
* can keep multiple records open at once while still working with the page behind them.
|
|
8
|
+
*
|
|
9
|
+
* Use it for side-by-side comparison / inspector workflows. Use `<sd-modal>` when the task is
|
|
10
|
+
* blocking, and `<sd-side-drawer>` when a single overlay with a backdrop is enough.
|
|
11
|
+
*
|
|
12
|
+
* NOTE ON DOCS: this component deliberately has **no** sibling `sd-modal-resizable.md`. Every `*.md`
|
|
13
|
+
* under the library is swept into `published-docs/<version>/index.json` by `scripts/collect-docs.mjs`,
|
|
14
|
+
* and `scripts/generate-showcase-example-sources.test.mjs` asserts that list is 1:1 with the
|
|
15
|
+
* `publishedDocId` set in the showcase documentation registry. A published doc with no showcase page
|
|
16
|
+
* therefore turns that release guard red. Keep the reference here until the component ships a
|
|
17
|
+
* showcase demo + registry entry; only then add the `.md`.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* import { SdModalResizable } from '@sdcorejs/angular/components/modal-resizable';
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <sd-button title="Open detail" type="fill" color="primary" (click)="panel.open()"></sd-button>
|
|
25
|
+
*
|
|
26
|
+
* <sd-modal-resizable #panel width="520px">
|
|
27
|
+
* <span sdTitle>Đơn hàng #1024</span>
|
|
28
|
+
*
|
|
29
|
+
* <div sdBody class="panel-body">
|
|
30
|
+
* <sd-section icon="receipt" title="Thông tin chung">
|
|
31
|
+
* <sd-section-item label="Khách hàng">Nguyen Van An</sd-section-item>
|
|
32
|
+
* </sd-section>
|
|
33
|
+
* </div>
|
|
34
|
+
*
|
|
35
|
+
* <sd-button sdFooterRight type="text" title="Đóng" (click)="panel.close()"></sd-button>
|
|
36
|
+
* </sd-modal-resizable>
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* ### Slots
|
|
40
|
+
* | Selector | Where it renders |
|
|
41
|
+
* | ----------------- | ------------------------- |
|
|
42
|
+
* | `[sdTitle]` | Header title area. |
|
|
43
|
+
* | `[sdBody]` | Scrollable content area. |
|
|
44
|
+
* | `[sdFooterLeft]` | Footer left action group. |
|
|
45
|
+
* | `[sdFooterRight]` | Footer right action group.|
|
|
46
|
+
*
|
|
47
|
+
* Header, body and footer only render while the panel is open.
|
|
48
|
+
*
|
|
49
|
+
* ### Panel stacking
|
|
50
|
+
* The panel is portalled onto `document.body` (via `CdkPortal` + `DomPortalOutlet`), so laying panels
|
|
51
|
+
* out is a concern shared by all live instances rather than by a single view. Arrangement is scoped
|
|
52
|
+
* through the root-provided `SdModalResizableRegistry`: each instance registers its panel id on
|
|
53
|
+
* construction and unregisters it on destroy. `open`, `close`, `minimize`, `maximize` and
|
|
54
|
+
* `toggleMaximum` re-run the arrangement and rewrite inline `width` / `right` **only on registered,
|
|
55
|
+
* still-mounted panels**, in registration order. Consequences worth knowing:
|
|
56
|
+
* - Markup of your own that happens to carry the `.modal-resizable` class is **not** touched.
|
|
57
|
+
* (Earlier builds ran `document.querySelectorAll('.modal-resizable')` and rewrote every match.)
|
|
58
|
+
* - A destroyed panel immediately stops taking up a slot for the instances that outlive it.
|
|
59
|
+
* - Panels marked `c-closed`, and expanded panels with no captured `data-width`, are skipped.
|
|
60
|
+
*
|
|
61
|
+
* ### Lifecycle / teardown
|
|
62
|
+
* `open()`, `close()` and the arrangement pass each schedule a short `setTimeout` (100ms / 100ms /
|
|
63
|
+
* 200ms) that mutates DOM. All of them are tracked and cleared in `DestroyRef.onDestroy`, together
|
|
64
|
+
* with unregistering from the registry and destroying the portal view. Destroying the component
|
|
65
|
+
* mid-animation cannot run layout work against a detached panel.
|
|
66
|
+
*
|
|
67
|
+
* ### Anti-patterns
|
|
68
|
+
* - Rendering it inside a scroll container and expecting it to be clipped — it lives on `<body>`.
|
|
69
|
+
* - Reusing the `.modal-resizable` class on your own elements to "join" the stack; register a real
|
|
70
|
+
* component instead.
|
|
71
|
+
* - Writing inline `width` / `right` on a panel yourself — the next arrangement pass overwrites both.
|
|
72
|
+
*
|
|
73
|
+
* ### Tests
|
|
74
|
+
* `src/modal-resizable.component.spec.ts` — portal attach, open/close/minimize/maximize math,
|
|
75
|
+
* loading, editing, timer teardown, registry scoping. Run:
|
|
76
|
+
* `npx ng test sdcorejs-angular --watch=false --browsers=ChromeHeadless --include='projects/sdcorejs-angular/components/modal-resizable/src/modal-resizable.component.spec.ts'`
|
|
77
|
+
*
|
|
78
|
+
* ### Related
|
|
79
|
+
* `<sd-modal>` (blocking dialog / bottom-sheet), `<sd-side-drawer>` (single right-side overlay with
|
|
80
|
+
* a body scroll lock), `SdLoadingService` (powers `startLoading()` / `stopLoading()`).
|
|
81
|
+
*/
|
|
4
82
|
declare class SdModalResizable {
|
|
5
83
|
#private;
|
|
84
|
+
/** Generated DOM id of the panel element (`I<uuid>`). */
|
|
6
85
|
readonly id: string;
|
|
7
86
|
readonly portal: _angular_core.Signal<CdkPortal>;
|
|
87
|
+
/** Marks the panel as editable. Bare attribute = `true`. Default `false`. */
|
|
8
88
|
readonly editable: _angular_core.InputSignalWithTransform<boolean, boolean | "">;
|
|
89
|
+
/** CSS width used while the panel is expanded (not a minimum). Default `'480px'`. */
|
|
9
90
|
readonly width: _angular_core.InputSignal<string>;
|
|
91
|
+
/** Emitted by `toggleEditable()` with the new editing state. */
|
|
10
92
|
readonly editingChanged: _angular_core.OutputEmitterRef<boolean>;
|
|
11
93
|
readonly isEditing: _angular_core.WritableSignal<boolean>;
|
|
12
94
|
readonly isOpened: _angular_core.WritableSignal<boolean>;
|
|
@@ -15,15 +97,25 @@ declare class SdModalResizable {
|
|
|
15
97
|
readonly isMinimum: _angular_core.WritableSignal<boolean>;
|
|
16
98
|
readonly isMaximum: _angular_core.WritableSignal<boolean>;
|
|
17
99
|
constructor();
|
|
100
|
+
/** Opens the panel, captures its rendered width, and expands it. */
|
|
18
101
|
open: () => void;
|
|
102
|
+
/** Collapses the panel to zero width and stops loading. */
|
|
19
103
|
close: () => void;
|
|
104
|
+
/** Shrinks the panel to the 300px minimum strip. */
|
|
20
105
|
minimize: () => void;
|
|
106
|
+
/** Restores the panel to its expanded width. */
|
|
21
107
|
maximize: () => void;
|
|
108
|
+
/** Toggles fullscreen (`calc(100% - 16px)`). */
|
|
22
109
|
toggleMaximum: () => void;
|
|
110
|
+
/** Drives the scoped loading overlay through `SdLoadingService`. */
|
|
23
111
|
startLoading: () => void;
|
|
112
|
+
/** Stops the scoped loading overlay. */
|
|
24
113
|
stopLoading: () => void;
|
|
114
|
+
/** Flips `isEditing` and emits `editingChanged`. */
|
|
25
115
|
toggleEditable(): void;
|
|
116
|
+
/** Hover state hook bound in the template. */
|
|
26
117
|
onFocus: () => void;
|
|
118
|
+
/** Hover state hook bound in the template. */
|
|
27
119
|
onBlur: () => void;
|
|
28
120
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdModalResizable, never>;
|
|
29
121
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<SdModalResizable, "sd-modal-resizable", never, { "editable": { "alias": "editable"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; }, { "editingChanged": "editingChanged"; }, never, ["[sdTitle]", "[sdBody]", "[sdFooterLeft]", "[sdFooterRight]"], true, never>;
|
|
@@ -54,9 +54,15 @@ declare class SdOrgChart {
|
|
|
54
54
|
readonly resolvedItemTemplate: _angular_core.Signal<TemplateRef<SdOrgChartItemContext<SdOrgChartItem>> | undefined>;
|
|
55
55
|
readonly trackByItem: (_index: number, item: SdOrgChartItem) => string | number;
|
|
56
56
|
hasChildren: (item: SdOrgChartItem) => boolean;
|
|
57
|
+
/** why: trả về hằng số dùng chung thay vì `[]` mới, để leaf không cấp phát mỗi lần CD gọi tới. */
|
|
57
58
|
childrenOf: (item: SdOrgChartItem) => SdOrgChartItem[];
|
|
58
59
|
isExpanded: (item: SdOrgChartItem) => boolean;
|
|
59
60
|
toggle: (item: SdOrgChartItem, event?: Event) => void;
|
|
61
|
+
/**
|
|
62
|
+
* Template context của một node. Ref ổn định giữa các lần CD nhờ `#contextByItem`.
|
|
63
|
+
* Item không nằm trong `resolvedItems()` (gọi thủ công từ bên ngoài) thì dựng mới — trường hợp
|
|
64
|
+
* này không nằm trên đường render nên không gây churn.
|
|
65
|
+
*/
|
|
60
66
|
createContext: (item: SdOrgChartItem, depth: number, parent: SdOrgChartItem | null) => SdOrgChartItemContext;
|
|
61
67
|
nodeAutoId: (item: SdOrgChartItem, part: "node" | "image" | "title" | "description" | "toggle") => string | undefined;
|
|
62
68
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SdOrgChart, never>;
|
|
@@ -61,6 +61,7 @@ declare class SdPreviewImage implements OnDestroy {
|
|
|
61
61
|
static readonly MAX_ZOOM = 4;
|
|
62
62
|
static readonly ZOOM_STEP = 0.1;
|
|
63
63
|
static readonly SWIPE_THRESHOLD = 40;
|
|
64
|
+
readonly stageId: string;
|
|
64
65
|
readonly autoIdInput: _angular_core.InputSignal<string | null | undefined>;
|
|
65
66
|
readonly autoId: _angular_core.Signal<string | undefined>;
|
|
66
67
|
readonly autoIdPrev: _angular_core.Signal<string | undefined>;
|