@ai-table/grid 0.4.9 → 0.5.0

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.
@@ -6284,7 +6284,7 @@ class MemberLayout extends CellBaseLayout {
6284
6284
  const count = this.items.length - renderItems.length;
6285
6285
  const renderAtoms = [];
6286
6286
  let itemWidth = 2 * AI_TABLE_TAG_PADDING;
6287
- const textAtom = this.getTextAtom(`+${count}`, undefined, FONT_SIZE_SM);
6287
+ const textAtom = this.getTextAtom(`+${count}`, undefined, DEFAULT_FONT_SIZE);
6288
6288
  itemWidth += textAtom.width;
6289
6289
  renderAtoms.push({
6290
6290
  type: AITableRenderAtomType.circle,
@@ -6297,7 +6297,7 @@ class MemberLayout extends CellBaseLayout {
6297
6297
  renderAtoms.push({
6298
6298
  ...textAtom,
6299
6299
  x: lastItem.x + (AITableAvatarSize.size24 - textAtom.width) / 2,
6300
- y: lastItem.y + (AITableAvatarSize.size24 - FONT_SIZE_SM) / 2,
6300
+ y: lastItem.y + (AITableAvatarSize.size24 - DEFAULT_FONT_SIZE) / 2,
6301
6301
  fillStyle: Colors.white
6302
6302
  });
6303
6303
  return [
@@ -6335,12 +6335,12 @@ class MemberLayout extends CellBaseLayout {
6335
6335
  });
6336
6336
  const textX = AITableAvatarSize.size24 + AI_TABLE_MEMBER_ITEM_AVATAR_MARGIN_RIGHT;
6337
6337
  const textWidth = containerMaxWidth - textX;
6338
- const textAtom = this.getTextAtom(display_name || '', textWidth, FONT_SIZE_SM);
6338
+ const textAtom = this.getTextAtom(display_name || '', textWidth, DEFAULT_FONT_SIZE);
6339
6339
  renderAtoms.push({
6340
6340
  ...textAtom,
6341
6341
  type: AITableRenderAtomType.text,
6342
6342
  x: textX,
6343
- y: (AITableAvatarSize.size24 - FONT_SIZE_SM) / 2,
6343
+ y: (AITableAvatarSize.size24 - DEFAULT_FONT_SIZE) / 2,
6344
6344
  width: textWidth
6345
6345
  });
6346
6346
  }
@@ -9573,17 +9573,19 @@ class AITableFieldStat {
9573
9573
  statMenus: fieldModel.getStatTypes(aiTable)
9574
9574
  }
9575
9575
  });
9576
- ref.componentInstance.menuClick.subscribe((event) => {
9577
- this.isActive.set(false);
9578
- actions.setFieldStatType({
9579
- path: [field._id],
9580
- statType: event.menu.type
9576
+ if (ref) {
9577
+ ref.componentInstance.menuClick.subscribe((event) => {
9578
+ this.isActive.set(false);
9579
+ actions.setFieldStatType({
9580
+ path: [field._id],
9581
+ statType: event.menu.type
9582
+ });
9581
9583
  });
9582
- });
9583
- ref.afterClosed().subscribe(() => {
9584
- this.isActive.set(false);
9585
- this.hover.emit(false);
9586
- });
9584
+ ref.afterClosed().subscribe(() => {
9585
+ this.isActive.set(false);
9586
+ this.hover.emit(false);
9587
+ });
9588
+ }
9587
9589
  }
9588
9590
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: AITableFieldStat, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
9589
9591
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: AITableFieldStat, isStandalone: true, selector: "ai-table-field-stat", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { hover: "hover" }, ngImport: i0, template: `
@@ -11985,7 +11987,7 @@ class SelectCellEditorComponent extends AbstractEditCellEditor {
11985
11987
  });
11986
11988
  }
11987
11989
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SelectCellEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
11988
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"autoFocus()\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange", "visibleChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: ThyEmptyModule }, { kind: "ngmodule", type: ThyFormModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ThySelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11990
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: SelectCellEditorComponent, isStandalone: true, selector: "select-cell-editor", host: { classAttribute: "d-block h-100 select-cell-editor" }, usesInheritance: true, ngImport: i0, template: "<thy-select\n [(ngModel)]=\"modelValue\"\n [thyAutoExpand]=\"autoFocus()\"\n [thyAllowClear]=\"true\"\n [thyPlaceHolder]=\"''\"\n [thyPreset]=\"preset()\"\n [thyMode]=\"field().settings.is_multiple ? 'multiple' : ''\"\n (ngModelChange)=\"onModelChange($event)\"\n (thyOnExpandStatusChange)=\"onOpenChange($event)\"\n>\n <ng-template #selectedDisplay let-option>\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </ng-template>\n @for (option of selectOptions(); track option._id) {\n <thy-option\n [thyValue]=\"option._id\"\n [hidden]=\"!!option.is_disabled\"\n [thyRawValue]=\"option\"\n [thyShowOptionCustom]=\"true\"\n [thyLabelText]=\"option.text\"\n >\n <select-option [field]=\"field()\" [displayOption]=\"option\"></select-option>\n </thy-option>\n }\n</thy-select>\n", dependencies: [{ kind: "component", type: ThySelect, selector: "thy-select,thy-custom-select", inputs: ["thyDropdownWidthMode", "thyItemSize", "thyShowSearch", "thyPlaceHolder", "thyServerSearch", "thyLoadState", "thyAutoActiveFirstItem", "thyMode", "thySize", "thyEmptyStateText", "thyEmptySearchMessageText", "thyEnableScrollLoad", "thyAllowClear", "thyDisabled", "thySortComparator", "thyFooterTemplate", "thyPlacement", "thyOrigin", "thyFooterClass", "thyAutoExpand", "thyHasBackdrop", "thyMaxTagCount", "thyBorderless", "thyVirtualScroll", "thyOptions", "thyPreset"], outputs: ["thyOnSearch", "thyOnScrollToBottom", "thyOnExpandStatusChange"], exportAs: ["thySelect"] }, { kind: "component", type: ThyOption, selector: "thy-option", inputs: ["thyValue", "thyRawValue", "thyLabelText", "thyShowOptionCustom", "thySearchKey", "thyDisabled"], outputs: ["selectionChange"] }, { kind: "ngmodule", type: ThyTooltipModule }, { kind: "component", type: SelectOptionComponent, selector: "select-option", inputs: ["field", "displayOption"] }, { kind: "ngmodule", type: ThyEmptyModule }, { kind: "ngmodule", type: ThyFormModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ThySelectModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11989
11991
  }
11990
11992
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: SelectCellEditorComponent, decorators: [{
11991
11993
  type: Component,
@@ -12690,7 +12692,7 @@ class RecordDetailComponent {
12690
12692
  });
12691
12693
  }
12692
12694
  }
12693
- });
12695
+ }) ?? null;
12694
12696
  if (this.fieldMenuPopoverRef) {
12695
12697
  this.fieldMenuPopoverRef.beforeClosed().subscribe(() => {
12696
12698
  if (!isSelfClose) {
@@ -12927,7 +12929,7 @@ class AITableGridEventService {
12927
12929
  manualClosure: true,
12928
12930
  animationDisabled: true,
12929
12931
  autoAdaptive: true
12930
- });
12932
+ }) ?? null;
12931
12933
  if (this.cellEditorPopoverRef) {
12932
12934
  const wheelEvent = fromEvent(this.cellEditorPopoverRef.componentInstance.elementRef.nativeElement, 'wheel').subscribe((event) => {
12933
12935
  const field = aiTable.fieldsMap()[fieldId];
@@ -13465,8 +13467,8 @@ class RecordDetailService {
13465
13467
  this.config = null;
13466
13468
  }
13467
13469
  open(config) {
13468
- if (this.isOpen()) {
13469
- this.currentSlideRef?.componentInstance.setSelection(config.recordId);
13470
+ if (this.isOpen() && this.currentSlideRef) {
13471
+ this.currentSlideRef.componentInstance.setSelection(config.recordId);
13470
13472
  return this.currentSlideRef;
13471
13473
  }
13472
13474
  this.config = config;
@@ -13483,7 +13485,7 @@ class RecordDetailService {
13483
13485
  actions: config.actions
13484
13486
  },
13485
13487
  ...config.slideConfig
13486
- });
13488
+ }) ?? null;
13487
13489
  if (this.currentSlideRef) {
13488
13490
  this.currentSlideRef.afterOpened().subscribe(() => {
13489
13491
  this.setupDocumentClickListener(config);
@@ -13492,6 +13494,9 @@ class RecordDetailService {
13492
13494
  this.close();
13493
13495
  });
13494
13496
  }
13497
+ if (!this.currentSlideRef) {
13498
+ throw new Error('Failed to open slide');
13499
+ }
13495
13500
  return this.currentSlideRef;
13496
13501
  }
13497
13502
  close() {