@sdcorejs/angular 21.1.6 → 21.2.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 +10 -0
- 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/fesm2022/sdcorejs-angular-components-anchor.mjs +37 -13
- package/fesm2022/sdcorejs-angular-components-anchor.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +3409 -0
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -0
- 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 +27 -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-operator.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-operator.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 +27 -17
- 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 +33 -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 +556 -268
- 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 +7 -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 +232 -61
- package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-date.mjs +96 -24
- 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 +227 -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 +895 -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 +342 -111
- 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/package.json +36 -25
- package/types/sdcorejs-angular-components-anchor.d.ts +3 -1
- package/types/sdcorejs-angular-components-api-contract-builder.d.ts +694 -0
- package/types/sdcorejs-angular-components-badge.d.ts +2 -0
- package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +1 -1
- package/types/sdcorejs-angular-components-form-generic.d.ts +44 -33
- package/types/sdcorejs-angular-components-import-excel.d.ts +1 -0
- package/types/sdcorejs-angular-components-mini-editor.d.ts +1 -1
- package/types/sdcorejs-angular-components-modal-resizable.d.ts +92 -0
- package/types/sdcorejs-angular-components-modal.d.ts +3 -2
- package/types/sdcorejs-angular-components-org-chart.d.ts +6 -0
- package/types/sdcorejs-angular-components-preview.d.ts +1 -0
- package/types/sdcorejs-angular-components-query-bar.d.ts +55 -17
- package/types/sdcorejs-angular-components-query-builder.d.ts +150 -98
- package/types/sdcorejs-angular-components-section.d.ts +5 -0
- package/types/sdcorejs-angular-components-tab-router.d.ts +19 -19
- package/types/sdcorejs-angular-components-table.d.ts +251 -109
- package/types/sdcorejs-angular-components-tree.d.ts +48 -30
- package/types/sdcorejs-angular-components-upload-file.d.ts +6 -3
- package/types/sdcorejs-angular-components.d.ts +7 -1
- package/types/sdcorejs-angular-configurations.d.ts +1 -2
- package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -2
- package/types/sdcorejs-angular-forms-chip-calendar.d.ts +10 -0
- package/types/sdcorejs-angular-forms-date-range.d.ts +14 -2
- package/types/sdcorejs-angular-forms-date.d.ts +13 -2
- package/types/sdcorejs-angular-forms-datetime.d.ts +13 -2
- package/types/sdcorejs-angular-forms-entity-picker.d.ts +9 -3
- package/types/sdcorejs-angular-forms-input-color.d.ts +4 -0
- package/types/sdcorejs-angular-forms-input-number.d.ts +3 -0
- package/types/sdcorejs-angular-forms-input.d.ts +3 -0
- package/types/sdcorejs-angular-forms-models.d.ts +119 -4
- package/types/sdcorejs-angular-forms-select.d.ts +27 -4
- package/types/sdcorejs-angular-forms-switch.d.ts +7 -1
- package/types/sdcorejs-angular-forms-textarea.d.ts +5 -3
- package/types/sdcorejs-angular-forms-time-range.d.ts +22 -1
- package/types/sdcorejs-angular-forms-tree-select.d.ts +36 -5
- package/types/sdcorejs-angular-forms.d.ts +22 -13
- package/types/sdcorejs-angular-i18n.d.ts +175 -16
- package/types/sdcorejs-angular-interceptors.d.ts +13 -3
- package/types/sdcorejs-angular-modules-auth.d.ts +1 -1
- package/types/sdcorejs-angular-modules-keycloak.d.ts +1 -0
- package/types/sdcorejs-angular-modules-layout.d.ts +94 -28
- package/types/sdcorejs-angular-modules-permission.d.ts +66 -4
- package/types/sdcorejs-angular-pipes.d.ts +27 -5
- package/types/sdcorejs-angular-services-api.d.ts +21 -1
- package/types/sdcorejs-angular-services-cache.d.ts +11 -1
- package/types/sdcorejs-angular-services-notify.d.ts +1 -1
- package/types/sdcorejs-angular-services.d.ts +0 -1
- package/types/sdcorejs-angular-utilities-extensions.d.ts +83 -61
- package/types/sdcorejs-angular-utilities-models.d.ts +2 -76
- package/types/sdcorejs-angular.d.ts +11 -2
- 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/types/sdcorejs-angular-components-base.d.ts +0 -11
- package/types/sdcorejs-angular-components-document-builder.d.ts +0 -252
- package/types/sdcorejs-angular-models.d.ts +0 -2
- package/types/sdcorejs-angular-services-docx.d.ts +0 -27
- package/types/sdcorejs-angular-services-license.d.ts +0 -12
|
@@ -22,7 +22,9 @@ 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>;
|
|
27
|
+
accessibleName: _angular_core.Signal<string>;
|
|
26
28
|
baseColorClasses: _angular_core.Signal<{
|
|
27
29
|
'c-primary': boolean;
|
|
28
30
|
'c-secondary': 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;
|
|
@@ -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,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>;
|
|
@@ -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>;
|
|
@@ -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>;
|
|
@@ -5,7 +5,7 @@ import { MatMenu } from '@angular/material/menu';
|
|
|
5
5
|
import { SdSearch } from '@sdcorejs/angular/forms/models';
|
|
6
6
|
|
|
7
7
|
type SdQueryFieldType = 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'values' | 'lazy-values';
|
|
8
|
-
interface SdQueryFieldBase<T =
|
|
8
|
+
interface SdQueryFieldBase<T = unknown> {
|
|
9
9
|
/** Dot-notation field path (matches `Filter.field`). */
|
|
10
10
|
key: NestedKeyOf<T>;
|
|
11
11
|
/** Human-readable label shown on chip + field picker. */
|
|
@@ -30,10 +30,10 @@ interface SdQueryFieldBase<T = any> {
|
|
|
30
30
|
/** Field is offered in picker but not interactive (read-only badge in chip). */
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
}
|
|
33
|
-
interface SdQueryFieldString<T =
|
|
33
|
+
interface SdQueryFieldString<T = unknown> extends SdQueryFieldBase<T> {
|
|
34
34
|
type: 'string';
|
|
35
35
|
}
|
|
36
|
-
interface SdQueryFieldNumber<T =
|
|
36
|
+
interface SdQueryFieldNumber<T = unknown> extends SdQueryFieldBase<T> {
|
|
37
37
|
type: 'number';
|
|
38
38
|
/** Bounds for the input control inside the chip popover. */
|
|
39
39
|
min?: number;
|
|
@@ -41,13 +41,13 @@ interface SdQueryFieldNumber<T = any> extends SdQueryFieldBase<T> {
|
|
|
41
41
|
/** Step for the number input. */
|
|
42
42
|
step?: number;
|
|
43
43
|
}
|
|
44
|
-
interface SdQueryFieldBoolean<T =
|
|
44
|
+
interface SdQueryFieldBoolean<T = unknown> extends SdQueryFieldBase<T> {
|
|
45
45
|
type: 'boolean';
|
|
46
46
|
/** Labels rendered for the true/false buttons. Default: "Có" / "Không". */
|
|
47
47
|
trueLabel?: string;
|
|
48
48
|
falseLabel?: string;
|
|
49
49
|
}
|
|
50
|
-
interface SdQueryFieldDate<T =
|
|
50
|
+
interface SdQueryFieldDate<T = unknown> extends SdQueryFieldBase<T> {
|
|
51
51
|
type: 'date' | 'datetime';
|
|
52
52
|
/** Restrict the picker calendar to this range. */
|
|
53
53
|
min?: Date | string;
|
|
@@ -57,7 +57,7 @@ interface SdQueryFieldDate<T = any> extends SdQueryFieldBase<T> {
|
|
|
57
57
|
* Statically-known options (sync array, signal, or one-shot promise).
|
|
58
58
|
* Mirrors `SdTableColumnValues.option`.
|
|
59
59
|
*/
|
|
60
|
-
interface SdQueryFieldValues<T =
|
|
60
|
+
interface SdQueryFieldValues<T = unknown, K = Record<string, any>> extends SdQueryFieldBase<T> {
|
|
61
61
|
type: 'values';
|
|
62
62
|
option: {
|
|
63
63
|
items: K[] | Signal<K[]> | (() => Promise<K[]>);
|
|
@@ -71,7 +71,7 @@ interface SdQueryFieldValues<T = any, K = Record<string, any>> extends SdQueryFi
|
|
|
71
71
|
* `{ type: 'SEARCH', searchText }` for live queries and `{ type: 'VALUE', value }` for
|
|
72
72
|
* resolving chip-display labels of already-selected IDs.
|
|
73
73
|
*/
|
|
74
|
-
interface SdQueryFieldLazyValues<T =
|
|
74
|
+
interface SdQueryFieldLazyValues<T = unknown, K = Record<string, any>> extends SdQueryFieldBase<T> {
|
|
75
75
|
type: 'lazy-values';
|
|
76
76
|
option: {
|
|
77
77
|
search: SdSearch<K>;
|
|
@@ -79,16 +79,16 @@ interface SdQueryFieldLazyValues<T = any, K = Record<string, any>> extends SdQue
|
|
|
79
79
|
displayField: NestedKeyOf<K>;
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
|
-
type SdQueryField<T =
|
|
82
|
+
type SdQueryField<T = unknown> = SdQueryFieldString<T> | SdQueryFieldNumber<T> | SdQueryFieldBoolean<T> | SdQueryFieldDate<T> | SdQueryFieldValues<T> | SdQueryFieldLazyValues<T>;
|
|
83
83
|
type SdQueryLogic = 'AND' | 'OR';
|
|
84
|
-
interface SdQuery<T =
|
|
84
|
+
interface SdQuery<T = unknown> {
|
|
85
85
|
filters: Filter<T>[];
|
|
86
86
|
/** Global connector between filters. Defaults to `'AND'`. */
|
|
87
87
|
logic?: SdQueryLogic;
|
|
88
88
|
/** Free-text search box (only present when `showSearch=true`). */
|
|
89
89
|
search?: string;
|
|
90
90
|
}
|
|
91
|
-
interface SdQueryBarOption<T =
|
|
91
|
+
interface SdQueryBarOption<T = unknown> {
|
|
92
92
|
/** Prefix for auto-generated `data-autoid` on inner controls. */
|
|
93
93
|
autoId?: string;
|
|
94
94
|
/** Available fields the user can filter by. */
|
|
@@ -111,7 +111,7 @@ interface SdQueryBarOption<T = any> {
|
|
|
111
111
|
onApply?: (query: SdQuery<T>) => void;
|
|
112
112
|
}
|
|
113
113
|
/** Persisted bookmark of a query (filters + logic + search) — managed by `[savedFiltersKey]`. */
|
|
114
|
-
interface SdSavedFilter<T =
|
|
114
|
+
interface SdSavedFilter<T = unknown> {
|
|
115
115
|
id: string;
|
|
116
116
|
name: string;
|
|
117
117
|
query: SdQuery<T>;
|
|
@@ -123,7 +123,7 @@ interface SdSavedFilter<T = any> {
|
|
|
123
123
|
* - 'operator' — operator menu open, waiting for the user to pick a condition
|
|
124
124
|
* - 'value' — operator locked, value picker / seamless input is the focus
|
|
125
125
|
*/
|
|
126
|
-
interface BuildingChip<T =
|
|
126
|
+
interface BuildingChip<T = unknown> {
|
|
127
127
|
field: SdQueryField<T>;
|
|
128
128
|
operator?: Operator;
|
|
129
129
|
step: 'operator' | 'value';
|
|
@@ -151,6 +151,9 @@ declare function sdQueryDefaultOperator(field: SdQueryField): Operator;
|
|
|
151
151
|
* - `operators === true` → full set for the type
|
|
152
152
|
* - `operators` is an array → that array (deduped against the type set is the caller's job)
|
|
153
153
|
* - otherwise (simple mode) → just the single default operator (no real choice)
|
|
154
|
+
*
|
|
155
|
+
* The returned array is referentially stable for a given `field` object, so it is safe to call
|
|
156
|
+
* straight from a template binding.
|
|
154
157
|
*/
|
|
155
158
|
declare function sdQueryAllowedOperators(field: SdQueryField): Operator[];
|
|
156
159
|
/**
|
|
@@ -175,6 +178,14 @@ declare function sdQueryShowOperatorSelector(field: SdQueryField): boolean;
|
|
|
175
178
|
*/
|
|
176
179
|
declare class SdQueryChipPopover {
|
|
177
180
|
#private;
|
|
181
|
+
readonly swapFieldTooltip: _angular_core.Signal<string>;
|
|
182
|
+
readonly fromPlaceholder: _angular_core.Signal<string>;
|
|
183
|
+
readonly toPlaceholder: _angular_core.Signal<string>;
|
|
184
|
+
readonly booleanTrueLabel: _angular_core.Signal<string>;
|
|
185
|
+
readonly booleanFalseLabel: _angular_core.Signal<string>;
|
|
186
|
+
readonly selectValuePlaceholder: _angular_core.Signal<string>;
|
|
187
|
+
readonly enterValuePlaceholder: _angular_core.Signal<string>;
|
|
188
|
+
readonly loadingValuesLabel: _angular_core.Signal<string>;
|
|
178
189
|
/** Resolved field of the currently editing chip — parent passes from `fieldByKey()`. */
|
|
179
190
|
readonly field: _angular_core.InputSignal<SdQueryField | undefined>;
|
|
180
191
|
/** The chip's current Filter — used by `seed()` for initial staging values. */
|
|
@@ -271,7 +282,7 @@ declare class SdQueryBar {
|
|
|
271
282
|
/** The extracted chip popover — owns operator+value staging + commit-on-close. */
|
|
272
283
|
readonly chipPopover: _angular_core.Signal<SdQueryChipPopover | undefined>;
|
|
273
284
|
/** Main option object. Prefer this API for new usage; individual inputs stay as a migration bridge. */
|
|
274
|
-
readonly option: _angular_core.InputSignal<SdQueryBarOption<
|
|
285
|
+
readonly option: _angular_core.InputSignal<SdQueryBarOption<unknown> | undefined>;
|
|
275
286
|
/** Prefix for auto-generated `data-autoid` on inner controls (chips, operator/value editors, buttons). */
|
|
276
287
|
readonly autoIdInput: _angular_core.InputSignalWithTransform<string | undefined, string | null | undefined>;
|
|
277
288
|
/** Available fields the user can filter by. Required for the field picker. */
|
|
@@ -312,7 +323,7 @@ declare class SdQueryBar {
|
|
|
312
323
|
* Snapshot of the current query — fed into `<sd-query-saved-filters-menu [query]>` so
|
|
313
324
|
* saving a filter captures live filters/logic/search.
|
|
314
325
|
*/
|
|
315
|
-
readonly currentQuery: _angular_core.Signal<SdQuery<
|
|
326
|
+
readonly currentQuery: _angular_core.Signal<SdQuery<unknown>>;
|
|
316
327
|
/** Receive an applied filter from the saved-filters menu — re-install bar state + trigger apply. */
|
|
317
328
|
onApplyFilter(saved: SdSavedFilter): void;
|
|
318
329
|
/** Show AND/OR segmented toggle (renders only when there are ≥2 filters). */
|
|
@@ -322,9 +333,15 @@ declare class SdQueryBar {
|
|
|
322
333
|
/** Render the operator label on the chip face (default: hidden — operator only visible in popover). */
|
|
323
334
|
readonly showOperatorOnChip: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
324
335
|
/** Composite payload — emitted whenever filters / logic / search change. */
|
|
325
|
-
readonly queryChange: _angular_core.OutputEmitterRef<SdQuery<
|
|
336
|
+
readonly queryChange: _angular_core.OutputEmitterRef<SdQuery<unknown>>;
|
|
326
337
|
/** Fires when the user presses "Áp dụng" inside a chip popover — host should reload data. */
|
|
327
|
-
readonly apply: _angular_core.OutputEmitterRef<SdQuery<
|
|
338
|
+
readonly apply: _angular_core.OutputEmitterRef<SdQuery<unknown>>;
|
|
339
|
+
/** Placeholder của ô tìm kiếm tự do bên trái. */
|
|
340
|
+
readonly searchPlaceholder: _angular_core.Signal<string>;
|
|
341
|
+
/** Tooltip nút "+" khi consumer chưa khai `fields`. */
|
|
342
|
+
readonly noFieldsLabel: _angular_core.Signal<string>;
|
|
343
|
+
/** Tooltip nút "+" ở trạng thái bình thường. */
|
|
344
|
+
readonly addFilterLabel: _angular_core.Signal<string>;
|
|
328
345
|
/** Map of `field.key` → `SdQueryField` for fast lookup from filters[]. */
|
|
329
346
|
readonly resolvedAutoId: _angular_core.Signal<string | undefined>;
|
|
330
347
|
readonly resolvedFields: _angular_core.Signal<SdQueryField[]>;
|
|
@@ -354,13 +371,34 @@ declare class SdQueryBar {
|
|
|
354
371
|
* popover-mode chips read `multiple()` from the child popover directly.
|
|
355
372
|
*/
|
|
356
373
|
multiple(op: Operator): boolean;
|
|
374
|
+
/**
|
|
375
|
+
* Stable track key of a filter row. Assigned lazily on first read.
|
|
376
|
+
*
|
|
377
|
+
* ⚠️ Hai ràng buộc với `filters`, đều là hợp đồng của consumer:
|
|
378
|
+
*
|
|
379
|
+
* 1. KHÔNG được chứa cùng một object `Filter` ở hai vị trí. Khoá theo identity nên hai vị trí sẽ
|
|
380
|
+
* cho hai track key trùng nhau và Angular ném NG0955. Đã thử khử trùng bằng hậu tố `$index`
|
|
381
|
+
* và HỎNG: Angular đánh giá biểu thức `track` trên CẢ collection cũ khi diff, nên một filter
|
|
382
|
+
* vừa bị xoá cho `indexOf === -1`, key đổi, và MỌI chip bị huỷ rồi dựng lại. Để Angular báo
|
|
383
|
+
* NG0955 là đúng — thông điệp của nó đã chỉ rõ vấn đề.
|
|
384
|
+
* 2. Object phải ỔN ĐỊNH giữa các lần change detection. Sinh lại object mới mỗi pass
|
|
385
|
+
* (vd `[option]="{ filters: buildFilters() }"`) sẽ khiến mọi chip nhận id mới mỗi pass và bị
|
|
386
|
+
* huỷ + dựng lại — tệ hơn cả `track $index` cũ.
|
|
387
|
+
*/
|
|
388
|
+
rowId(filter: Filter): string;
|
|
357
389
|
readonly iconFor: typeof sdQueryFieldIcon;
|
|
358
390
|
/** Chip is "active" when it has a non-empty value OR a no-data operator (NULL/NOT_NULL). */
|
|
359
391
|
isFilterActive(filter: Filter): boolean;
|
|
360
392
|
/** Rendered value text on a chip. */
|
|
361
393
|
chipValueText(filter: Filter): string;
|
|
362
394
|
isNoDataOperator(op: Operator | string): boolean;
|
|
363
|
-
readonly building: _angular_core.Signal<BuildingChip<
|
|
395
|
+
readonly building: _angular_core.Signal<BuildingChip<unknown> | null>;
|
|
396
|
+
/**
|
|
397
|
+
* Allowed operators of `field` — safe to call from a template binding: `sdQueryAllowedOperators`
|
|
398
|
+
* memo hoá theo object field nên ref trả về ổn định giữa các chu kỳ CD.
|
|
399
|
+
* why: `<sd-query-build-chip [allowedOperators]>` là OnPush; ref mới mỗi CD sẽ dirty child liên
|
|
400
|
+
* tục (bug class cấp-phát-mỗi-CD).
|
|
401
|
+
*/
|
|
364
402
|
allowedOperatorsFor(field: SdQueryField): Operator[];
|
|
365
403
|
inlineAutoId(index: number, role: string): string;
|
|
366
404
|
/** Entry point from the field picker — start building a chip for `field`. */
|