@stemy/ngx-utils 19.7.16 → 19.7.17

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.
@@ -1702,6 +1702,50 @@ class FileSystemEntry {
1702
1702
  }
1703
1703
  }
1704
1704
 
1705
+ class ExclusionsRenderer {
1706
+ constructor() {
1707
+ return Invokable.create(this);
1708
+ }
1709
+ async [Invokable.call](renderCanvas) {
1710
+ const ctx = renderCanvas.ctx;
1711
+ renderCanvas.excludedAreas?.forEach(shape => {
1712
+ ctx.save();
1713
+ ctx.translate(shape.x, shape.y);
1714
+ ctx.fillStyle = "rgba(128,128,128,0.55)";
1715
+ shape.draw(ctx);
1716
+ ctx.fill();
1717
+ ctx.restore();
1718
+ });
1719
+ }
1720
+ }
1721
+
1722
+ const rulerDash = [5, 5];
1723
+ const emptyDash$1 = [];
1724
+ class RulerCanvasRenderer {
1725
+ constructor() {
1726
+ return Invokable.create(this);
1727
+ }
1728
+ async [Invokable.call](renderCanvas) {
1729
+ const ctx = renderCanvas.ctx;
1730
+ ctx.lineWidth = 1;
1731
+ ctx.strokeStyle = "rgba(128, 128, 128, 0.4)";
1732
+ ctx.setLineDash(rulerDash);
1733
+ renderCanvas.cycles?.forEach(cycle => {
1734
+ ctx.beginPath();
1735
+ ctx.moveTo(0, cycle);
1736
+ ctx.lineTo(renderCanvas.canvasWidth, cycle);
1737
+ ctx.stroke();
1738
+ });
1739
+ const hw = renderCanvas.canvasWidth / 2;
1740
+ ctx.lineDashOffset = -renderCanvas.basePan;
1741
+ ctx.beginPath();
1742
+ ctx.moveTo(hw, 0);
1743
+ ctx.lineTo(hw, renderCanvas.canvasHeight);
1744
+ ctx.stroke();
1745
+ ctx.setLineDash(emptyDash$1);
1746
+ }
1747
+ }
1748
+
1705
1749
  function dotProduct(a, b) {
1706
1750
  return a.x * b.x + a.y * b.y;
1707
1751
  }
@@ -6482,7 +6526,6 @@ class DropdownDirective {
6482
6526
  return true;
6483
6527
  }
6484
6528
  hide() {
6485
- console.log("hi");
6486
6529
  if (!this.opened)
6487
6530
  return true;
6488
6531
  this.opened = false;
@@ -7947,11 +7990,13 @@ class InteractiveItemComponent {
7947
7990
  constructor() {
7948
7991
  this.active = false;
7949
7992
  this.index = -1;
7993
+ this.canvasParams = {};
7950
7994
  this.valid = true;
7951
7995
  this.pos = Point.Zero;
7952
7996
  this.direction = "none";
7953
7997
  this.mFrame = new Rect(0, 0, 3, 3);
7954
7998
  this.mShapes = [];
7999
+ this.mDistances = new Map();
7955
8000
  }
7956
8001
  draw(ctx, shape) {
7957
8002
  shape.draw(ctx, 1);
@@ -7996,6 +8041,7 @@ class InteractiveItemComponent {
7996
8041
  this.moveTo(this.pos.x, y);
7997
8042
  }
7998
8043
  moveEnd() {
8044
+ this.mDistances.clear();
7999
8045
  if (this.valid)
8000
8046
  return;
8001
8047
  this.pos = this.validPos;
@@ -8022,7 +8068,10 @@ class InteractiveItemComponent {
8022
8068
  });
8023
8069
  }
8024
8070
  isValidByDistance(other) {
8025
- const minPixels = this.distToPixels(this.getMinDistance(other));
8071
+ if (!this.mDistances.has(other)) {
8072
+ this.mDistances.set(other, this.distToPixels(this.getMinDistance(other)));
8073
+ }
8074
+ const minPixels = this.mDistances.get(other);
8026
8075
  return !this.shapes.some(shape => {
8027
8076
  return other.shapes.some(os => {
8028
8077
  return shape.distance(os) <= minPixels;
@@ -8271,7 +8320,7 @@ class InteractiveCanvasComponent {
8271
8320
  }
8272
8321
  onPanMove($event) {
8273
8322
  const item = this.lockedItem;
8274
- const horizontal = this.horizontal();
8323
+ const horizontal = untracked(() => this.horizontal());
8275
8324
  const deltaX = $event.deltaX / this.ratio;
8276
8325
  const deltaY = $event.deltaY / this.ratio;
8277
8326
  const data = {
@@ -8334,6 +8383,7 @@ class InteractiveCanvasComponent {
8334
8383
  });
8335
8384
  });
8336
8385
  this.items.forEach(item => {
8386
+ item.canvasParams = params;
8337
8387
  item.calcShapes();
8338
8388
  });
8339
8389
  this.onRotate.emit(this.rotation);
@@ -9246,5 +9296,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
9246
9296
  * Generated bundle index. Do not edit.
9247
9297
  */
9248
9298
 
9249
- export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, EPSILON, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, Oval, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, addPts, cachedFactory, cancelablePromise, checkTransitions, clamp, computedPrevious, createTypedProvider, cssStyles, cssVariables, distance, distanceSq, dividePts, dotProduct, ensurePoint, getComponentDef, getCssVariables, getRoot, gjkDistance, gjkIntersection, hashCode, impatientPromise, injectOptions, isBrowser, isPoint, lengthOfPt, lerpPts, multiplyPts, negatePt, normalizePt, normalizeRange, overflow, parseSelector, perpendicular, provideEntryComponents, provideOptions, provideWithOptions, rotateDeg, rotateRad, selectorMatchesList, subPts, svgToDataUri, switchClass, toDegrees, toRadians, tripleProduct };
9299
+ export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AsyncMethodTargetDirective, AuthGuard, BASE_CONFIG, BUTTON_TYPE, BackgroundDirective, BaseDialogService, BaseHttpClient, BaseHttpService, BaseToasterService, BtnComponent, BtnDefaultComponent, CONFIG_SERVICE, CacheService, CanvasColor, CanvasUtils, ChipsComponent, ChunkPipe, Circle, CloseBtnComponent, ComponentLoaderDirective, ComponentLoaderService, ConfigService, DIALOG_SERVICE, DateUtils, DragDropEventPlugin, DropListComponent, DropdownBoxComponent, DropdownContentDirective, DropdownDirective, DropdownToggleDirective, DynamicTableComponent, DynamicTableTemplateDirective, EPSILON, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExclusionsRenderer, ExtraItemPropertiesPipe, FactoryDependencies, FakeModuleComponent, FileSystemEntry, FileUtils, FilterPipe, FindPipe, ForbiddenZone, FormatNumberPipe, FormatterService, GenericValue, GetOffsetPipe, GetTypePipe, GetValuePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, ICON_MAP, ICON_SERVICE, ICON_TYPE, IConfiguration, IconComponent, IconDefaultComponent, IconDirective, IconService, IncludesPipe, Initializer, InteractiveCanvasComponent, InteractiveCircleComponent, InteractiveItemComponent, InteractiveRectComponent, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, Oval, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, RulerCanvasRenderer, SCRIPT_PARAMS, STATIC_SCHEMAS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SocketClient, SocketService, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TabsComponent, TabsItemDirective, TabsTemplateDirective, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UploadComponent, ValuedPromise, ValuesPipe, addPts, cachedFactory, cancelablePromise, checkTransitions, clamp, computedPrevious, createTypedProvider, cssStyles, cssVariables, distance, distanceSq, dividePts, dotProduct, ensurePoint, getComponentDef, getCssVariables, getRoot, gjkDistance, gjkIntersection, hashCode, impatientPromise, injectOptions, isBrowser, isPoint, lengthOfPt, lerpPts, multiplyPts, negatePt, normalizePt, normalizeRange, overflow, parseSelector, perpendicular, provideEntryComponents, provideOptions, provideWithOptions, rotateDeg, rotateRad, selectorMatchesList, subPts, svgToDataUri, switchClass, toDegrees, toRadians, tripleProduct };
9250
9300
  //# sourceMappingURL=stemy-ngx-utils.mjs.map