@sd-angular/core 19.0.0-beta.94 → 19.0.0-beta.95
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 +2 -1
- package/components/anchor/src/components/anchor/anchor.component.d.ts +4 -1
- package/components/anchor/src/components/anchor-item/anchor-item.component.d.ts +2 -1
- package/components/anchor/src/components/anchor-vertical/anchor-vertical-list.component.d.ts +3 -1
- package/components/document-builder/src/components/header-footer-builder/header-footer-builder.component.d.ts +2 -2
- package/components/document-builder/src/document-builder.model.d.ts +2 -2
- package/components/editor/src/models/editor.model.d.ts +2 -2
- package/components/editor/src/plugins/image-upload/utils/validate.utils.d.ts +2 -2
- package/components/form-generic/src/components/form-builder/components/attribute-table/attribute-table.component.d.ts +4 -2
- package/components/form-generic/src/components/form-builder/components/attribute-template/attribute-template.component.d.ts +2 -2
- package/components/form-generic/src/components/form-builder/components/configure-validation/configure-validation.component.d.ts +2 -2
- package/components/form-generic/src/components/form-builder/components/group/attribute/group-attribute.component.d.ts +23 -0
- package/components/form-generic/src/components/form-builder/components/group/index.d.ts +1 -0
- package/components/form-generic/src/components/form-builder/components/index.d.ts +1 -0
- package/components/form-generic/src/components/form-builder/components/table/control/table-control.component.d.ts +3 -0
- package/components/form-generic/src/components/form-builder/form-builder.component.d.ts +61 -18
- package/components/form-generic/src/components/form-render/form-render.component.d.ts +2 -2
- package/components/form-generic/src/models/form-generic-component.model.d.ts +22 -2
- package/components/index.d.ts +1 -0
- package/components/modal/src/modal.component.d.ts +4 -1
- package/components/preview/index.d.ts +3 -0
- package/components/preview/src/preview-image/preview-image.component.d.ts +84 -24
- package/components/preview/src/preview-image/preview-image.types.d.ts +53 -0
- package/components/preview/src/preview-pdf/preview-pdf.component.d.ts +186 -0
- package/components/preview/src/preview-pdf/preview-pdf.types.d.ts +84 -0
- package/components/quick-action/src/quick-action.component.d.ts +5 -6
- package/components/table/src/table.component.d.ts +2 -2
- package/components/upload-file/src/upload-file.component.d.ts +4 -1
- package/configurations/src/sd-core.configuration.d.ts +2 -1
- package/fesm2022/sd-angular-core-components-anchor.mjs +19 -6
- package/fesm2022/sd-angular-core-components-anchor.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-button.mjs +1 -1
- package/fesm2022/sd-angular-core-components-button.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-code-editor.mjs +3 -3
- package/fesm2022/sd-angular-core-components-code-editor.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-document-builder.mjs +3 -3
- package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-editor.mjs +3 -3
- package/fesm2022/sd-angular-core-components-editor.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-form-generic.mjs +627 -317
- package/fesm2022/sd-angular-core-components-form-generic.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-history.mjs +3 -3
- package/fesm2022/sd-angular-core-components-history.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-import-excel.mjs +5 -5
- package/fesm2022/sd-angular-core-components-import-excel.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-modal.mjs +8 -3
- package/fesm2022/sd-angular-core-components-modal.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-preview.mjs +1963 -91
- package/fesm2022/sd-angular-core-components-preview.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-quick-action.mjs +8 -19
- package/fesm2022/sd-angular-core-components-quick-action.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-tab-router.mjs +2 -2
- package/fesm2022/sd-angular-core-components-tab-router.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-table.mjs +32 -29
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-upload-file.mjs +12 -8
- package/fesm2022/sd-angular-core-components-upload-file.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +1 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-configurations.mjs.map +1 -1
- package/fesm2022/sd-angular-core-directives.mjs +2 -2
- package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-checkbox.mjs +6 -13
- package/fesm2022/sd-angular-core-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-chip-calendar.mjs +6 -5
- package/fesm2022/sd-angular-core-forms-chip-calendar.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-chip.mjs +6 -12
- package/fesm2022/sd-angular-core-forms-chip.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date-range.mjs +33 -26
- package/fesm2022/sd-angular-core-forms-date-range.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +29 -19
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +98 -57
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +2 -2
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +5 -5
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-radio.mjs +7 -15
- package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +4 -4
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-switch.mjs +6 -14
- package/fesm2022/sd-angular-core-forms-switch.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +5 -5
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-handlers.mjs +2 -2
- package/fesm2022/sd-angular-core-handlers.mjs.map +1 -1
- package/fesm2022/sd-angular-core-i18n.mjs +1575 -38
- package/fesm2022/sd-angular-core-i18n.mjs.map +1 -1
- package/fesm2022/sd-angular-core-interceptors.mjs +2 -2
- package/fesm2022/sd-angular-core-interceptors.mjs.map +1 -1
- package/fesm2022/sd-angular-core-models.mjs +9 -0
- package/fesm2022/sd-angular-core-models.mjs.map +1 -0
- package/fesm2022/sd-angular-core-modules-layout.mjs +87 -39
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +2 -2
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-docx.mjs +2 -2
- package/fesm2022/sd-angular-core-services-docx.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-excel.mjs +27 -23
- package/fesm2022/sd-angular-core-services-excel.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs +47 -13
- package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sd-angular-core.mjs +0 -1
- package/fesm2022/sd-angular-core.mjs.map +1 -1
- package/forms/checkbox/src/checkbox.component.d.ts +3 -3
- package/forms/chip/src/chip.component.d.ts +3 -2
- package/forms/chip-calendar/src/chip-calendar.component.d.ts +3 -2
- package/forms/date/src/date.component.d.ts +2 -3
- package/forms/date-range/src/date-range.component.d.ts +2 -3
- package/forms/datetime/src/datetime.component.d.ts +1 -0
- package/forms/datetime/src/popup/sd-datetime-picker.component.d.ts +10 -11
- package/forms/radio/src/radio.component.d.ts +3 -3
- package/forms/switch/src/switch.component.d.ts +3 -3
- package/i18n/index.d.ts +5 -5
- package/i18n/src/en.d.ts +400 -2
- package/i18n/src/i18n.messages.d.ts +2 -0
- package/i18n/src/i18n.pipe.d.ts +9 -0
- package/i18n/src/i18n.service.d.ts +14 -0
- package/i18n/src/i18n.token.d.ts +1 -0
- package/i18n/src/i18n.types.d.ts +31 -0
- package/i18n/src/ja.d.ts +2 -0
- package/i18n/src/ko.d.ts +2 -0
- package/i18n/src/vi.d.ts +2 -312
- package/i18n/src/zh.d.ts +2 -0
- package/models/index.d.ts +1 -0
- package/models/src/language.model.d.ts +4 -0
- package/modules/layout/modules/home/components/home-page/home-page.component.d.ts +25 -0
- package/package.json +71 -67
- package/public-api.d.ts +0 -1
- package/sd-angular-core-19.0.0-beta.95.tgz +0 -0
- package/i18n/src/sd-i18n.messages.d.ts +0 -2
- package/i18n/src/sd-i18n.pipe.d.ts +0 -9
- package/i18n/src/sd-i18n.service.d.ts +0 -12
- package/i18n/src/sd-i18n.token.d.ts +0 -1
- package/i18n/src/sd-i18n.types.d.ts +0 -5
- package/sd-angular-core-19.0.0-beta.94.tgz +0 -0
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
|---|---|
|
|
36
36
|
| `@angular/core` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
|
|
37
37
|
| `@angular/material` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
|
|
38
|
-
| `@angular/material-
|
|
38
|
+
| `@angular/material-date-fns-adapter` | `^19.0.0 \|\| ^20.0.0 \|\| ^21.0.0` |
|
|
39
|
+
| `date-fns` | `^3 \|\| ^4` |
|
|
39
40
|
|
|
40
41
|
### Installation / Cài đặt
|
|
41
42
|
|
|
@@ -5,6 +5,9 @@ export declare class SdAnchor implements OnDestroy {
|
|
|
5
5
|
#private;
|
|
6
6
|
wrapper: import("@angular/core").Signal<ElementRef<any>>;
|
|
7
7
|
sections: import("@angular/core").Signal<readonly SdAnchorItem[]>;
|
|
8
|
+
readonly autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
9
|
+
readonly autoId: import("@angular/core").Signal<string | undefined>;
|
|
10
|
+
readonly itemAutoId: (key: string | undefined) => string | undefined;
|
|
8
11
|
type: import("@angular/core").InputSignal<"vertical" | "horizontal">;
|
|
9
12
|
sidebarWidth: import("@angular/core").InputSignal<string>;
|
|
10
13
|
ellipsis: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
@@ -15,5 +18,5 @@ export declare class SdAnchor implements OnDestroy {
|
|
|
15
18
|
scrollSectionByClick(idSectionTarget: string): void;
|
|
16
19
|
ngOnDestroy(): void;
|
|
17
20
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAnchor, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchor, "sd-anchor", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "isOverscroll": { "alias": "isOverscroll"; "required": false; "isSignal": true; }; "isHiddenAnchorList": { "alias": "isHiddenAnchorList"; "required": false; "isSignal": true; }; }, {}, ["sections"], ["*"], true, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchor, "sd-anchor", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "isOverscroll": { "alias": "isOverscroll"; "required": false; "isSignal": true; }; "isHiddenAnchorList": { "alias": "isHiddenAnchorList"; "required": false; "isSignal": true; }; }, {}, ["sections"], ["*"], true, never>;
|
|
19
22
|
}
|
|
@@ -4,9 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class SdAnchorItem implements IAnchorItem {
|
|
5
5
|
title: import("@angular/core").InputSignal<string>;
|
|
6
6
|
icon: import("@angular/core").InputSignal<string | undefined>;
|
|
7
|
+
key: import("@angular/core").InputSignal<string | undefined>;
|
|
7
8
|
id: string;
|
|
8
9
|
elementRef: ElementRef<any>;
|
|
9
10
|
constructor();
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAnchorItem, never>;
|
|
11
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchorItem, "sd-anchor-item", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchorItem, "sd-anchor-item", never, { "title": { "alias": "title"; "required": true; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "key": { "alias": "key"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
12
13
|
}
|
package/components/anchor/src/components/anchor-vertical/anchor-vertical-list.component.d.ts
CHANGED
|
@@ -7,10 +7,12 @@ export declare class SdAnchorVerticalList implements OnDestroy {
|
|
|
7
7
|
activeSectionId: import("@angular/core").InputSignal<string>;
|
|
8
8
|
ellipsis: import("@angular/core").InputSignal<boolean>;
|
|
9
9
|
sidebarWidth: import("@angular/core").InputSignal<string>;
|
|
10
|
+
parentAutoId: import("@angular/core").InputSignal<string | null | undefined>;
|
|
11
|
+
itemAutoId(section: SdAnchorItem): string | undefined;
|
|
10
12
|
sdClickSection: import("@angular/core").OutputEmitterRef<string>;
|
|
11
13
|
constructor();
|
|
12
14
|
onClickSection: (id: string) => void;
|
|
13
15
|
ngOnDestroy(): void;
|
|
14
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdAnchorVerticalList, never>;
|
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchorVerticalList, "sd-anchor-vertical-list", never, { "sections": { "alias": "sections"; "required": true; "isSignal": true; }; "activeSectionId": { "alias": "activeSectionId"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; }, { "sdClickSection": "sdClickSection"; }, never, never, true, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdAnchorVerticalList, "sd-anchor-vertical-list", never, { "sections": { "alias": "sections"; "required": true; "isSignal": true; }; "activeSectionId": { "alias": "activeSectionId"; "required": false; "isSignal": true; }; "ellipsis": { "alias": "ellipsis"; "required": false; "isSignal": true; }; "sidebarWidth": { "alias": "sidebarWidth"; "required": false; "isSignal": true; }; "parentAutoId": { "alias": "parentAutoId"; "required": false; "isSignal": true; }; }, { "sdClickSection": "sdClickSection"; }, never, never, true, never>;
|
|
16
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { I18nService } from '@sd-angular/core/i18n';
|
|
3
3
|
import { ClassicEditor, EditorConfig } from 'ckeditor5';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class SdHeaderFooterBuilder {
|
|
@@ -8,7 +8,7 @@ export declare class SdHeaderFooterBuilder {
|
|
|
8
8
|
set model(value: string | undefined | null);
|
|
9
9
|
modelChange: EventEmitter<string>;
|
|
10
10
|
config: EditorConfig & {
|
|
11
|
-
_i18n?:
|
|
11
|
+
_i18n?: I18nService;
|
|
12
12
|
};
|
|
13
13
|
onReady(editor: ClassicEditor): void;
|
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdHeaderFooterBuilder, never>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EditorConfig, EventInfo, ModelDocumentSelection, ViewDataTransfer } from 'ckeditor5';
|
|
2
|
-
import {
|
|
2
|
+
import { I18nService } from '@sd-angular/core/i18n';
|
|
3
3
|
import { CkCommentConfig } from './plugins/ck-comment/ck-comment.plugin.model';
|
|
4
4
|
export type DocumentBuilderOption = EditorConfig & {
|
|
5
5
|
getOption?: () => SdDocumentBuilderOption;
|
|
6
|
-
_i18n?:
|
|
6
|
+
_i18n?: I18nService;
|
|
7
7
|
};
|
|
8
8
|
export interface SdDocumentBuilderOption {
|
|
9
9
|
onDropVariable?: (variable: SdDocumentBuilderVariable) => boolean | Promise<boolean | SdDocumentBuilderVariable>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EditorConfig } from 'ckeditor5';
|
|
2
|
-
import {
|
|
2
|
+
import { I18nService } from '@sd-angular/core/i18n';
|
|
3
3
|
import { SdEditorImageConfig } from './image-upload.plugin.model';
|
|
4
4
|
export interface SdEditorOption {
|
|
5
5
|
imageConfig?: SdEditorImageConfig;
|
|
6
|
-
_i18n?:
|
|
6
|
+
_i18n?: I18nService;
|
|
7
7
|
}
|
|
8
8
|
export type EditorOption = EditorConfig & {
|
|
9
9
|
getOption?: () => SdEditorOption;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FileLoader } from 'ckeditor5';
|
|
2
|
-
import {
|
|
2
|
+
import { I18nService } from '@sd-angular/core/i18n';
|
|
3
3
|
import { SdEditorImageUploadValidation } from '../../../models';
|
|
4
|
-
export declare const validateAndGetFile: (loader: FileLoader, validation?: SdEditorImageUploadValidation, onWarning?: (message: string) => void, i18n?:
|
|
4
|
+
export declare const validateAndGetFile: (loader: FileLoader, validation?: SdEditorImageUploadValidation, onWarning?: (message: string) => void, i18n?: I18nService) => Promise<File>;
|
|
@@ -22,13 +22,15 @@ export declare class AttributeTable {
|
|
|
22
22
|
set _columns(columns: SdFormGenericTableColumn[] | undefined | null);
|
|
23
23
|
columnsChange: EventEmitter<SdFormGenericTableColumn[]>;
|
|
24
24
|
column?: SdFormGenericTableColumn;
|
|
25
|
-
constructor(formGenericConfiguration: ISdFormGenericConfiguration);
|
|
25
|
+
constructor(formGenericConfiguration: ISdFormGenericConfiguration | null);
|
|
26
26
|
onChangeColumnsKey: (value: any) => void;
|
|
27
27
|
addColumn: () => void;
|
|
28
|
+
readonly columnTypeIcons: Record<string, string>;
|
|
29
|
+
columnTypeSymbol: (type: string | undefined) => string;
|
|
28
30
|
selectedIdx?: number | undefined;
|
|
29
31
|
editColumn: (idx: number) => void;
|
|
30
32
|
removeColumn: (idx: number) => void;
|
|
31
33
|
onConfirm: () => void;
|
|
32
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AttributeTable,
|
|
34
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttributeTable, [{ optional: true; }]>;
|
|
33
35
|
static ɵcmp: i0.ɵɵComponentDeclaration<AttributeTable, "attribute-table", never, { "components": { "alias": "components"; "required": true; }; "variables": { "alias": "variables"; "required": true; }; "_columnsKey": { "alias": "columnsKey"; "required": true; }; "_columns": { "alias": "columns"; "required": true; }; }, { "columnsKeyChange": "columnsKeyChange"; "columnsChange": "columnsChange"; }, never, never, true, never>;
|
|
34
36
|
}
|
|
@@ -8,8 +8,8 @@ export declare class AttributeTemplate {
|
|
|
8
8
|
component: SdFormGenericComponent;
|
|
9
9
|
set _component(component: SdFormGenericComponent);
|
|
10
10
|
sdChange: EventEmitter<SdFormGenericComponent>;
|
|
11
|
-
constructor(formGenericConfiguration: ISdFormGenericConfiguration);
|
|
11
|
+
constructor(formGenericConfiguration: ISdFormGenericConfiguration | null);
|
|
12
12
|
onChange: (value: string | number | null) => void;
|
|
13
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AttributeTemplate,
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AttributeTemplate, [{ optional: true; }]>;
|
|
14
14
|
static ɵcmp: i0.ɵɵComponentDeclaration<AttributeTemplate, "attribute-template", never, { "_component": { "alias": "component"; "required": true; }; }, { "sdChange": "sdChange"; }, never, never, true, never>;
|
|
15
15
|
}
|
|
@@ -19,13 +19,13 @@ export declare class ConfigureValidationComponent {
|
|
|
19
19
|
display: string;
|
|
20
20
|
}[];
|
|
21
21
|
accept: EventEmitter<SdFormGenericValidation[]>;
|
|
22
|
-
constructor(ref: ChangeDetectorRef, formGenericConfiguration: ISdFormGenericConfiguration);
|
|
22
|
+
constructor(ref: ChangeDetectorRef, formGenericConfiguration: ISdFormGenericConfiguration | null);
|
|
23
23
|
ngAfterViewInit(): void;
|
|
24
24
|
ngOnDestroy(): void;
|
|
25
25
|
open: (formGeneric: SdFormGeneric) => void;
|
|
26
26
|
addValidation: (type: SdFormGenericValidation["type"]) => void;
|
|
27
27
|
removaValidation: (index: number) => void;
|
|
28
28
|
updateValidations: () => void;
|
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigureValidationComponent,
|
|
29
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ConfigureValidationComponent, [null, { optional: true; }]>;
|
|
30
30
|
static ɵcmp: i0.ɵɵComponentDeclaration<ConfigureValidationComponent, "configure-validation", never, {}, { "accept": "accept"; }, never, never, true, never>;
|
|
31
31
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FormGroup } from '@angular/forms';
|
|
2
|
+
import { SdFormGenericComponent, SdFormGenericGroup } from '../../../../../models';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
declare const COLOR_PRESETS: readonly ["primary", "secondary", "success", "warning", "error"];
|
|
5
|
+
export declare class GroupAttribute {
|
|
6
|
+
#private;
|
|
7
|
+
readonly iconPresets: readonly ["category", "folder", "inventory_2", "group_work", "workspaces", "view_quilt"];
|
|
8
|
+
readonly colorPresets: readonly ["primary", "secondary", "success", "warning", "error"];
|
|
9
|
+
readonly componentIcons: Record<string, {
|
|
10
|
+
symbol: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}>;
|
|
13
|
+
form: FormGroup<{}>;
|
|
14
|
+
/** Required group reference. Mutated in place khi user pick icon/color/expression. */
|
|
15
|
+
readonly group: import("@angular/core").InputSignal<SdFormGenericGroup>;
|
|
16
|
+
constructor();
|
|
17
|
+
pickIcon: (icon: string) => void;
|
|
18
|
+
pickColor: (color: (typeof COLOR_PRESETS)[number]) => void;
|
|
19
|
+
symbolForChild: (c: SdFormGenericComponent) => string;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GroupAttribute, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GroupAttribute, "group-attribute", never, { "group": { "alias": "group"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './attribute/group-attribute.component';
|
|
@@ -11,6 +11,9 @@ export declare class TableControl {
|
|
|
11
11
|
constructor(ref: ChangeDetectorRef, builderService: BuilderService);
|
|
12
12
|
ngAfterViewInit(): void;
|
|
13
13
|
ngOnDestroy(): void;
|
|
14
|
+
columnIcon: (type: string) => "image" | "text_fields" | "123" | "calendar_month" | "radio_button_checked" | "check_box" | "attach_file";
|
|
15
|
+
sampleRows: () => number[];
|
|
16
|
+
cellPreview: (column: any, rowIndex: number) => any;
|
|
14
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<TableControl, never>;
|
|
15
18
|
static ɵcmp: i0.ɵɵComponentDeclaration<TableControl, "table-control", never, { "_component": { "alias": "component"; "required": true; }; }, {}, never, never, true, never>;
|
|
16
19
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { CdkDragDrop, CdkDragMove } from '@angular/cdk/drag-drop';
|
|
2
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
3
2
|
import { FormGroup } from '@angular/forms';
|
|
4
3
|
import { SdBaseSecureComponent } from '@sd-angular/core/components/base';
|
|
5
4
|
import { SdModal } from '@sd-angular/core/components/modal';
|
|
6
|
-
import {
|
|
7
|
-
import { FormBuilderComponent, SdFormGenericComponent, SdFormGenericGroup, SdFormGenericVariable } from '../../models';
|
|
5
|
+
import { FormBuilderComponent, FormBuilderComponentGroup, SdFormGenericComponent, SdFormGenericGroup, SdFormGenericVariable } from '../../models';
|
|
8
6
|
import { SdFormGenericValidation } from '../../models/form-generic-validation.model';
|
|
9
7
|
import { SdFormGeneric } from '../../models/form-generic.model';
|
|
10
8
|
import { SdFormRender } from '../form-render/form-render.component';
|
|
11
9
|
import { ConfigureValidationComponent } from './components/configure-validation/configure-validation.component';
|
|
12
|
-
import { BuilderService } from './services';
|
|
13
10
|
import * as i0 from "@angular/core";
|
|
14
11
|
interface DragDropRowItem {
|
|
15
12
|
items: (SdFormGenericComponent | SdFormGenericGroup)[];
|
|
@@ -17,31 +14,71 @@ interface DragDropRowItem {
|
|
|
17
14
|
}
|
|
18
15
|
export declare class SdFormBuilder extends SdBaseSecureComponent {
|
|
19
16
|
#private;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
popupViewJSON?: SdModal;
|
|
25
|
-
popupConfigureVariables?: SdModal;
|
|
26
|
-
configureValidation?: ConfigureValidationComponent;
|
|
27
|
-
formRender?: SdFormRender;
|
|
17
|
+
readonly popupViewJSON: import("@angular/core").Signal<SdModal | undefined>;
|
|
18
|
+
readonly popupConfigureVariables: import("@angular/core").Signal<SdModal | undefined>;
|
|
19
|
+
readonly configureValidation: import("@angular/core").Signal<ConfigureValidationComponent | undefined>;
|
|
20
|
+
readonly formRender: import("@angular/core").Signal<SdFormRender | undefined>;
|
|
28
21
|
form: FormGroup<{}>;
|
|
29
|
-
|
|
22
|
+
/** Input chính: schema form. Mỗi lần ref thay đổi → effect sẽ clone về local arrays. */
|
|
23
|
+
readonly formGeneric: import("@angular/core").InputSignal<SdFormGeneric | undefined>;
|
|
24
|
+
readonly formBuilderComponents: FormBuilderComponent[];
|
|
25
|
+
readonly componentIcons: Record<string, {
|
|
26
|
+
symbol: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}>;
|
|
29
|
+
readonly paletteSearch: import("@angular/core").WritableSignal<string>;
|
|
30
|
+
readonly paletteGroups: import("@angular/core").Signal<{
|
|
31
|
+
key: FormBuilderComponentGroup;
|
|
32
|
+
label: string;
|
|
33
|
+
items: FormBuilderComponent[];
|
|
34
|
+
}[]>;
|
|
30
35
|
components: Required<SdFormGeneric>['components'];
|
|
31
36
|
variables: Required<SdFormGeneric>['variables'];
|
|
32
37
|
validations: Required<SdFormGeneric>['validations'];
|
|
38
|
+
/** Cloned variables — dùng cho modal "Configure variables" (huỷ thì discard, ok thì gán ngược). */
|
|
33
39
|
clonedVariables: SdFormGenericVariable[];
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
readonly selectedComponent: import("@angular/core").WritableSignal<SdFormGenericComponent | SdFormGenericGroup | undefined>;
|
|
41
|
+
readonly isPreview: import("@angular/core").WritableSignal<boolean>;
|
|
42
|
+
/** Signal toàn cục: TRUE khi BẤT KỲ cdkDrag nào đang active (palette, canvas, group, resize).
|
|
43
|
+
* Trigger class `.fb-shell--dragging` để ẩn hover/actions/resize toàn diện, không phụ thuộc :has(). */
|
|
44
|
+
readonly isAnyDragging: import("@angular/core").WritableSignal<boolean>;
|
|
37
45
|
expand: boolean;
|
|
38
46
|
dragDropRows: DragDropRowItem[];
|
|
39
47
|
isDragging: boolean;
|
|
40
48
|
targetItem?: DragDropRowItem;
|
|
41
|
-
|
|
49
|
+
private lastDragPointer?;
|
|
50
|
+
/** Handler chung cho mọi cdkDragStarted — set signal global true. */
|
|
51
|
+
onAnyDragStarted: () => void;
|
|
52
|
+
onAnyDragMoved: (event: CdkDragMove<any>) => void;
|
|
53
|
+
/** Handler chung cho mọi cdkDragEnded — set signal global false (dùng setTimeout 0
|
|
54
|
+
* để chờ CDK xử lý xong drop event trước khi UI re-enable). */
|
|
55
|
+
onAnyDragEnded: () => void;
|
|
56
|
+
constructor();
|
|
42
57
|
ngOnInit(): void;
|
|
43
58
|
ngOnDestroy(): void;
|
|
44
59
|
addComponent: (item: FormBuilderComponent, index?: number) => void;
|
|
60
|
+
/** Symbol Material để render trên canvas item / attribute header. */
|
|
61
|
+
symbolFor: (item: SdFormGenericComponent | SdFormGenericGroup) => string;
|
|
62
|
+
/** Human-readable type label (e.g. "Text field", "Date"). */
|
|
63
|
+
typeLabelFor: (item: SdFormGenericComponent | SdFormGenericGroup) => string;
|
|
64
|
+
/** True nếu component có expression điều kiện — drives the "conditional" status chip. */
|
|
65
|
+
hasConditional: (item: SdFormGenericComponent | SdFormGenericGroup) => boolean;
|
|
66
|
+
/** Map SdColor preset → 2 CSS var names cho header-bg và header-fg của group card. */
|
|
67
|
+
groupColorVars: (color: string | undefined | null) => {
|
|
68
|
+
bg: string;
|
|
69
|
+
fg: string;
|
|
70
|
+
};
|
|
71
|
+
/** Segmented Design/Preview toggle (replaces play_circle/stop_circle). */
|
|
72
|
+
setMode: (preview: boolean) => void;
|
|
73
|
+
/** Nested drop handler — when dragging a palette item or canvas item INTO a group body. */
|
|
74
|
+
dropInGroup: (event: CdkDragDrop<any[]>, group: SdFormGenericGroup) => void;
|
|
75
|
+
/** Quick-add break sau row chỉ định.
|
|
76
|
+
* Tính component index cuối cùng của row đó trong this.components, splice break vào sau.
|
|
77
|
+
* Không qua palette — chỉ là utility action bám theo row trên canvas.
|
|
78
|
+
*/
|
|
79
|
+
insertBreakAfter: (row: DragDropRowItem) => void;
|
|
80
|
+
/** Remove a child component from a group's nested list. */
|
|
81
|
+
removeFromGroup: (group: SdFormGenericGroup, id: string) => void;
|
|
45
82
|
removeComponent: (id: string) => void;
|
|
46
83
|
selectComponent: (item?: SdFormGenericComponent | SdFormGenericGroup) => void;
|
|
47
84
|
onClickedOutside: (e: any) => void;
|
|
@@ -55,6 +92,12 @@ export declare class SdFormBuilder extends SdBaseSecureComponent {
|
|
|
55
92
|
noReturnPredicate: () => boolean;
|
|
56
93
|
changeSizeControl: (event: CdkDragMove<SdFormGenericComponent | SdFormGenericGroup>, item: SdFormGenericComponent | SdFormGenericGroup, items: (SdFormGenericComponent | SdFormGenericGroup)[], currentIndex: number) => Promise<void>;
|
|
57
94
|
dragEndChangeSizeControl: (event: any) => void;
|
|
95
|
+
/** Resize a child item INSIDE a group.
|
|
96
|
+
* Math: lấy bounding của chính item, tính (mouse.x - item.left) / colWidth = newCols.
|
|
97
|
+
* Cách này đúng cho cả flex-wrap (item ở wrap row 2+) vì dùng item-relative,
|
|
98
|
+
* không phải sum-of-all-preceding-cols (sai khi item wrap xuống row mới).
|
|
99
|
+
*/
|
|
100
|
+
changeSizeChildInGroup: (event: CdkDragMove<SdFormGenericComponent>, child: SdFormGenericComponent, group: SdFormGenericGroup) => void;
|
|
58
101
|
onChangeViewed: (component: SdFormGenericComponent) => void;
|
|
59
102
|
onChangeHidden: (component: SdFormGenericComponent | SdFormGenericGroup) => void;
|
|
60
103
|
onDuplicate: (component: SdFormGenericComponent | SdFormGenericGroup) => void;
|
|
@@ -72,6 +115,6 @@ export declare class SdFormBuilder extends SdBaseSecureComponent {
|
|
|
72
115
|
onUpdateValidations: (validations: SdFormGenericValidation[]) => void;
|
|
73
116
|
onValidate: () => Promise<void>;
|
|
74
117
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdFormBuilder, never>;
|
|
75
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdFormBuilder, "sd-form-builder", never, { "
|
|
118
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdFormBuilder, "sd-form-builder", never, { "formGeneric": { "alias": "formGeneric"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
76
119
|
}
|
|
77
120
|
export {};
|
|
@@ -29,11 +29,11 @@ export declare class SdFormRender extends SdBaseSecureComponent implements OnDes
|
|
|
29
29
|
key: string;
|
|
30
30
|
value: any;
|
|
31
31
|
}>;
|
|
32
|
-
constructor(ref: ChangeDetectorRef, formGenericConfiguration: ISdFormGenericConfiguration);
|
|
32
|
+
constructor(ref: ChangeDetectorRef, formGenericConfiguration: ISdFormGenericConfiguration | null);
|
|
33
33
|
ngAfterViewInit(): void;
|
|
34
34
|
ngOnDestroy(): void;
|
|
35
35
|
upload: () => Promise<void>;
|
|
36
36
|
getValidationMessages: (alert: SdFormGenericValidation["alert"]) => Promise<string[] | undefined>;
|
|
37
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SdFormRender,
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdFormRender, [null, { optional: true; }]>;
|
|
38
38
|
static ɵcmp: i0.ɵɵComponentDeclaration<SdFormRender, "sd-form-render", never, { "form": { "alias": "form"; "required": false; }; "_configuration": { "alias": "configuration"; "required": true; }; "_default": { "alias": "defaultEntity"; "required": false; }; "_entity": { "alias": "entity"; "required": false; }; "_properties": { "alias": "properties"; "required": false; }; "_viewed": { "alias": "viewed"; "required": false; }; }, {}, never, never, true, never>;
|
|
39
39
|
}
|
|
@@ -26,7 +26,7 @@ export interface SdFormGenericVariable {
|
|
|
26
26
|
key: string;
|
|
27
27
|
label: string;
|
|
28
28
|
}
|
|
29
|
-
export type SdFormGenericComponent = SdFormGenericTextfield | SdFormGenericChipString | SdFormGenericChipCalendar | SdFormGenericTextarea | SdFormGenericNumber | SdFormGenericCheckbox | SdFormGenericDatetime | SdFormGenericValues | SdFormGenericUpload | SdFormGenericTable | SdFormGenericHtml;
|
|
29
|
+
export type SdFormGenericComponent = SdFormGenericTextfield | SdFormGenericChipString | SdFormGenericChipCalendar | SdFormGenericTextarea | SdFormGenericNumber | SdFormGenericCheckbox | SdFormGenericDatetime | SdFormGenericValues | SdFormGenericUpload | SdFormGenericTable | SdFormGenericHtml | SdFormGenericBreak;
|
|
30
30
|
export type SdFormGenericValues = SdFormGenericRadio | SdFormGenericSelect | SdFormGenericChecklist;
|
|
31
31
|
export interface SdFormGenericComponentBase {
|
|
32
32
|
template?: string;
|
|
@@ -254,6 +254,17 @@ export interface SdFormGenericTable extends SdFormGenericComponentBase {
|
|
|
254
254
|
titleButtonCreate?: string;
|
|
255
255
|
} & SdFormGenericComponentBase['properties'];
|
|
256
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* Break component — invisible runtime element ép xuống dòng mới. Dùng khi layout có
|
|
259
|
+
* vùng cố định và việc ẩn/hiện trường khác không nên xáo trộn vị trí các trường còn lại.
|
|
260
|
+
* Ở canvas (design) render thanh ngang mảnh; ở runtime render empty 12-col cell.
|
|
261
|
+
*
|
|
262
|
+
* Extend SdFormGenericComponentBase để tương thích với union narrowing trong các pipe/render
|
|
263
|
+
* (key, validate, disabled, properties full) — runtime sẽ ignore mọi field ngoài id/type/layout.
|
|
264
|
+
*/
|
|
265
|
+
export interface SdFormGenericBreak extends SdFormGenericComponentBase {
|
|
266
|
+
type: 'break';
|
|
267
|
+
}
|
|
257
268
|
export interface SdFormGenericHtml {
|
|
258
269
|
template?: string;
|
|
259
270
|
id: string;
|
|
@@ -282,12 +293,21 @@ export interface SdFormGenericHtml {
|
|
|
282
293
|
query?: Record<string, any>;
|
|
283
294
|
};
|
|
284
295
|
}
|
|
296
|
+
export type FormBuilderComponentGroup = 'basic' | 'choice' | 'advanced' | 'layout';
|
|
285
297
|
export interface FormBuilderComponent {
|
|
286
298
|
type: string;
|
|
287
|
-
icon
|
|
299
|
+
/** Material Symbols Rounded icon name. Rendered via <span class="msi">{symbol}</span>. */
|
|
300
|
+
symbol: string;
|
|
301
|
+
/** Category group for the left palette grouping. */
|
|
302
|
+
group: FormBuilderComponentGroup;
|
|
288
303
|
name: string;
|
|
289
304
|
}
|
|
290
305
|
export declare const FormBuilderComponents: FormBuilderComponent[];
|
|
306
|
+
/** Lookup: component type → Material Symbol + label, used by attribute panel header. */
|
|
307
|
+
export declare const COMPONENT_ICONS: Record<string, {
|
|
308
|
+
symbol: string;
|
|
309
|
+
label: string;
|
|
310
|
+
}>;
|
|
291
311
|
export declare const GetComponentAttributes: (components: (SdFormGenericComponent | SdFormGenericGroup)[]) => {
|
|
292
312
|
value: string;
|
|
293
313
|
display: string;
|
package/components/index.d.ts
CHANGED
|
@@ -20,3 +20,4 @@ export * from '@sd-angular/core/components/code-editor';
|
|
|
20
20
|
export * from '@sd-angular/core/components/chart';
|
|
21
21
|
export * from '@sd-angular/core/components/editor';
|
|
22
22
|
export * from '@sd-angular/core/components/splitter';
|
|
23
|
+
export * from '@sd-angular/core/components/preview';
|
|
@@ -6,6 +6,9 @@ export declare class SdModal {
|
|
|
6
6
|
static index: import("@angular/core").WritableSignal<number>;
|
|
7
7
|
templateRef: import("@angular/core").Signal<TemplateRef<any>>;
|
|
8
8
|
modal: import("@angular/core").Signal<ElementRef<any> | undefined>;
|
|
9
|
+
readonly autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
10
|
+
readonly autoId: import("@angular/core").Signal<string | undefined>;
|
|
11
|
+
readonly closeButtonAutoId: import("@angular/core").Signal<string | undefined>;
|
|
9
12
|
title: import("@angular/core").InputSignalWithTransform<string, string | null | undefined>;
|
|
10
13
|
color: import("@angular/core").InputSignalWithTransform<SdColor, SdColor | null | undefined>;
|
|
11
14
|
width: import("@angular/core").InputSignalWithTransform<string, string | null | undefined>;
|
|
@@ -22,5 +25,5 @@ export declare class SdModal {
|
|
|
22
25
|
open: () => void;
|
|
23
26
|
close: () => void;
|
|
24
27
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdModal, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "[sdHeader]", "*", "[sdFooterLeft]", "[sdFooterRight]", "[sdFooter]"], true, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdModal, "sd-modal", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "modalClass": { "alias": "modalClass"; "required": false; "isSignal": true; }; "lazyLoadContent": { "alias": "lazyLoadContent"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; "disableBackdropClose": { "alias": "disableBackdropClose"; "required": false; "isSignal": true; }; }, { "sdClosed": "sdClosed"; }, never, ["[sdHeaderLeft]", "[sdHeaderRight]", "[sdHeader]", "*", "[sdFooterLeft]", "[sdFooterRight]", "[sdFooter]"], true, never>;
|
|
26
29
|
}
|
|
@@ -1,28 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import { NormalizedImage, PreviewItem, PreviewStage, PreviewTheme, ThumbnailPosition } from './preview-image.types';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
blobSrc: string;
|
|
7
|
-
src?: string;
|
|
8
|
-
name: string;
|
|
9
|
-
size: number;
|
|
10
|
-
}
|
|
11
|
-
export declare class SdPreviewImage {
|
|
4
|
+
export declare class SdPreviewImage implements OnDestroy {
|
|
12
5
|
#private;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
static readonly MIN_ZOOM = 0.25;
|
|
7
|
+
static readonly MAX_ZOOM = 4;
|
|
8
|
+
static readonly ZOOM_STEP = 0.1;
|
|
9
|
+
static readonly SWIPE_THRESHOLD = 40;
|
|
10
|
+
readonly autoIdInput: import("@angular/core").InputSignal<string | null | undefined>;
|
|
11
|
+
readonly autoId: import("@angular/core").Signal<string | undefined>;
|
|
12
|
+
readonly autoIdPrev: import("@angular/core").Signal<string | undefined>;
|
|
13
|
+
readonly autoIdNext: import("@angular/core").Signal<string | undefined>;
|
|
14
|
+
readonly autoIdZoomIn: import("@angular/core").Signal<string | undefined>;
|
|
15
|
+
readonly autoIdZoomOut: import("@angular/core").Signal<string | undefined>;
|
|
16
|
+
readonly autoIdFit: import("@angular/core").Signal<string | undefined>;
|
|
17
|
+
readonly autoIdRotate: import("@angular/core").Signal<string | undefined>;
|
|
18
|
+
readonly autoIdDownload: import("@angular/core").Signal<string | undefined>;
|
|
19
|
+
readonly autoIdFullscreen: import("@angular/core").Signal<string | undefined>;
|
|
20
|
+
readonly autoIdRetry: import("@angular/core").Signal<string | undefined>;
|
|
21
|
+
readonly autoIdThumb: (i: number) => string | undefined;
|
|
22
|
+
readonly autoIdDot: (i: number) => string | undefined;
|
|
23
|
+
readonly items: import("@angular/core").InputSignal<PreviewItem[]>;
|
|
24
|
+
readonly title: import("@angular/core").InputSignal<string | undefined>;
|
|
25
|
+
readonly thumbnailPosition: import("@angular/core").InputSignal<ThumbnailPosition>;
|
|
26
|
+
readonly showToolbar: import("@angular/core").InputSignal<boolean>;
|
|
27
|
+
readonly downloadable: import("@angular/core").InputSignal<boolean>;
|
|
28
|
+
readonly zoomable: import("@angular/core").InputSignal<boolean>;
|
|
29
|
+
readonly loop: import("@angular/core").InputSignal<boolean>;
|
|
30
|
+
readonly startIndex: import("@angular/core").InputSignal<number>;
|
|
31
|
+
readonly theme: import("@angular/core").InputSignal<PreviewTheme>;
|
|
32
|
+
readonly close: import("@angular/core").OutputEmitterRef<void>;
|
|
33
|
+
readonly activeIndexChange: import("@angular/core").OutputEmitterRef<number>;
|
|
34
|
+
readonly download: import("@angular/core").OutputEmitterRef<{
|
|
35
|
+
index: number;
|
|
36
|
+
item: NormalizedImage;
|
|
37
|
+
}>;
|
|
38
|
+
readonly imageError: import("@angular/core").OutputEmitterRef<{
|
|
39
|
+
index: number;
|
|
40
|
+
reason: string;
|
|
41
|
+
}>;
|
|
42
|
+
readonly activeIndex: import("@angular/core").Signal<number>;
|
|
43
|
+
readonly images: import("@angular/core").Signal<NormalizedImage[]>;
|
|
44
|
+
readonly zoom: import("@angular/core").Signal<number>;
|
|
45
|
+
readonly rotation: import("@angular/core").Signal<number>;
|
|
46
|
+
readonly pan: import("@angular/core").Signal<{
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
}>;
|
|
50
|
+
readonly stage: import("@angular/core").Signal<PreviewStage>;
|
|
51
|
+
readonly isFullscreen: import("@angular/core").Signal<boolean>;
|
|
52
|
+
readonly activeImage: import("@angular/core").Signal<NormalizedImage | undefined>;
|
|
53
|
+
readonly hasPrev: import("@angular/core").Signal<boolean>;
|
|
54
|
+
readonly hasNext: import("@angular/core").Signal<boolean>;
|
|
55
|
+
readonly zoomPercent: import("@angular/core").Signal<number>;
|
|
56
|
+
readonly imageTransform: import("@angular/core").Signal<string>;
|
|
57
|
+
readonly shellClass: import("@angular/core").Signal<{
|
|
58
|
+
[x: string]: boolean;
|
|
59
|
+
'sd-preview-shell': boolean;
|
|
60
|
+
'sd-preview-shell--fullscreen': boolean;
|
|
61
|
+
}>;
|
|
62
|
+
constructor();
|
|
63
|
+
ngOnDestroy(): void;
|
|
64
|
+
onClickThumbnailImage(index: number): void;
|
|
65
|
+
updateCurrentImage(direction: 1 | -1): void;
|
|
66
|
+
zoomIn(): void;
|
|
67
|
+
zoomOut(): void;
|
|
68
|
+
fitToScreen(): void;
|
|
69
|
+
rotate(direction: 'left' | 'right'): void;
|
|
70
|
+
downloadCurrent(): void;
|
|
71
|
+
toggleFullscreen(): void;
|
|
72
|
+
/** Retry just the active image (Artboard G action). */
|
|
73
|
+
retryActive(): Promise<void>;
|
|
74
|
+
/** User clicked the X button — emit close intent for the consumer to react. */
|
|
75
|
+
requestClose(): void;
|
|
76
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
77
|
+
onWheel(event: WheelEvent): void;
|
|
78
|
+
onPointerDown(event: PointerEvent): void;
|
|
79
|
+
onPointerMove(event: PointerEvent): void;
|
|
80
|
+
onPointerUp(event: PointerEvent): void;
|
|
81
|
+
onPointerCancel(event: PointerEvent): void;
|
|
82
|
+
onImageDblClick(): void;
|
|
83
|
+
onImageError(): void;
|
|
84
|
+
trackByImage(_i: number, item: NormalizedImage): string;
|
|
85
|
+
formatBytes(bytes: number): string;
|
|
25
86
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdPreviewImage, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SdPreviewImage, "sd-preview-image", never, {}, { "close": "close"; }, never, never, true, never>;
|
|
87
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdPreviewImage, "sd-preview-image", never, { "autoIdInput": { "alias": "autoId"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "thumbnailPosition": { "alias": "thumbnailPosition"; "required": false; "isSignal": true; }; "showToolbar": { "alias": "showToolbar"; "required": false; "isSignal": true; }; "downloadable": { "alias": "downloadable"; "required": false; "isSignal": true; }; "zoomable": { "alias": "zoomable"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "startIndex": { "alias": "startIndex"; "required": false; "isSignal": true; }; "theme": { "alias": "theme"; "required": false; "isSignal": true; }; }, { "close": "close"; "activeIndexChange": "activeIndexChange"; "download": "download"; "imageError": "imageError"; }, never, never, true, never>;
|
|
27
88
|
}
|
|
28
|
-
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shape descriptor accepted by SdPreviewImage's `items` signal input.
|
|
3
|
+
*
|
|
4
|
+
* - `string` — CDN/HTTP URL; component will fetch as blob and create a File.
|
|
5
|
+
* - `File` — already-selected file from <input type="file">. Must be `image/*`.
|
|
6
|
+
* - Detailed object — when the caller wants to override name/caption/alt.
|
|
7
|
+
*/
|
|
8
|
+
export type PreviewItem = string | File | {
|
|
9
|
+
url?: string;
|
|
10
|
+
file?: File;
|
|
11
|
+
name?: string;
|
|
12
|
+
caption?: string;
|
|
13
|
+
alt?: string;
|
|
14
|
+
mime?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Internal normalized record. One per slot in the gallery.
|
|
18
|
+
* `blobUrl` is always set after a successful load so the <img> binding can
|
|
19
|
+
* be uniform; `url` retains the original CDN URL for download fallback.
|
|
20
|
+
*/
|
|
21
|
+
export interface NormalizedImage {
|
|
22
|
+
id: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
blobUrl: string;
|
|
25
|
+
name: string;
|
|
26
|
+
size: number;
|
|
27
|
+
caption?: string;
|
|
28
|
+
alt?: string;
|
|
29
|
+
loading: boolean;
|
|
30
|
+
error: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Stage = the visual state of the main image area inside the viewer shell.
|
|
34
|
+
* Driven by an internal `_stage` signal in the component.
|
|
35
|
+
*/
|
|
36
|
+
export type PreviewStage = 'ready' | 'loading' | 'error' | 'empty';
|
|
37
|
+
/**
|
|
38
|
+
* Where the thumbnail navigator sits relative to the stage. `none` removes
|
|
39
|
+
* thumbnails entirely (single-image lightbox); `dots` swaps the strip for
|
|
40
|
+
* compact dot indicators (≤ 8 images).
|
|
41
|
+
*/
|
|
42
|
+
export type ThumbnailPosition = 'bottom' | 'right' | 'left' | 'top' | 'dots' | 'none';
|
|
43
|
+
/**
|
|
44
|
+
* Color scheme for the preview shell. `'dark'` (default) keeps the original
|
|
45
|
+
* dark-theme tokens (black surfaces, white text). `'light'` flips the token
|
|
46
|
+
* set to white surfaces / dark text — picks up `--sd-primary`, `--sd-error`,
|
|
47
|
+
* `--sd-success` from the consumer theme when present.
|
|
48
|
+
*
|
|
49
|
+
* Exposed via `[attr.data-theme]` on the host so SCSS can swap CSS custom
|
|
50
|
+
* properties via the `:host([data-theme="light"])` selector — no runtime
|
|
51
|
+
* style switching is required.
|
|
52
|
+
*/
|
|
53
|
+
export type PreviewTheme = 'dark' | 'light';
|