@libs-ui/services-diagram-draw 0.2.356-37 → 0.2.356-41

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/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './diagram-draw.service';
3
3
  export * from './direction.service';
4
4
  export * from './interfaces/canvas.interface';
5
5
  export * from './interfaces/diagram.interface';
6
+ export * from './interfaces/navigation.interface';
@@ -88,7 +88,7 @@ export interface IDropZoneIndicatorStyle {
88
88
  /** Hàm render **động** nội dung indicator ở trạng thái hover/drag-enter.*/
89
89
  renderHoverIndicator?: () => string;
90
90
  }
91
- export interface IConfig {
91
+ export interface ICustomCanvasConfig {
92
92
  storeDataDefine: IDiagramStoreData;
93
93
  svgContainer?: ElementRef<HTMLDivElement>;
94
94
  nodesContainer?: ElementRef<HTMLDivElement>;
@@ -0,0 +1,16 @@
1
+ import { IArrowStyle, IDrawLineDataInput, ILineStyle, TYPE_MODE } from '@libs-ui/components-draw-line';
2
+ export interface INavigationLineStyleConfig {
3
+ lineStyle?: ILineStyle;
4
+ arrowStyle?: IArrowStyle;
5
+ /** Khoảng cách (px) giữa cạnh source/target và endpoint. Mặc định 8. */
6
+ endpointGap?: number;
7
+ /** Override resolver chọn mode. Mặc định: rule từ workflows — `start.x < end.x && start.y > end.y ? 'quart-in' : 's-line'`. */
8
+ modeResolver?: (start: {
9
+ x: number;
10
+ y: number;
11
+ }, end: {
12
+ x: number;
13
+ y: number;
14
+ }) => TYPE_MODE;
15
+ }
16
+ export type T_navigation_line_data = IDrawLineDataInput;
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@libs-ui/services-diagram-draw",
3
- "version": "0.2.356-37",
3
+ "version": "0.2.356-41",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^18.2.0",
6
- "@libs-ui/utils": "0.2.356-37",
6
+ "@libs-ui/components-draw-line": "0.2.356-41",
7
+ "@libs-ui/utils": "0.2.356-41",
7
8
  "@ngx-translate/core": "^15.0.0",
8
9
  "rxjs": "~7.8.0"
9
10
  },
@@ -0,0 +1,25 @@
1
+ import { IDrawLineDataInput, TYPE_MODE } from '@libs-ui/components-draw-line';
2
+ import { IDiagramElement } from '../../interfaces/diagram.interface';
3
+ import { INavigationLineStyleConfig } from '../../interfaces/navigation.interface';
4
+ export declare class LibsUiDiagramDrawNavigationUtil {
5
+ /** Rule chọn mode mặc định (copy từ workflows/canvas.component.ts:471). */
6
+ static defaultModeResolver(start: {
7
+ x: number;
8
+ y: number;
9
+ }, end: {
10
+ x: number;
11
+ y: number;
12
+ }): TYPE_MODE;
13
+ /**
14
+ * Build dữ liệu navigation line (next_other_id) từ flat elements để render qua draw-line directive.
15
+ * @param flatElements Danh sách phẳng tất cả elements (sau khi configXYElements đã chạy).
16
+ * @param orientation Chiều layout của diagram.
17
+ * @param styleConfig Tuỳ chỉnh style line/arrow + override resolver mode/gap.
18
+ */
19
+ static buildNavigationData(flatElements: IDiagramElement[], orientation: 'vertical' | 'horizontal', styleConfig?: INavigationLineStyleConfig): IDrawLineDataInput[];
20
+ private static buildOneLine;
21
+ /** VERTICAL: line navigation đi NGANG — kẹp cạnh phải/trái source → cạnh trái/phải target. */
22
+ private static calcPointsVertical;
23
+ /** HORIZONTAL: line navigation đi DỌC — kẹp cạnh dưới/trên source → cạnh trên/dưới target. */
24
+ private static calcPointsHorizontal;
25
+ }
@@ -0,0 +1,4 @@
1
+ import { IArrowStyle, ILineStyle } from '@libs-ui/components-draw-line';
2
+ export declare const DEFAULT_NAVIGATION_LINE_STYLE: ILineStyle;
3
+ export declare const DEFAULT_NAVIGATION_ARROW_STYLE: IArrowStyle;
4
+ export declare const DEFAULT_NAVIGATION_ENDPOINT_GAP = 8;