@libs-ui/components-minimap 0.2.357-1 → 0.2.357-10

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 (2) hide show
  1. package/README.md +4 -16
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -148,7 +148,7 @@ Khi vùng cuộn thực tế là một phần tử khác với host element củ
148
148
 
149
149
  ```typescript
150
150
  // canvas-layout.component.ts
151
- import { Component, ChangeDetectionStrategy, ViewChild, ElementRef } from '@angular/core';
151
+ import { Component, ChangeDetectionStrategy, ElementRef, viewChild, computed } from '@angular/core';
152
152
  import { LibsUiComponentsMinimapDirective, IMiniMapFunctionControl } from '@libs-ui/components-minimap';
153
153
 
154
154
  @Component({
@@ -158,7 +158,7 @@ import { LibsUiComponentsMinimapDirective, IMiniMapFunctionControl } from '@libs
158
158
  template: `
159
159
  <div
160
160
  LibsUiComponentsMinimapDirective
161
- [elementScroll]="scrollContainer"
161
+ [elementScroll]="scrollContainer()"
162
162
  [styleImageElement]="{ top: 10, right: 10, width: 180, height: 100 }"
163
163
  (outFunctionControls)="handlerControlsInit($event)">
164
164
 
@@ -171,12 +171,10 @@ import { LibsUiComponentsMinimapDirective, IMiniMapFunctionControl } from '@libs
171
171
  `,
172
172
  })
173
173
  export class CanvasLayoutComponent {
174
- @ViewChild('scrollContainer') scrollContainerRef!: ElementRef<HTMLElement>;
174
+ private readonly scrollContainerRef = viewChild<ElementRef<HTMLElement>>('scrollContainer');
175
175
  private minimapControls?: IMiniMapFunctionControl;
176
176
 
177
- get scrollContainer(): HTMLElement {
178
- return this.scrollContainerRef?.nativeElement;
179
- }
177
+ protected scrollContainer = computed(() => this.scrollContainerRef()?.nativeElement);
180
178
 
181
179
  handlerControlsInit(controls: IMiniMapFunctionControl) {
182
180
  this.minimapControls = controls;
@@ -320,13 +318,3 @@ export interface IMiniMapFunctionControl {
320
318
  ⚠️ **Scale transform**: Khi nội dung bên trong có phần tử áp dụng CSS `transform: scale()`, truyền đúng tên class vào `classNameFlagElementScale`. Nếu không, viewport trên minimap sẽ không khớp với vùng thực sự đang hiển thị.
321
319
 
322
320
  ⚠️ **Minimap ẩn theo mặc định**: Sau khi init, minimap được tạo ra nhưng ở trạng thái `invisible`. Cần gọi `controls.show()` trong handler `(outFunctionControls)` để hiện ngay, hoặc gọi sau theo logic nghiệp vụ.
323
-
324
- ## Demo
325
-
326
- ```bash
327
- npx nx serve core-ui
328
- ```
329
-
330
- Truy cập: http://localhost:4500/components/minimap
331
-
332
- hoặc: http://localhost:4500/directives/minimap
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@libs-ui/components-minimap",
3
- "version": "0.2.357-1",
3
+ "version": "0.2.357-10",
4
4
  "peerDependencies": {
5
5
  "@angular/core": ">=18.0.0",
6
- "@libs-ui/interfaces-types": "0.2.357-1",
7
- "@libs-ui/utils": "0.2.357-1",
6
+ "@libs-ui/interfaces-types": "0.2.357-10",
7
+ "@libs-ui/utils": "0.2.357-10",
8
8
  "rxjs": "~7.8.0"
9
9
  },
10
10
  "sideEffects": false,