@colijnit/corecomponents_v12 261.20.9 → 261.20.11

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.
@@ -7823,7 +7823,11 @@ class InputTextComponent extends BaseInputComponent {
7823
7823
  event.preventDefault();
7824
7824
  }
7825
7825
  }
7826
- if (this.type === 'number' && this.model?.length === this.maxLength && /^\d$/.test(key)) {
7826
+ const value = String(this.model ?? "");
7827
+ if (this.type === "number" &&
7828
+ this.maxLength > 0 &&
7829
+ value.length >= this.maxLength &&
7830
+ /^\d$/.test(key)) {
7827
7831
  event.preventDefault();
7828
7832
  }
7829
7833
  }
@@ -11834,6 +11838,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
11834
11838
  args: ['document:mouseup', ['$event']]
11835
11839
  }] } });
11836
11840
 
11841
+ var ScrollDirection;
11842
+ (function (ScrollDirection) {
11843
+ ScrollDirection["top"] = "top";
11844
+ ScrollDirection["bottom"] = "bottom";
11845
+ })(ScrollDirection || (ScrollDirection = {}));
11846
+
11837
11847
  class ObserveVisibilityDirective {
11838
11848
  _element;
11839
11849
  threshold = 0;
@@ -12407,6 +12417,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12407
12417
  changeDetection;
12408
12418
  _formMaster;
12409
12419
  defaultTextAlign = ColumnAlign.Left;
12420
+ scrollDirections = ScrollDirection;
12410
12421
  set headerCells(cells) {
12411
12422
  const headerElements = cells.toArray();
12412
12423
  for (let i = 0; i < headerElements.length; i++) {
@@ -12425,6 +12436,8 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12425
12436
  showColumnSort = false;
12426
12437
  showRowButtons = false;
12427
12438
  resetPageOnDataChange = true;
12439
+ scrollOnRowAction = true;
12440
+ scrollDirection = ScrollDirection.top;
12428
12441
  /**
12429
12442
  * Promise function, if provided should return boolean
12430
12443
  */
@@ -12575,7 +12588,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12575
12588
  if (this.currentPage !== 1) {
12576
12589
  this.currentPage = 1;
12577
12590
  this.selectedRowIndex = -1;
12578
- window.scrollTo({ top: 0, behavior: 'smooth' });
12591
+ this._scrollAfterRowAction();
12579
12592
  }
12580
12593
  this._detectChanges();
12581
12594
  }
@@ -12588,7 +12601,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12588
12601
  if (this.currentPage !== 1) {
12589
12602
  this.currentPage = 1;
12590
12603
  this.selectedRowIndex = -1;
12591
- window.scrollTo({ top: 0, behavior: 'smooth' });
12604
+ this._scrollAfterRowAction();
12592
12605
  }
12593
12606
  this._detectChanges();
12594
12607
  }
@@ -12932,7 +12945,7 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12932
12945
  if (this._newRow) {
12933
12946
  this.saveRow.next(this._newRowReference);
12934
12947
  this._newRowReference = null; // clear
12935
- window.scrollTo({ top: 0, behavior: 'smooth' });
12948
+ this._scrollAfterRowAction();
12936
12949
  }
12937
12950
  else {
12938
12951
  let index = -1; // existing row
@@ -12963,8 +12976,20 @@ class SimpleGridComponent extends BaseSimpleGridComponent {
12963
12976
  this.editing = false;
12964
12977
  this.rowToEdit = undefined;
12965
12978
  }
12979
+ _scrollAfterRowAction() {
12980
+ if (!this.scrollOnRowAction) {
12981
+ return;
12982
+ }
12983
+ const top = this.scrollDirection === ScrollDirection.top
12984
+ ? 0
12985
+ : document.documentElement.scrollHeight;
12986
+ window.scrollTo({
12987
+ top: top,
12988
+ behavior: "smooth"
12989
+ });
12990
+ }
12966
12991
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: SimpleGridComponent, deps: [{ token: IconCacheService }, { token: i0.ChangeDetectorRef }, { token: FormMasterService }], target: i0.ɵɵFactoryTarget.Component });
12967
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SimpleGridComponent, isStandalone: false, selector: "co-simple-grid", inputs: { showAdd: "showAdd", showDelete: "showDelete", deselectAllowed: "deselectAllowed", editOnCellClick: "editOnCellClick", rightToolbar: "rightToolbar", showGridSettings: "showGridSettings", rowsPerPage: "rowsPerPage", rowDisabledFn: "rowDisabledFn", showColumnSort: "showColumnSort", showRowButtons: "showRowButtons", resetPageOnDataChange: "resetPageOnDataChange", canRowBeEdittedFn: "canRowBeEdittedFn" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.co-simple-grid": "this.showClass" } }, providers: [FormMasterService], viewQueries: [{ propertyName: "headerCells", predicate: ["headerCell"], descendants: true }, { propertyName: "rowElements", predicate: ["rowElement"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
12992
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: SimpleGridComponent, isStandalone: false, selector: "co-simple-grid", inputs: { showAdd: "showAdd", showDelete: "showDelete", deselectAllowed: "deselectAllowed", editOnCellClick: "editOnCellClick", rightToolbar: "rightToolbar", showGridSettings: "showGridSettings", rowsPerPage: "rowsPerPage", rowDisabledFn: "rowDisabledFn", showColumnSort: "showColumnSort", showRowButtons: "showRowButtons", resetPageOnDataChange: "resetPageOnDataChange", scrollOnRowAction: "scrollOnRowAction", scrollDirection: "scrollDirection", canRowBeEdittedFn: "canRowBeEdittedFn" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.co-simple-grid": "this.showClass" } }, providers: [FormMasterService], viewQueries: [{ propertyName: "headerCells", predicate: ["headerCell"], descendants: true }, { propertyName: "rowElements", predicate: ["rowElement"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
12968
12993
  @if (showToolbar) {
12969
12994
  <co-grid-toolbar
12970
12995
  [class.right]="rightToolbar"
@@ -13404,6 +13429,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
13404
13429
  type: Input
13405
13430
  }], resetPageOnDataChange: [{
13406
13431
  type: Input
13432
+ }], scrollOnRowAction: [{
13433
+ type: Input
13434
+ }], scrollDirection: [{
13435
+ type: Input
13407
13436
  }], canRowBeEdittedFn: [{
13408
13437
  type: Input
13409
13438
  }], showClass: [{
@@ -20886,5 +20915,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
20886
20915
  * Generated bundle index. Do not edit.
20887
20916
  */
20888
20917
 
20889
- export { AlignWithDirective, AlignWithModule, AppendPipe, AppendPipeModule, ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CalendarTemplateComponent, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayComponent, CheckmarkOverlayModule, ClickOutsideDirective, ClickoutsideModule, CoCurrencyPipe, CoCurrencyPipeModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, CoreLocalizePipe, DoubleCalendarComponent, DoubleCalendarModule, DragDropContainer, DragDropContainerComponent, DragDropManagerService, DragDropModule, DraggableDirective, ElementPosition, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, HourSchedulingExpandableComponent, HourSchedulingExpandableComponentModule, HourSchedulingExpandableTemplateComponent, HourSchedulingExpandableTemplateModule, HourSchedulingTestObjectComponent, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, InputTimeComponent, InputTimeModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityDirective, ObserveVisibilityModule, OrientationOfDirection, OverlayDirective, OverlayModule, OverlayParentDirective, OverlayService, PaginatePipe, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PrependPipe, PrependPipeModule, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, ScrollContainerComponent, ScrollContainerModule, SimpleGridCellComponent, SimpleGridColumnDirective, SimpleGridColumnTemplateDirective, SimpleGridColumnTemplateType, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirective, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog };
20918
+ export { AlignWithDirective, AlignWithModule, AppendPipe, AppendPipeModule, ArticleTileComponent, ArticleTileModule, BaseInputComponent, BaseInputDatePickerDirective, BaseModuleScreenConfigService, BaseModuleService, ButtonComponent, ButtonModule, CalendarComponent, CalendarModule, CalendarTemplateComponent, CardComponent, CardModule, Carousel3dComponent, Carousel3dModule, CarouselComponent, CarouselHammerConfig, CarouselModule, CheckmarkOverlayComponent, CheckmarkOverlayModule, ClickOutsideDirective, ClickoutsideModule, CoCurrencyPipe, CoCurrencyPipeModule, CoDialogComponent, CoDialogModule, CoDialogWizardComponent, CoDialogWizardModule, CoDirection, CoOrientation, CollapsibleComponent, CollapsibleModule, ColorPickerComponent, ColorPickerModule, ColorSequenceService, ColumnAlign, ContentViewMode, CoreComponentsIcon, CoreComponentsTranslationModule, CoreComponentsTranslationService, CoreDialogModule, CoreDialogService, CoreLocalizePipe, DoubleCalendarComponent, DoubleCalendarModule, DragDropContainer, DragDropContainerComponent, DragDropManagerService, DragDropModule, DraggableDirective, ElementPosition, FilterItemComponent, FilterItemMode, FilterItemModule, FilterItemViewmodel, FilterPipe, FilterPipeModule, FilterViewmodel, FormComponent, FormInputUserModelChangeListenerService, FormMasterService, FormModule, GridToolbarButtonComponent, GridToolbarButtonModule, GridToolbarComponent, GridToolbarModule, HourSchedulingComponent, HourSchedulingComponentModule, HourSchedulingExpandableComponent, HourSchedulingExpandableComponentModule, HourSchedulingExpandableTemplateComponent, HourSchedulingExpandableTemplateModule, HourSchedulingTestObjectComponent, IconCacheService, IconCollapseHandleComponent, IconCollapseHandleModule, IconComponent, IconModule, ImageComponent, ImageModule, InputCheckboxComponent, InputCheckboxModule, InputDatePickerComponent, InputDatePickerModule, InputDateRangePickerComponent, InputDateRangePickerModule, InputNumberPickerComponent, InputNumberPickerModule, InputRadioButtonComponent, InputRadioButtonModule, InputScannerComponent, InputScannerModule, InputSearchComponent, InputSearchModule, InputTextComponent, InputTextModule, InputTextareaComponent, InputTextareaModule, InputTimeComponent, InputTimeModule, LevelIndicatorComponent, LevelIndicatorModule, ListOfIconsComponent, ListOfIconsModule, ListOfValuesComponent, ListOfValuesModule, ListOfValuesPopupComponent, LoaderComponent, LoaderModule, NgZoneWrapperService, ObserveVisibilityDirective, ObserveVisibilityModule, OrientationOfDirection, OverlayDirective, OverlayModule, OverlayParentDirective, OverlayService, PaginatePipe, PaginationBarComponent, PaginationBarModule, PaginationComponent, PaginationModule, PopupButtonsComponent, PopupMessageDisplayComponent, PopupModule, PopupWindowShellComponent, PrependPipe, PrependPipeModule, PriceDisplayPipe, PriceDisplayPipeModule, PromptService, ResponsiveTextComponent, ResponsiveTextModule, SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME, ScreenConfigurationDirective, ScreenConfigurationModule, ScrollContainerComponent, ScrollContainerModule, ScrollDirection, SimpleGridCellComponent, SimpleGridColumnDirective, SimpleGridColumnTemplateDirective, SimpleGridColumnTemplateType, SimpleGridComponent, SimpleGridModule, TemplateWrapperDirective, TemplateWrapperModule, TextInputPopupComponent, TileComponent, TileModule, TileSelectComponent, TileSelectModule, TooltipDirective, TooltipDirectiveModule, ViewModeButtonsComponent, ViewModeButtonsModule, emailValidator, equalValidator, getValidatePasswordErrorString, maxStringLengthValidator, passwordValidator, precisionScaleValidator, requiredValidator, showHideDialog };
20890
20919
  //# sourceMappingURL=colijnit-corecomponents_v12.mjs.map