@talrace/ngx-noder 19.0.44 → 19.0.45

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.
@@ -2066,13 +2066,10 @@ class FormatHelper {
2066
2066
  }
2067
2067
  }
2068
2068
 
2069
- const POPUP_HEIGHT = 150;
2070
-
2071
2069
  class GrammarPopupComponent {
2072
2070
  constructor(editorService, overlayService) {
2073
2071
  this.editorService = editorService;
2074
2072
  this.overlayService = overlayService;
2075
- this.hostHeight = `${POPUP_HEIGHT}px`;
2076
2073
  }
2077
2074
  onSuggestionClick(index) {
2078
2075
  this.editorService.applyGrammarSuggestion(this.error, index, this.paragraphIndex);
@@ -2083,15 +2080,12 @@ class GrammarPopupComponent {
2083
2080
  this.overlayService.close();
2084
2081
  }
2085
2082
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GrammarPopupComponent, deps: [{ token: EditorService }, { token: OverlayService }], target: i0.ɵɵFactoryTarget.Component }); }
2086
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: GrammarPopupComponent, isStandalone: true, selector: "app-nod-grammar-popup", inputs: { error: "error", paragraphIndex: "paragraphIndex" }, host: { properties: { "style.height": "this.hostHeight" } }, ngImport: i0, template: "<span\n class=\"ignore\"\n (click)=\"onIgnoreClick()\">\n {{ 'NODER.LABEL.IGNORE' | translate }}\n</span>\n<span class=\"message\">{{ error.message }}</span>\n<div class=\"options\">\n @for (suggestion of error.replacements; track i; let i = $index) {\n <span\n class=\"suggestion\"\n (click)=\"onSuggestionClick(i)\">\n {{ suggestion }}\n </span>\n }\n</div>\n", styles: [":host{border-radius:8px;display:flex;flex-direction:column;padding:8px;max-width:500px;gap:5px;box-shadow:0 8px 20px #00000026,0 4px 10px #0000001a}.message{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;font-style:italic;font-size:14px;padding:0 10px;border-bottom-width:1px;border-bottom-style:solid}.options{display:flex;justify-content:center;flex-wrap:wrap;gap:5px;padding:5px 0}.suggestion{font-weight:600;cursor:pointer;text-decoration:underline;padding:3px 8px}.ignore{border-radius:4px;margin-left:auto;font-weight:600;cursor:pointer;transition:all .3s ease;padding:3px 8px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2083
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.5", type: GrammarPopupComponent, isStandalone: true, selector: "app-nod-grammar-popup", inputs: { error: "error", paragraphIndex: "paragraphIndex" }, ngImport: i0, template: "<span class=\"message\">{{ error.message }}</span>\n<div class=\"options\">\n @for (suggestion of error.replacements; track i; let i = $index) {\n <span\n class=\"suggestion\"\n (click)=\"onSuggestionClick(i)\">\n {{ suggestion }}\n </span>\n }\n</div>\n<button\n mat-button\n class=\"ignore\"\n (click)=\"onIgnoreClick()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-ignore\"></mat-icon>\n <span>\n {{ 'NODER.LABEL.IGNORE' | translate }}\n </span>\n</button>\n", styles: [":host{border-radius:8px;display:flex;flex-direction:column;padding:8px;max-width:500px;gap:5px}.message{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px}.options{display:flex;flex-flow:column wrap;justify-content:center;gap:5px;padding:10px 0;border-bottom-width:1px;border-bottom-style:solid}.suggestion{font-weight:600;font-size:14px;cursor:pointer;text-decoration:underline;padding:3px 8px}.ignore{margin-left:auto;font-size:12px;letter-spacing:0;cursor:pointer;height:32px}.ignore mat-icon{margin-right:4px}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2087
2084
  }
2088
2085
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: GrammarPopupComponent, decorators: [{
2089
2086
  type: Component,
2090
- args: [{ selector: 'app-nod-grammar-popup', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, TranslateModule], standalone: true, template: "<span\n class=\"ignore\"\n (click)=\"onIgnoreClick()\">\n {{ 'NODER.LABEL.IGNORE' | translate }}\n</span>\n<span class=\"message\">{{ error.message }}</span>\n<div class=\"options\">\n @for (suggestion of error.replacements; track i; let i = $index) {\n <span\n class=\"suggestion\"\n (click)=\"onSuggestionClick(i)\">\n {{ suggestion }}\n </span>\n }\n</div>\n", styles: [":host{border-radius:8px;display:flex;flex-direction:column;padding:8px;max-width:500px;gap:5px;box-shadow:0 8px 20px #00000026,0 4px 10px #0000001a}.message{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;font-style:italic;font-size:14px;padding:0 10px;border-bottom-width:1px;border-bottom-style:solid}.options{display:flex;justify-content:center;flex-wrap:wrap;gap:5px;padding:5px 0}.suggestion{font-weight:600;cursor:pointer;text-decoration:underline;padding:3px 8px}.ignore{border-radius:4px;margin-left:auto;font-weight:600;cursor:pointer;transition:all .3s ease;padding:3px 8px}\n"] }]
2091
- }], ctorParameters: () => [{ type: EditorService }, { type: OverlayService }], propDecorators: { hostHeight: [{
2092
- type: HostBinding,
2093
- args: ['style.height']
2094
- }], error: [{
2087
+ args: [{ selector: 'app-nod-grammar-popup', changeDetection: ChangeDetectionStrategy.OnPush, imports: [MatButtonModule, MatIconModule, TranslateModule], standalone: true, template: "<span class=\"message\">{{ error.message }}</span>\n<div class=\"options\">\n @for (suggestion of error.replacements; track i; let i = $index) {\n <span\n class=\"suggestion\"\n (click)=\"onSuggestionClick(i)\">\n {{ suggestion }}\n </span>\n }\n</div>\n<button\n mat-button\n class=\"ignore\"\n (click)=\"onIgnoreClick()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-ignore\"></mat-icon>\n <span>\n {{ 'NODER.LABEL.IGNORE' | translate }}\n </span>\n</button>\n", styles: [":host{border-radius:8px;display:flex;flex-direction:column;padding:8px;max-width:500px;gap:5px}.message{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px}.options{display:flex;flex-flow:column wrap;justify-content:center;gap:5px;padding:10px 0;border-bottom-width:1px;border-bottom-style:solid}.suggestion{font-weight:600;font-size:14px;cursor:pointer;text-decoration:underline;padding:3px 8px}.ignore{margin-left:auto;font-size:12px;letter-spacing:0;cursor:pointer;height:32px}.ignore mat-icon{margin-right:4px}\n"] }]
2088
+ }], ctorParameters: () => [{ type: EditorService }, { type: OverlayService }], propDecorators: { error: [{
2095
2089
  type: Input
2096
2090
  }], paragraphIndex: [{
2097
2091
  type: Input
@@ -5210,7 +5204,7 @@ class TableOperationsHelper {
5210
5204
  return null;
5211
5205
  }
5212
5206
  return new ApplyTableCellsStylesModel({
5213
- cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, ...new BordersStyleModel({ lineStyle: style }) })),
5207
+ cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, lineStyle: style })),
5214
5208
  insertIndex: table.insertIndex
5215
5209
  });
5216
5210
  }
@@ -5225,7 +5219,7 @@ class TableOperationsHelper {
5225
5219
  return null;
5226
5220
  }
5227
5221
  return new ApplyTableCellsStylesModel({
5228
- cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, ...new BordersStyleModel({ width }) })),
5222
+ cellsData: this.getCellDataFromBorderCells(cellsMap, (oldBorder) => new BordersStyleModel({ ...oldBorder, width })),
5229
5223
  insertIndex: table.insertIndex
5230
5224
  });
5231
5225
  }
@@ -9854,8 +9848,8 @@ class Editor {
9854
9848
  const cursor = PositionHelper.paragraphToPixel(this.session, paragraphPos.row, paragraphPos.column);
9855
9849
  const rect = this.renderer.container.getBoundingClientRect();
9856
9850
  const hintLeft = rect.left + cursor.pageX;
9857
- const hintTop = rect.top + cursor.pageY - POPUP_HEIGHT;
9858
- this.overlayService.open(GrammarPopupComponent, { error, paragraphIndex: position.row }, hintLeft - 100, hintTop);
9851
+ const hintTop = rect.top + cursor.pageY + cursor.height + 5;
9852
+ this.overlayService.open(GrammarPopupComponent, { error, paragraphIndex: position.row }, hintLeft, hintTop);
9859
9853
  event.stopPropagation();
9860
9854
  }
9861
9855
  event.preventDefault();
@@ -11026,11 +11020,12 @@ class CellResizer {
11026
11020
  this.columnPositionChanged(positionX);
11027
11021
  };
11028
11022
  }
11029
- onStartResizing(cellResizerParameters) {
11023
+ onStartResizing(cellResizerParameters, maxExpansionSpace = 0) {
11030
11024
  if (this.editorService.isViewOnly) {
11031
11025
  return;
11032
11026
  }
11033
11027
  this.cellResizerParameters = cellResizerParameters;
11028
+ this.maxExpansionSpace = maxExpansionSpace;
11034
11029
  switch (this.cellResizerParameters.cellSide) {
11035
11030
  case ResizerSide.Left:
11036
11031
  this.startResizingFromLeft();
@@ -11061,9 +11056,13 @@ class CellResizer {
11061
11056
  this.spaceLeft = this.table.columns[columnIndex].width - this.minCellWidth;
11062
11057
  this.spaceRight = 0;
11063
11058
  const nextColumnIndex = columnIndex + 1;
11059
+ const isLast = columnIndex === this.table.columns.length - 1;
11064
11060
  if (this.table.columns.length > nextColumnIndex) {
11065
11061
  this.spaceRight = this.table.columns[nextColumnIndex].width - this.minCellWidth;
11066
11062
  }
11063
+ else if (isLast) {
11064
+ this.spaceRight = this.maxExpansionSpace;
11065
+ }
11067
11066
  const cellRect = this.tableEl.rows[this.splitRowIndex].cells[this.cellResizerParameters.columnIndex].getBoundingClientRect();
11068
11067
  this.startX = this.tableEl.offsetLeft + cellRect.left + cellRect.width - this.resizerBorderSize;
11069
11068
  this.columnPositionChanged(this.startX);
@@ -11274,6 +11273,9 @@ class TableCellHelper {
11274
11273
  if (border.color && border.color !== 'auto') {
11275
11274
  style += ` ${border.color}`;
11276
11275
  }
11276
+ else {
11277
+ style += ` #000`;
11278
+ }
11277
11279
  return style;
11278
11280
  }
11279
11281
  static getBorderLineStyle(lineStyle) {
@@ -11837,11 +11839,12 @@ class NoderTableComponent extends BaseNoderComponent {
11837
11839
  this.borderSize = 1;
11838
11840
  this.startResizing = (cellResizerParameters) => {
11839
11841
  const splitRowIndex = this.getSplitRowIndex(cellResizerParameters.rowIndex);
11842
+ const availableTableSpace = this.getAvailableTableSpace();
11840
11843
  this.resizer.resizerHeight = this.getRowsHeightBetweenSplits(splitRowIndex);
11841
11844
  this.resizer.startY = this.getRowsHeightBefore(splitRowIndex);
11842
11845
  this.resizer.splitRowIndex = splitRowIndex;
11843
11846
  this.resizer.tableInsertIndex = this.insertIndex;
11844
- this.resizer.onStartResizing(cellResizerParameters);
11847
+ this.resizer.onStartResizing(cellResizerParameters, availableTableSpace);
11845
11848
  };
11846
11849
  this.cellHeightChanged = (rowIndex, cellIndex, height) => {
11847
11850
  const tableRow = this.table.rows[rowIndex];
@@ -12199,6 +12202,13 @@ class NoderTableComponent extends BaseNoderComponent {
12199
12202
  }
12200
12203
  return sum;
12201
12204
  }
12205
+ getAvailableTableSpace() {
12206
+ const parent = this.el.nativeElement.parentElement;
12207
+ if (!parent || !parent.classList.contains('noder-line')) {
12208
+ return 0;
12209
+ }
12210
+ return Math.max(0, parent.clientWidth - this.tableEl.clientWidth);
12211
+ }
12202
12212
  updateCells() {
12203
12213
  const rows = this.rowMatrix.length;
12204
12214
  const cols = rows > 0 ? this.rowMatrix[0].cells.length : 0;