@sd-angular/core 19.0.0-beta.2 → 19.0.0-beta.20

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.
Files changed (117) hide show
  1. package/assets/scss/ckeditor5.scss +59 -2
  2. package/components/avatar/index.d.ts +1 -0
  3. package/components/avatar/src/avatar.component.d.ts +14 -0
  4. package/components/document-builder/src/document-builder.component.d.ts +29 -7
  5. package/components/document-builder/src/document-builder.config.d.ts +21 -0
  6. package/components/document-builder/src/document-builder.model.d.ts +6 -1
  7. package/components/document-builder/src/document-builder.utils.d.ts +10 -0
  8. package/components/document-builder/src/plugins/{table-fit.plugin.d.ts → heading/heading.plugin.d.ts} +1 -1
  9. package/components/document-builder/src/plugins/highlight-range/highlight-range.plugin.d.ts +4 -0
  10. package/components/document-builder/src/plugins/image-custom/image-custom.plugin.d.ts +31 -0
  11. package/components/document-builder/src/plugins/{image-upload.plugin.d.ts → image-upload/image-upload.plugin.d.ts} +0 -4
  12. package/components/document-builder/src/plugins/index.d.ts +7 -5
  13. package/components/document-builder/src/plugins/table-fit/table-fit.plugin.d.ts +29 -0
  14. package/components/index.d.ts +2 -0
  15. package/components/mini-editor/index.d.ts +2 -0
  16. package/components/mini-editor/src/mini-editor.component.d.ts +90 -0
  17. package/components/mini-editor/src/mini-editor.model.d.ts +42 -0
  18. package/components/table/src/directives/index.d.ts +2 -0
  19. package/components/table/src/directives/sd-table-column-filter-def.directive.d.ts +9 -0
  20. package/components/table/src/directives/sticky-shadow.directive.d.ts +17 -0
  21. package/components/table/src/models/table-column.model.d.ts +7 -7
  22. package/components/table/src/models/table-command.model.d.ts +4 -0
  23. package/components/table/src/models/table-item.model.d.ts +2 -1
  24. package/components/table/src/models/table-option-export.model.d.ts +3 -2
  25. package/components/table/src/models/table-option.model.d.ts +10 -8
  26. package/components/table/src/services/table-filter/table-filter.model.d.ts +2 -2
  27. package/components/view/index.d.ts +1 -0
  28. package/components/view/src/view.component.d.ts +14 -0
  29. package/components/workflow/src/models/index.d.ts +1 -0
  30. package/directives/index.d.ts +1 -0
  31. package/directives/src/sd-href.directive.d.ts +9 -0
  32. package/fesm2022/sd-angular-core-components-avatar.mjs +88 -0
  33. package/fesm2022/sd-angular-core-components-avatar.mjs.map +1 -0
  34. package/fesm2022/sd-angular-core-components-badge.mjs +2 -2
  35. package/fesm2022/sd-angular-core-components-badge.mjs.map +1 -1
  36. package/fesm2022/sd-angular-core-components-document-builder.mjs +1329 -557
  37. package/fesm2022/sd-angular-core-components-document-builder.mjs.map +1 -1
  38. package/fesm2022/sd-angular-core-components-mini-editor.mjs +326 -0
  39. package/fesm2022/sd-angular-core-components-mini-editor.mjs.map +1 -0
  40. package/fesm2022/sd-angular-core-components-table.mjs +510 -84
  41. package/fesm2022/sd-angular-core-components-table.mjs.map +1 -1
  42. package/fesm2022/sd-angular-core-components-view.mjs +88 -0
  43. package/fesm2022/sd-angular-core-components-view.mjs.map +1 -0
  44. package/fesm2022/sd-angular-core-components-workflow.mjs +33 -43
  45. package/fesm2022/sd-angular-core-components-workflow.mjs.map +1 -1
  46. package/fesm2022/sd-angular-core-components.mjs +2 -0
  47. package/fesm2022/sd-angular-core-components.mjs.map +1 -1
  48. package/fesm2022/sd-angular-core-directives.mjs +51 -2
  49. package/fesm2022/sd-angular-core-directives.mjs.map +1 -1
  50. package/fesm2022/sd-angular-core-forms-autocomplete.mjs +24 -2
  51. package/fesm2022/sd-angular-core-forms-autocomplete.mjs.map +1 -1
  52. package/fesm2022/sd-angular-core-forms-date.mjs +15 -3
  53. package/fesm2022/sd-angular-core-forms-date.mjs.map +1 -1
  54. package/fesm2022/sd-angular-core-forms-datetime.mjs +17 -3
  55. package/fesm2022/sd-angular-core-forms-datetime.mjs.map +1 -1
  56. package/fesm2022/sd-angular-core-forms-input-number.mjs +25 -3
  57. package/fesm2022/sd-angular-core-forms-input-number.mjs.map +1 -1
  58. package/fesm2022/sd-angular-core-forms-input.mjs +20 -6
  59. package/fesm2022/sd-angular-core-forms-input.mjs.map +1 -1
  60. package/fesm2022/sd-angular-core-forms-radio.mjs +18 -2
  61. package/fesm2022/sd-angular-core-forms-radio.mjs.map +1 -1
  62. package/fesm2022/sd-angular-core-forms-select.mjs +19 -3
  63. package/fesm2022/sd-angular-core-forms-select.mjs.map +1 -1
  64. package/fesm2022/sd-angular-core-forms-textarea.mjs +21 -2
  65. package/fesm2022/sd-angular-core-forms-textarea.mjs.map +1 -1
  66. package/fesm2022/sd-angular-core-modules-auth.mjs +137 -0
  67. package/fesm2022/sd-angular-core-modules-auth.mjs.map +1 -0
  68. package/fesm2022/sd-angular-core-modules-layout.mjs +52 -17
  69. package/fesm2022/sd-angular-core-modules-layout.mjs.map +1 -1
  70. package/fesm2022/sd-angular-core-modules-oidc.mjs +0 -2
  71. package/fesm2022/sd-angular-core-modules-oidc.mjs.map +1 -1
  72. package/fesm2022/sd-angular-core-modules.mjs +1 -0
  73. package/fesm2022/sd-angular-core-modules.mjs.map +1 -1
  74. package/fesm2022/sd-angular-core-pipes.mjs +21 -1
  75. package/fesm2022/sd-angular-core-pipes.mjs.map +1 -1
  76. package/fesm2022/sd-angular-core-services-confirm.mjs +6 -9
  77. package/fesm2022/sd-angular-core-services-confirm.mjs.map +1 -1
  78. package/fesm2022/sd-angular-core-utilities-extensions.mjs +66 -1
  79. package/fesm2022/sd-angular-core-utilities-extensions.mjs.map +1 -1
  80. package/fesm2022/sd-angular-core-utilities-models.mjs +12 -3
  81. package/fesm2022/sd-angular-core-utilities-models.mjs.map +1 -1
  82. package/forms/autocomplete/src/autocomplete.component.d.ts +5 -1
  83. package/forms/date/src/date.component.d.ts +4 -1
  84. package/forms/datetime/src/datetime.component.d.ts +4 -1
  85. package/forms/input/src/input.component.d.ts +6 -4
  86. package/forms/input-number/src/input-number.component.d.ts +4 -1
  87. package/forms/radio/src/radio.component.d.ts +5 -1
  88. package/forms/select/src/select.component.d.ts +5 -1
  89. package/forms/textarea/src/textarea.component.d.ts +3 -1
  90. package/modules/auth/configurations/auth.configuration.d.ts +19 -0
  91. package/modules/auth/configurations/index.d.ts +1 -0
  92. package/modules/auth/guards/auth.guard.d.ts +11 -0
  93. package/modules/auth/guards/index.d.ts +2 -0
  94. package/modules/auth/guards/portal.guard.d.ts +11 -0
  95. package/modules/auth/index.d.ts +3 -0
  96. package/modules/auth/services/auth.model.d.ts +8 -0
  97. package/modules/auth/services/auth.service.d.ts +17 -0
  98. package/modules/auth/services/index.d.ts +2 -0
  99. package/modules/index.d.ts +1 -0
  100. package/modules/layout/components/sidebar-v1/components/sidebar/sidebar.component.d.ts +1 -0
  101. package/modules/layout/components/sidebar-v1/components/user/user.component.d.ts +5 -2
  102. package/modules/layout/configurations/layout.configuration.d.ts +3 -0
  103. package/modules/layout/services/storage/storage.service.d.ts +1 -0
  104. package/package.json +70 -54
  105. package/pipes/index.d.ts +1 -0
  106. package/pipes/src/empty.pipe.d.ts +7 -0
  107. package/sd-angular-core-19.0.0-beta.20.tgz +0 -0
  108. package/services/confirm/src/lib/confirm.service.d.ts +1 -0
  109. package/utilities/extensions/index.d.ts +1 -0
  110. package/utilities/extensions/src/color.extension.d.ts +20 -0
  111. package/utilities/models/index.d.ts +1 -0
  112. package/utilities/models/src/maybe-async.model.d.ts +1 -0
  113. package/utilities/models/src/nested-key-of.model.d.ts +5 -0
  114. package/utilities/models/src/pattern.model.d.ts +2 -2
  115. /package/components/document-builder/src/plugins/{comment.plugin.d.ts → comment/comment.plugin.d.ts} +0 -0
  116. /package/components/document-builder/src/plugins/{page-orientation.plugin.d.ts → page-orientation/page-orientation.plugin.d.ts} +0 -0
  117. /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
- @import '@ckeditor/ckeditor5-table/dist/index.css';
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
- getHeadings: () => SdDocumentBuilderHeading[];
26
- scrollToHeading: (id: string) => void;
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, data?: T) => SdDocumentBuilderComment<T> | null;
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?: (range: ModelRange) => void;
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;
@@ -1,4 +1,4 @@
1
1
  import { Plugin } from 'ckeditor5';
2
- export declare class TableFitPlugin extends Plugin {
2
+ export declare class HeadingPlugin extends Plugin {
3
3
  init(): void;
4
4
  }
@@ -0,0 +1,4 @@
1
+ import { Plugin } from 'ckeditor5';
2
+ export declare class HighlightRangePlugin extends Plugin {
3
+ init(): void;
4
+ }
@@ -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 './page-orientation.plugin';
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
+ }
@@ -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,2 @@
1
+ export * from './src/mini-editor.model';
2
+ export * from './src/mini-editor.component';
@@ -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,2 @@
1
+ export * from './sd-table-column-filter-def.directive';
2
+ export * from './sticky-shadow.directive';
@@ -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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
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: string | undefined | null;
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: Extract<keyof T, string>;
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: Extract<keyof T, string>;
39
+ value: SdNestedKeyOf<T>;
39
40
  display: string;
40
41
  }[];
41
42
  }
@@ -1,15 +1,16 @@
1
- import { SdTableColumn } from './table-column.model';
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 { SdTableOptionPaginate } from './table-option-paginate.model';
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
  }>;