@sd-angular/core 19.0.0-beta.2 → 19.0.0-beta.21
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/assets/scss/ckeditor5.scss +59 -2
- package/components/avatar/index.d.ts +1 -0
- package/components/avatar/src/avatar.component.d.ts +14 -0
- package/components/document-builder/src/document-builder.component.d.ts +29 -7
- package/components/document-builder/src/document-builder.config.d.ts +21 -0
- package/components/document-builder/src/document-builder.model.d.ts +6 -1
- package/components/document-builder/src/document-builder.utils.d.ts +10 -0
- package/components/document-builder/src/plugins/{table-fit.plugin.d.ts → heading/heading.plugin.d.ts} +1 -1
- package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
- package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
- package/components/document-builder/src/plugins/{image-upload.plugin.d.ts → image-upload/image-upload.plugin.d.ts} +0 -4
- package/components/document-builder/src/plugins/index.d.ts +7 -5
- package/components/document-builder/src/plugins/table-fit/table-fit.plugin.d.ts +29 -0
- package/components/index.d.ts +2 -0
- package/components/mini-editor/index.d.ts +2 -0
- package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
- package/components/mini-editor/src/mini-editor.model.d.ts +42 -0
- package/components/table/src/directives/index.d.ts +2 -0
- package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
- package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
- package/components/table/src/models/table-column.model.d.ts +7 -7
- package/components/table/src/models/table-command.model.d.ts +4 -0
- package/components/table/src/models/table-item.model.d.ts +2 -1
- package/components/table/src/models/table-option-export.model.d.ts +3 -2
- package/components/table/src/models/table-option.model.d.ts +10 -8
- package/components/table/src/services/table-filter/table-filter.model.d.ts +2 -2
- package/components/view/index.d.ts +1 -0
- package/components/view/src/view.component.d.ts +14 -0
- package/components/workflow/src/models/index.d.ts +1 -0
- package/directives/index.d.ts +1 -0
- package/directives/src/sd-href.directive.d.ts +9 -0
- package/fesm2022/sd-angular-core-components-avatar.mjs +88 -0
- package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-badge.mjs +2 -2
- package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-document-builder.mjs +1329 -557
- package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
- package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-table.mjs +510 -84
- package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components-view.mjs +88 -0
- package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
- package/fesm2022/sd-angular-core-components-workflow.mjs +33 -43
- package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
- package/fesm2022/sd-angular-core-components.mjs +2 -0
- package/fesm2022/sd-angular-core-components.mjs.map +1 -1
- package/fesm2022/sd-angular-core-directives.mjs +51 -2
- package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs +24 -2
- package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-date.mjs +15 -3
- package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-datetime.mjs +17 -3
- package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input-number.mjs +25 -3
- package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-input.mjs +20 -6
- package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-radio.mjs +18 -2
- package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-select.mjs +19 -3
- package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
- package/fesm2022/sd-angular-core-forms-textarea.mjs +21 -2
- package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-auth.mjs +137 -0
- package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -0
- package/fesm2022/sd-angular-core-modules-layout.mjs +52 -17
- package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -2
- package/fesm2022/sd-angular-core-modules-oidc.mjs.map +1 -1
- package/fesm2022/sd-angular-core-modules.mjs +1 -0
- package/fesm2022/sd-angular-core-modules.mjs.map +1 -1
- package/fesm2022/sd-angular-core-pipes.mjs +21 -1
- package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
- package/fesm2022/sd-angular-core-services-confirm.mjs +6 -9
- package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs +66 -1
- package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
- package/fesm2022/sd-angular-core-utilities-models.mjs +12 -3
- package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
- package/forms/autocomplete/src/autocomplete.component.d.ts +5 -1
- package/forms/date/src/date.component.d.ts +4 -1
- package/forms/datetime/src/datetime.component.d.ts +4 -1
- package/forms/input/src/input.component.d.ts +6 -4
- package/forms/input-number/src/input-number.component.d.ts +4 -1
- package/forms/radio/src/radio.component.d.ts +5 -1
- package/forms/select/src/select.component.d.ts +5 -1
- package/forms/textarea/src/textarea.component.d.ts +3 -1
- package/modules/auth/configurations/auth.configuration.d.ts +19 -0
- package/modules/auth/configurations/index.d.ts +1 -0
- package/modules/auth/guards/auth.guard.d.ts +11 -0
- package/modules/auth/guards/index.d.ts +2 -0
- package/modules/auth/guards/portal.guard.d.ts +11 -0
- package/modules/auth/index.d.ts +3 -0
- package/modules/auth/services/auth.model.d.ts +8 -0
- package/modules/auth/services/auth.service.d.ts +17 -0
- package/modules/auth/services/index.d.ts +2 -0
- package/modules/index.d.ts +1 -0
- package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
- package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +5 -2
- package/modules/layout/configurations/layout.configuration.d.ts +3 -0
- package/modules/layout/services/storage/storage.service.d.ts +1 -0
- package/package.json +80 -64
- package/pipes/index.d.ts +1 -0
- package/pipes/src/empty.pipe.d.ts +7 -0
- package/sd-angular-core-19.0.0-beta.21.tgz +0 -0
- package/services/confirm/src/lib/confirm.service.d.ts +1 -0
- package/utilities/extensions/index.d.ts +1 -0
- package/utilities/extensions/src/color.extension.d.ts +20 -0
- package/utilities/models/index.d.ts +1 -0
- package/utilities/models/src/maybe-async.model.d.ts +1 -0
- package/utilities/models/src/nested-key-of.model.d.ts +5 -0
- package/utilities/models/src/pattern.model.d.ts +2 -2
- /package/components/document-builder/src/plugins/{comment.plugin.d.ts → comment/comment.plugin.d.ts} +0 -0
- /package/components/document-builder/src/plugins/{page-orientation.plugin.d.ts → page-orientation/page-orientation.plugin.d.ts} +0 -0
- /package/components/document-builder/src/plugins/{variable.plugin.d.ts → variable/variable.plugin.d.ts} +0 -0
|
@@ -21,11 +21,68 @@
|
|
|
21
21
|
@import '@ckeditor/ckeditor5-basic-styles/dist/index.css';
|
|
22
22
|
// @import '@ckeditor/ckeditor5-block-quote/dist/index.css';
|
|
23
23
|
@import '@ckeditor/ckeditor5-heading/dist/index.css';
|
|
24
|
-
@import '@ckeditor/ckeditor5-image/dist/index.css';
|
|
24
|
+
// @import '@ckeditor/ckeditor5-image/dist/index.css';
|
|
25
|
+
@import '@ckeditor/ckeditor5-image/dist/index-editor.css';
|
|
25
26
|
@import '@ckeditor/ckeditor5-indent/dist/index.css';
|
|
26
27
|
@import '@ckeditor/ckeditor5-link/dist/index.css';
|
|
27
28
|
@import '@ckeditor/ckeditor5-list/dist/index.css';
|
|
28
29
|
// @import '@ckeditor/ckeditor5-media-embed/dist/index.css';
|
|
29
30
|
@import '@ckeditor/ckeditor5-paste-from-office/dist/index.css';
|
|
30
|
-
|
|
31
|
+
|
|
32
|
+
// hung.pham16: không sử dụng default styles của ckeditor vì server không hỗ trợ
|
|
33
|
+
// @import '@ckeditor/ckeditor5-table/dist/index.css';
|
|
34
|
+
@import '@ckeditor/ckeditor5-table/dist/index-editor.css';
|
|
35
|
+
|
|
31
36
|
// @import '@ckeditor/ckeditor5-mention/dist/index.css';
|
|
37
|
+
|
|
38
|
+
// Custom toolbar
|
|
39
|
+
.ck-editor {
|
|
40
|
+
/* --- 1. GIẢM KÍCH THƯỚC ICON VÀ CHỮ --- */
|
|
41
|
+
/* Giảm cỡ chữ trong dropdown (mặc định khoảng 13px) */
|
|
42
|
+
--ck-font-size-base: 11px !important;
|
|
43
|
+
|
|
44
|
+
/* Giảm kích thước Icon (mặc định 20px) */
|
|
45
|
+
--ck-icon-size: 16px !important;
|
|
46
|
+
|
|
47
|
+
/* --- 2. TỐI ƯU KHOẢNG CÁCH (Padding/Margin) --- */
|
|
48
|
+
|
|
49
|
+
/* Giảm khoảng cách giữa các nút */
|
|
50
|
+
--ck-spacing-small: 2px !important;
|
|
51
|
+
--ck-spacing-standard: 6px !important;
|
|
52
|
+
--ck-spacing-large: 8px !important;
|
|
53
|
+
|
|
54
|
+
/* */
|
|
55
|
+
--ck-color-table-focused-cell-background: transparent !important;
|
|
56
|
+
--ck-table-content-default-border-color: transparent !important;
|
|
57
|
+
|
|
58
|
+
//
|
|
59
|
+
--ck-insert-table-dropdown-padding: 10px;
|
|
60
|
+
--ck-insert-table-dropdown-box-height: 16px;
|
|
61
|
+
--ck-insert-table-dropdown-box-width: 16px;
|
|
62
|
+
--ck-insert-table-dropdown-box-margin: 1px;
|
|
63
|
+
|
|
64
|
+
--ck-focus-ring: 1px solid var(--ck-color-base-border);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* Giảm độ cao của thanh toolbar (cho gọn) */
|
|
68
|
+
.ck-toolbar {
|
|
69
|
+
min-height: 32px !important; /* Mặc định thường là 40px */
|
|
70
|
+
padding: 2px !important;
|
|
71
|
+
|
|
72
|
+
/* Làm màu nền toolbar nhạt hơn cho hiện đại */
|
|
73
|
+
background: #f8f9fa !important;
|
|
74
|
+
border-bottom: 1px solid #e0e0e0 !important;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ck-toolbar__items {
|
|
78
|
+
/* Chỉnh nút bấm trong toolbar nhỏ lại */
|
|
79
|
+
> .ck-button {
|
|
80
|
+
padding: 2px 4px !important; /* Giảm padding trái phải của nút */
|
|
81
|
+
min-height: 24px !important;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* Chỉnh lại dropdown (Heading, Font Size) cho khớp */
|
|
85
|
+
> .ck-dropdown {
|
|
86
|
+
min-height: 24px !important;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/avatar.component';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdAvatar implements OnInit {
|
|
4
|
+
#private;
|
|
5
|
+
src: string | undefined | null;
|
|
6
|
+
size: number;
|
|
7
|
+
isUrl: boolean;
|
|
8
|
+
initials: string;
|
|
9
|
+
bgColor: string;
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
handleError(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdAvatar, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdAvatar, "sd-avatar", never, { "src": { "alias": "src"; "required": true; }; "size": { "alias": "size"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -7,23 +7,28 @@ export declare class SdDocumentBuilder {
|
|
|
7
7
|
option: SdDocumentBuilderOption;
|
|
8
8
|
disabled: boolean;
|
|
9
9
|
set _disabled(val: boolean | '' | undefined | null);
|
|
10
|
+
contentChange: EventEmitter<string>;
|
|
10
11
|
Editor: typeof ClassicEditor;
|
|
11
12
|
config: SdEditorConfig;
|
|
12
|
-
contentChange: EventEmitter<string>;
|
|
13
13
|
ngOnInit(): void;
|
|
14
14
|
ngOnDestroy(): void;
|
|
15
15
|
onReady(editor: ClassicEditor): void;
|
|
16
|
-
scrollToComment: (markerId: string) => void;
|
|
17
16
|
setContent: (html: string) => void;
|
|
18
17
|
getContent: () => string;
|
|
19
18
|
setOrientation: (orientation: "PORTRAIT" | "LANDSCAPE") => void;
|
|
20
19
|
getOrientation: () => "PORTRAIT" | "LANDSCAPE";
|
|
21
|
-
getVariables: () => SdDocumentBuilderVariable[];
|
|
22
|
-
getComments(): SdDocumentBuilderComment[];
|
|
23
20
|
scrollToTop(): void;
|
|
24
21
|
heading: {
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Lấy tất cả headings trong document
|
|
24
|
+
* @returns Danh sách tất cả headings
|
|
25
|
+
*/
|
|
26
|
+
all: () => SdDocumentBuilderHeading[];
|
|
27
|
+
/**
|
|
28
|
+
* Scroll tới vị trí của heading
|
|
29
|
+
* @param id - ID của heading cần scroll tới
|
|
30
|
+
*/
|
|
31
|
+
scroll: (id: string) => void;
|
|
27
32
|
};
|
|
28
33
|
comment: {
|
|
29
34
|
/**
|
|
@@ -37,7 +42,10 @@ export declare class SdDocumentBuilder {
|
|
|
37
42
|
* @param data - Dữ liệu extra data
|
|
38
43
|
* @returns SdDocumentBuilderComment hoặc null nếu không có text được chọn
|
|
39
44
|
*/
|
|
40
|
-
add: <T = any>(range: ModelRange, comment: string,
|
|
45
|
+
add: <T = any>(range: ModelRange, comment: string, args?: {
|
|
46
|
+
markerIdExternal?: string | number;
|
|
47
|
+
data?: T;
|
|
48
|
+
}) => SdDocumentBuilderComment<T> | null;
|
|
41
49
|
/**
|
|
42
50
|
* Cập nhật nội dung comment
|
|
43
51
|
* @param markerId - ID của marker
|
|
@@ -63,6 +71,18 @@ export declare class SdDocumentBuilder {
|
|
|
63
71
|
*/
|
|
64
72
|
scroll: (markerId: string) => void;
|
|
65
73
|
};
|
|
74
|
+
variable: {
|
|
75
|
+
/**
|
|
76
|
+
* Lấy tất cả variabes trong document
|
|
77
|
+
* @returns Danh sách tất cả variables
|
|
78
|
+
*/
|
|
79
|
+
all: <T = any>() => SdDocumentBuilderVariable<T>[];
|
|
80
|
+
/**
|
|
81
|
+
* Scroll tới vị trí của variable
|
|
82
|
+
* @param uuid - uuid của variable FE sẽ tự sinh sau mỗi lần drop vào editor
|
|
83
|
+
*/
|
|
84
|
+
scroll: (uuid: string) => void;
|
|
85
|
+
};
|
|
66
86
|
/**
|
|
67
87
|
* Xuất file Word có Header/Footer
|
|
68
88
|
* @param fileName Tên file
|
|
@@ -76,6 +96,8 @@ export declare class SdDocumentBuilder {
|
|
|
76
96
|
header?: string;
|
|
77
97
|
footer?: string;
|
|
78
98
|
}): void;
|
|
99
|
+
hightSelectRange: (range: ModelRange) => void;
|
|
100
|
+
removeHighlightSeclectRange: () => void;
|
|
79
101
|
static ɵfac: i0.ɵɵFactoryDeclaration<SdDocumentBuilder, never>;
|
|
80
102
|
static ɵcmp: i0.ɵɵComponentDeclaration<SdDocumentBuilder, "sd-document-builder", never, { "option": { "alias": "option"; "required": true; }; "_disabled": { "alias": "disabled"; "required": false; }; }, { "contentChange": "contentChange"; }, never, never, true, never>;
|
|
81
103
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cấu hình màu cho Document Builder
|
|
3
|
+
* Bảng màu tập trung và cấu hình cho việc lựa chọn màu nhất quán
|
|
4
|
+
*/
|
|
5
|
+
import { ColorPickerConfig, FontColorConfig, FontSizeConfig, HeadingConfig } from 'ckeditor5';
|
|
6
|
+
/**
|
|
7
|
+
* Trả về bảng màu chung được sử dụng trong tất cả tính năng của document builder
|
|
8
|
+
* @returns Mảng các tùy chọn màu được định sẵn với giá trị hex và label
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPresetColors(): FontColorConfig['colors'];
|
|
11
|
+
/**
|
|
12
|
+
* Trả về cấu hình bộ chọn màu với định dạng hex
|
|
13
|
+
* @returns Đối tượng cấu hình bộ chọn màu
|
|
14
|
+
*/
|
|
15
|
+
export declare function getColorPickerConfig(): ColorPickerConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Trả về cấu hình kích thước font cho document builder
|
|
18
|
+
* @returns Mảng các tùy chọn kích thước font được định sẵn
|
|
19
|
+
*/
|
|
20
|
+
export declare function getFontSizeOptions(): FontSizeConfig['options'];
|
|
21
|
+
export declare function getHeadingOptions(): HeadingConfig['options'];
|
|
@@ -4,7 +4,7 @@ export type SdEditorConfig = EditorConfig & {
|
|
|
4
4
|
};
|
|
5
5
|
export interface SdDocumentBuilderOption {
|
|
6
6
|
onDropVariable?: (variable: SdDocumentBuilderVariable, dropIndex: number) => boolean | Promise<boolean | SdDocumentBuilderVariable>;
|
|
7
|
-
onAddComment?: (
|
|
7
|
+
onAddComment?: (selectedComment: SdDocumentBuilderSelectedComment) => void;
|
|
8
8
|
onSelectComment?: (markerId: string) => void;
|
|
9
9
|
onSelection?: (selection: ModelDocumentSelection, $event: EventInfo<string, unknown>) => void;
|
|
10
10
|
onOrientation?: (orientation: 'PORTRAIT' | 'LANDSCAPE') => void;
|
|
@@ -12,10 +12,15 @@ export interface SdDocumentBuilderOption {
|
|
|
12
12
|
}
|
|
13
13
|
export interface SdDocumentBuilderVariable<T = any> {
|
|
14
14
|
id: string;
|
|
15
|
+
uuid?: string;
|
|
15
16
|
value: string;
|
|
16
17
|
display: string;
|
|
17
18
|
data?: T;
|
|
18
19
|
}
|
|
20
|
+
export interface SdDocumentBuilderSelectedComment {
|
|
21
|
+
range: ModelRange;
|
|
22
|
+
selectedText: string;
|
|
23
|
+
}
|
|
19
24
|
export interface SdDocumentBuilderComment<T = any> {
|
|
20
25
|
markerId: string;
|
|
21
26
|
selectedText: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Document Builder Utilities
|
|
3
|
+
* Các hàm tiện ích cho document builder
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Chuẩn hóa nội dung bằng cách chuyển đổi tất cả màu HSL và RGB sang hex
|
|
7
|
+
* @param content - Nội dung HTML cần chuẩn hóa
|
|
8
|
+
* @returns Nội dung đã được chuẩn hóa với màu hex
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalize(content: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Plugin } from 'ckeditor5';
|
|
2
|
+
export declare class ImageCustomPlugin extends Plugin {
|
|
3
|
+
static get pluginName(): "ImageCustomPlugin";
|
|
4
|
+
init(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Xử lý sự kiện chèn ảnh
|
|
7
|
+
*/
|
|
8
|
+
private handleImageInsert;
|
|
9
|
+
/**
|
|
10
|
+
* Xử lý sự kiện thay đổi attribute ảnh
|
|
11
|
+
*/
|
|
12
|
+
private handleImageAttributeChange;
|
|
13
|
+
/**
|
|
14
|
+
* Xử lý sự kiện thay đổi style ảnh - thêm float inline style cho căn chỉnh
|
|
15
|
+
*/
|
|
16
|
+
private handleImageStyleChange;
|
|
17
|
+
/**
|
|
18
|
+
* Áp dụng custom styles cho element ảnh
|
|
19
|
+
*/
|
|
20
|
+
private applyCustomStyles;
|
|
21
|
+
/**
|
|
22
|
+
* Tìm container ck-widget (element figure)
|
|
23
|
+
* CKEditor wrap ảnh block trong <figure class="ck-widget"><img></figure>
|
|
24
|
+
*/
|
|
25
|
+
private findWidgetElement;
|
|
26
|
+
/**
|
|
27
|
+
* Tìm element img thực tế bên trong widget structure
|
|
28
|
+
* CKEditor wrap ảnh block trong <figure class="ck-widget"><img></figure>
|
|
29
|
+
*/
|
|
30
|
+
private findImgElement;
|
|
31
|
+
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { Plugin } from 'ckeditor5';
|
|
2
|
-
/**
|
|
3
|
-
* Custom base64 upload adapter plugin for CKEditor 5.
|
|
4
|
-
* Converts uploaded images to base64 data URLs instead of uploading to a server.
|
|
5
|
-
*/
|
|
6
2
|
export declare class ImageUploadPlugin extends Plugin {
|
|
7
3
|
static get pluginName(): "ImageUploadPlugin";
|
|
8
4
|
init(): void;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './comment.plugin';
|
|
3
|
-
export * from './variable.plugin';
|
|
4
|
-
export * from './table-fit.plugin';
|
|
5
|
-
export * from './image-upload.plugin';
|
|
1
|
+
export * from './heading/heading.plugin';
|
|
2
|
+
export * from './comment/comment.plugin';
|
|
3
|
+
export * from './variable/variable.plugin';
|
|
4
|
+
export * from './table-fit/table-fit.plugin';
|
|
5
|
+
export * from './image-upload/image-upload.plugin';
|
|
6
|
+
export * from './image-custom/image-custom.plugin';
|
|
7
|
+
export * from './page-orientation/page-orientation.plugin';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Plugin } from 'ckeditor5';
|
|
2
|
+
export declare class TableFitPlugin extends Plugin {
|
|
3
|
+
init(): void;
|
|
4
|
+
/**
|
|
5
|
+
* Apply default table width
|
|
6
|
+
*/
|
|
7
|
+
private _applyTableDefaults;
|
|
8
|
+
/**
|
|
9
|
+
* Apply default borders to all cells in a table
|
|
10
|
+
*/
|
|
11
|
+
private _applyCellBorders;
|
|
12
|
+
/**
|
|
13
|
+
* Setup listener to preserve cell/table styles when model changes
|
|
14
|
+
*/
|
|
15
|
+
private _setupStylePreservationOnModelChange;
|
|
16
|
+
/**
|
|
17
|
+
* Find tables that need border fixes from model changes
|
|
18
|
+
*/
|
|
19
|
+
private _findTablesNeedingFix;
|
|
20
|
+
/**
|
|
21
|
+
* Find parent table element
|
|
22
|
+
*/
|
|
23
|
+
private _findParentTable;
|
|
24
|
+
/**
|
|
25
|
+
* Cleanup listeners when plugin is destroyed
|
|
26
|
+
* Note: this.listenTo() listeners are automatically cleaned up by super.destroy()
|
|
27
|
+
*/
|
|
28
|
+
destroy(): void;
|
|
29
|
+
}
|
package/components/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from '@sd-angular/core/components/avatar';
|
|
1
2
|
export * from '@sd-angular/core/components/button';
|
|
2
3
|
export * from '@sd-angular/core/components/badge';
|
|
3
4
|
export * from '@sd-angular/core/components/tab-router';
|
|
@@ -13,3 +14,4 @@ export * from '@sd-angular/core/components/anchor-v2';
|
|
|
13
14
|
export * from '@sd-angular/core/components/query-builder';
|
|
14
15
|
export * from '@sd-angular/core/components/import-excel';
|
|
15
16
|
export * from '@sd-angular/core/components/document-builder';
|
|
17
|
+
export * from '@sd-angular/core/components/mini-editor';
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ClassicEditor } from 'ckeditor5';
|
|
3
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
4
|
+
import { SdMiniEditorOption, SdMiniEditorConfig } from './mini-editor.model';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Component sd-mini-editor - Editor đơn giản cho comment input
|
|
8
|
+
* Sử dụng CKEditor với chế độ đơn giản (bold, italic, link)
|
|
9
|
+
* Hỗ trợ mention và output format (html/markdown)
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```html
|
|
13
|
+
* <sd-mini-editor
|
|
14
|
+
* [option]="editorOption"
|
|
15
|
+
* [(ngModel)]="content"
|
|
16
|
+
* (contentChange)="onContentChange($event)"
|
|
17
|
+
* >
|
|
18
|
+
* </sd-mini-editor>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class SdMiniEditor implements ControlValueAccessor {
|
|
22
|
+
#private;
|
|
23
|
+
/** Cấu hình option cho editor */
|
|
24
|
+
option: SdMiniEditorOption;
|
|
25
|
+
/** NgModel binding - nội dung HTML/Markdown */
|
|
26
|
+
value: string;
|
|
27
|
+
valueChange: EventEmitter<string>;
|
|
28
|
+
/** Event emitter khi content thay đổi */
|
|
29
|
+
contentChange: EventEmitter<string>;
|
|
30
|
+
/** Event emitter khi blur */
|
|
31
|
+
blur: EventEmitter<FocusEvent>;
|
|
32
|
+
/** Event emitter khi focus */
|
|
33
|
+
focus: EventEmitter<FocusEvent>;
|
|
34
|
+
/** Disabled state */
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
Editor: typeof ClassicEditor;
|
|
37
|
+
get editorConfig(): SdMiniEditorConfig;
|
|
38
|
+
constructor();
|
|
39
|
+
ngOnDestroy(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Xử lý khi editor ready
|
|
42
|
+
*/
|
|
43
|
+
onReady(editor: ClassicEditor): void;
|
|
44
|
+
/**
|
|
45
|
+
* Set nội dung cho editor
|
|
46
|
+
*/
|
|
47
|
+
setContent(content: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get nội dung từ editor
|
|
50
|
+
*/
|
|
51
|
+
getContent(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Get nội dung HTML gốc (không convert)
|
|
54
|
+
*/
|
|
55
|
+
getHtmlContent(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Focus vào editor
|
|
58
|
+
*/
|
|
59
|
+
focusEditor(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Insert mention vào vị trí con trỏ hiện tại
|
|
62
|
+
*/
|
|
63
|
+
insertMention(item: {
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
marker?: string;
|
|
67
|
+
}): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get danh sách mentions trong nội dung
|
|
70
|
+
*/
|
|
71
|
+
getMentions(): Array<{
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
marker: string;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* ControlValueAccessor: Write value
|
|
78
|
+
*/
|
|
79
|
+
writeValue(value: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* ControlValueAccessor: Register change callback
|
|
82
|
+
*/
|
|
83
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
84
|
+
/**
|
|
85
|
+
* ControlValueAccessor: Register touched callback
|
|
86
|
+
*/
|
|
87
|
+
registerOnTouched(fn: () => void): void;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdMiniEditor, never>;
|
|
89
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SdMiniEditor, "sd-mini-editor", never, { "option": { "alias": "option"; "required": true; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; "contentChange": "contentChange"; "blur": "blur"; "focus": "focus"; }, never, never, true, never>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { EditorConfig, MentionFeed, MentionFeedObjectItem } from 'ckeditor5';
|
|
2
|
+
export type { MentionFeedObjectItem };
|
|
3
|
+
export type SdMiniEditorOutputFormat = 'html' | 'markdown';
|
|
4
|
+
export interface SdMiniEditorMentionConfig {
|
|
5
|
+
/** Feed data cho mention - có thể là array hoặc function trả về Promise
|
|
6
|
+
* CKEditor MentionFeed đã hỗ trợ: marker, minChars, dropdownLimit, itemRenderer
|
|
7
|
+
*/
|
|
8
|
+
feeds?: MentionFeed[];
|
|
9
|
+
/** Custom render function cho giá trị mention khi chèn vào editor
|
|
10
|
+
* Trả về object với text và các attributes tùy chỉnh
|
|
11
|
+
*/
|
|
12
|
+
valueRender?: (item: MentionFeedObjectItem) => {
|
|
13
|
+
text: string;
|
|
14
|
+
attributes?: Record<string, string>;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export type SdMiniEditorMentionItem<T = any> = MentionFeedObjectItem & {
|
|
18
|
+
data?: T;
|
|
19
|
+
};
|
|
20
|
+
export interface SdMiniEditorOption {
|
|
21
|
+
/** Output format: 'html' hoặc 'markdown' (mặc định: 'html') */
|
|
22
|
+
outputFormat?: SdMiniEditorOutputFormat;
|
|
23
|
+
/** Placeholder text */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** Chiều cao editor (mặc định: auto) */
|
|
26
|
+
height?: string;
|
|
27
|
+
/** Bật/tắt mention plugin */
|
|
28
|
+
enableMention?: boolean;
|
|
29
|
+
/** Cấu hình mention */
|
|
30
|
+
mentionConfig?: SdMiniEditorMentionConfig;
|
|
31
|
+
/** Callback khi nội dung thay đổi */
|
|
32
|
+
onChange?: (content: string) => void;
|
|
33
|
+
/** Callback khi blur */
|
|
34
|
+
onBlur?: (event: FocusEvent) => void;
|
|
35
|
+
/** Callback khi focus */
|
|
36
|
+
onFocus?: (event: FocusEvent) => void;
|
|
37
|
+
/** Callback khi mention được chọn */
|
|
38
|
+
onMentionSelect?: (item: SdMiniEditorMentionItem) => void;
|
|
39
|
+
}
|
|
40
|
+
export type SdMiniEditorConfig = EditorConfig & {
|
|
41
|
+
getOption?: () => SdMiniEditorOption;
|
|
42
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SdTableColumnFilterDefDirective {
|
|
4
|
+
templateRef: TemplateRef<any>;
|
|
5
|
+
sdTableColumnFilterDef?: string;
|
|
6
|
+
constructor(templateRef: TemplateRef<any>);
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SdTableColumnFilterDefDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SdTableColumnFilterDefDirective, "[sdTableColumnFilterDef]", never, { "sdTableColumnFilterDef": { "alias": "sdTableColumnFilterDef"; "required": false; }; }, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
/**
|
|
3
|
+
* Directive thêm hiệu ứng đổ bóng (elevation-2) vào cột sticky cuối cùng bên trái
|
|
4
|
+
* và cột sticky đầu tiên bên phải, tạo ngăn cách trực quan với phần được scroll.
|
|
5
|
+
*
|
|
6
|
+
* Chỉ dùng nội bộ trong sd-table, không chìa ra ngoài.
|
|
7
|
+
*
|
|
8
|
+
* Gắn vào scroll container của table:
|
|
9
|
+
* @example
|
|
10
|
+
* <div class="c-table" stickyShadow>...</div>
|
|
11
|
+
*/
|
|
12
|
+
export declare class StickyShadowDirective {
|
|
13
|
+
#private;
|
|
14
|
+
constructor();
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StickyShadowDirective, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<StickyShadowDirective, "[stickyShadow]", never, {}, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
2
|
import { SdBadge } from '@sd-angular/core/components/badge';
|
|
3
3
|
import { SdSearch } from '@sd-angular/core/forms';
|
|
4
|
-
import { SdColor, SdOperator } from '@sd-angular/core/utilities';
|
|
4
|
+
import { SdColor, SdNestedKeyOf, SdOperator } from '@sd-angular/core/utilities';
|
|
5
5
|
export type SdTableColumn<T = any> = SdTableColumnText<T> | SdTableColumnNumber<T> | SdTableColumnBool<T> | SdTableColumnDate<T> | SdTableColumnValues<T> | SdTableColumnLazyValues<T> | SdTableColumnChildren<T>;
|
|
6
6
|
export type SdTableColumnTransformFunc<T = any> = (value: any, rowData: T, args?: {
|
|
7
7
|
isExport?: boolean;
|
|
@@ -45,14 +45,14 @@ interface SdTableColumnBase<T = any> {
|
|
|
45
45
|
copiable?: boolean;
|
|
46
46
|
}
|
|
47
47
|
interface SdTableColumnText<T = any> extends SdTableColumnBase<T> {
|
|
48
|
-
field:
|
|
48
|
+
field: SdNestedKeyOf<T>;
|
|
49
49
|
type: 'string';
|
|
50
50
|
badge?: (value: any, rowData: T) => SdColor;
|
|
51
51
|
badgeIcon?: (value: any, rowData: T) => string;
|
|
52
52
|
badgeType?: SdBadge['type'];
|
|
53
53
|
}
|
|
54
54
|
interface SdTableColumnNumber<T = any> extends SdTableColumnBase<T> {
|
|
55
|
-
field:
|
|
55
|
+
field: SdNestedKeyOf<T>;
|
|
56
56
|
type: 'number';
|
|
57
57
|
badge?: (value: any, rowData: T) => SdColor;
|
|
58
58
|
badgeIcon?: (value: any, rowData: T) => string;
|
|
@@ -62,7 +62,7 @@ interface SdTableColumnNumber<T = any> extends SdTableColumnBase<T> {
|
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
64
|
interface SdTableColumnBool<T = any> extends SdTableColumnBase<T> {
|
|
65
|
-
field:
|
|
65
|
+
field: SdNestedKeyOf<T>;
|
|
66
66
|
type: 'boolean';
|
|
67
67
|
option?: {
|
|
68
68
|
displayOnTrue?: string;
|
|
@@ -70,14 +70,14 @@ interface SdTableColumnBool<T = any> extends SdTableColumnBase<T> {
|
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
interface SdTableColumnDate<T = any> extends SdTableColumnBase<T> {
|
|
73
|
-
field:
|
|
73
|
+
field: SdNestedKeyOf<T>;
|
|
74
74
|
type: 'date' | 'datetime' | 'time';
|
|
75
75
|
filter?: SdTableColumnBase['filter'] & {
|
|
76
76
|
type?: 'daterange' | 'date' | 'split-date';
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
export interface SdTableColumnValues<T = any> extends SdTableColumnBase<T> {
|
|
80
|
-
field:
|
|
80
|
+
field: SdNestedKeyOf<T>;
|
|
81
81
|
type: 'values';
|
|
82
82
|
badge?: (value: any, rowData: T) => SdColor;
|
|
83
83
|
badgeIcon?: (value: any, rowData: T) => string;
|
|
@@ -90,7 +90,7 @@ export interface SdTableColumnValues<T = any> extends SdTableColumnBase<T> {
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
export interface SdTableColumnLazyValues<T = any> extends SdTableColumnBase<T> {
|
|
93
|
-
field:
|
|
93
|
+
field: SdNestedKeyOf<T>;
|
|
94
94
|
type: 'lazy-values';
|
|
95
95
|
option: {
|
|
96
96
|
valueField: string;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SdColor } from '@sd-angular/core/utilities/models';
|
|
2
|
+
export interface SdTableCommandOption<T = any> {
|
|
3
|
+
align?: 'left' | 'right';
|
|
4
|
+
commands?: SdTableCommand<T>[];
|
|
5
|
+
}
|
|
2
6
|
export type SdTableCommand<T = any> = SdTableCommandNormal<T> | SdTableCommandChildren<T>;
|
|
3
7
|
export interface SdTableCommandNormal<T = any> {
|
|
4
8
|
color?: SdColor;
|
|
@@ -14,7 +14,8 @@ export interface SdTableDisplay {
|
|
|
14
14
|
badge?: {
|
|
15
15
|
type: SdBadge['type'] | undefined | null;
|
|
16
16
|
color: SdBadge['color'] | undefined | null;
|
|
17
|
-
icon
|
|
17
|
+
icon?: string | undefined | null;
|
|
18
|
+
title?: string | number | null | undefined;
|
|
18
19
|
};
|
|
19
20
|
cellStyle?: Record<string, string>;
|
|
20
21
|
data: string | number | undefined | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SdNestedKeyOf } from '@sd-angular/core/utilities';
|
|
1
2
|
import { SdTableFilterRequest } from '../services/table-filter/table-filter.model';
|
|
2
3
|
export type SdTableOptionExport<T = any> = SdTableOptionExportDefault<T> | SdTableOptionExportCustom;
|
|
3
4
|
export interface SdTableOptionExportDefault<T = any> {
|
|
@@ -22,7 +23,7 @@ export interface SdTableOptionExportCustom {
|
|
|
22
23
|
onExport: (filterRequest: SdTableFilterRequest) => Promise<void>;
|
|
23
24
|
}
|
|
24
25
|
export interface SdTableOptionExportColumn<T = any> {
|
|
25
|
-
field:
|
|
26
|
+
field: SdNestedKeyOf<T>;
|
|
26
27
|
title: string;
|
|
27
28
|
description?: string;
|
|
28
29
|
width?: string;
|
|
@@ -35,7 +36,7 @@ export interface SdTableOptionExportSheet<T = any> {
|
|
|
35
36
|
name: string;
|
|
36
37
|
items: T[] | (() => T[] | Promise<T[]>);
|
|
37
38
|
headers: {
|
|
38
|
-
value:
|
|
39
|
+
value: SdNestedKeyOf<T>;
|
|
39
40
|
display: string;
|
|
40
41
|
}[];
|
|
41
42
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { SdTableCommand } from './table-command.model';
|
|
1
|
+
import { SdPagingReq } from '@sd-angular/core/utilities';
|
|
3
2
|
import { SdTableFilterRequest, SdTableOptionFilter } from '../services/table-filter/table-filter.model';
|
|
3
|
+
import { SdTableColumn } from './table-column.model';
|
|
4
|
+
import { SdTableCommand, SdTableCommandOption } from './table-command.model';
|
|
5
|
+
import { TableOptionConfig } from './table-option-config.model';
|
|
6
|
+
import { SdTableOptionExpand } from './table-option-expand.model';
|
|
4
7
|
import { SdTableOptionExport } from './table-option-export.model';
|
|
8
|
+
import { SdTableOptionGroup } from './table-option-group.model';
|
|
9
|
+
import { SdTableOptionPaginate } from './table-option-paginate.model';
|
|
5
10
|
import { SdTableOptionReload } from './table-option-reload.model';
|
|
6
|
-
import { SdTableOptionExpand } from './table-option-expand.model';
|
|
7
11
|
import { SdTableOptionSelector } from './table-option-selector.model';
|
|
8
|
-
import { SdTableOptionStyle } from './table-option-style.model';
|
|
9
|
-
import { SdTableOptionGroup } from './table-option-group.model';
|
|
10
12
|
import { SdTableOptionSort } from './table-option-sort.model';
|
|
11
|
-
import {
|
|
12
|
-
import { TableOptionConfig } from './table-option-config.model';
|
|
13
|
+
import { SdTableOptionStyle } from './table-option-style.model';
|
|
13
14
|
export type SdTableOption<T = any> = SdTableLocalOption<T> | SdTableServerOption<T>;
|
|
14
15
|
interface SdTableBaseOption<T = any> {
|
|
15
16
|
key?: string;
|
|
@@ -23,6 +24,7 @@ interface SdTableBaseOption<T = any> {
|
|
|
23
24
|
group?: SdTableOptionGroup<T>;
|
|
24
25
|
filter?: SdTableOptionFilter;
|
|
25
26
|
commands?: SdTableCommand<T>[];
|
|
27
|
+
command?: SdTableCommandOption<T>;
|
|
26
28
|
columns: SdTableColumn<T>[];
|
|
27
29
|
style?: SdTableOptionStyle<T>;
|
|
28
30
|
}
|
|
@@ -32,7 +34,7 @@ interface SdTableLocalOption<T = any> extends SdTableBaseOption<T> {
|
|
|
32
34
|
}
|
|
33
35
|
interface SdTableServerOption<T = any> extends SdTableBaseOption<T> {
|
|
34
36
|
type: 'server';
|
|
35
|
-
items: (filterRequest: SdTableFilterRequest<T>) => Promise<{
|
|
37
|
+
items: (filterRequest: SdTableFilterRequest<T>, pagingReq: SdPagingReq<T>) => Promise<{
|
|
36
38
|
items: T[];
|
|
37
39
|
total: number;
|
|
38
40
|
}>;
|