@colijnit/corecomponents_v12 262.1.9 → 262.1.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.
@@ -7190,7 +7190,7 @@ class InputTextComponent extends BaseInputComponent {
7190
7190
  rightIconData;
7191
7191
  selectOnFocus = false;
7192
7192
  emptyPlace = false;
7193
- firstDayOfWeek = '1'; // default is sunday ioneJS
7193
+ firstDayOfWeek = '1'; // Monday by default
7194
7194
  noStyle = false;
7195
7195
  hideArrowButtons = false;
7196
7196
  get isDate() {
@@ -7402,18 +7402,19 @@ class InputTextComponent extends BaseInputComponent {
7402
7402
  // Internal default first day of week
7403
7403
  let weekdayOffset = parseInt(this.firstDayOfWeek, 10);
7404
7404
  if (isNaN(weekdayOffset) || weekdayOffset < 1 || weekdayOffset > 7) {
7405
- weekdayOffset = 2;
7405
+ weekdayOffset = 1; // Monday
7406
7406
  }
7407
- const jsWeekdayIndex = (weekdayOffset - 1) % 7;
7407
+ // 1 = Monday, 2 = Tuesday, 3 = Wednesday, ..., 7 = Sunday
7408
+ const jsWeekdayIndex = weekdayOffset - 1;
7408
7409
  const jan4 = new Date(year, 0, 4);
7409
7410
  const jan4Day = jan4.getDay();
7410
7411
  const diffToMonday = (jan4Day + 6) % 7;
7411
7412
  const firstWeekMonday = new Date(jan4);
7412
- firstWeekMonday.setDate(jan4.getDate() - diffToMonday); // Monday of week 1
7413
+ firstWeekMonday.setDate(jan4.getDate() - diffToMonday);
7413
7414
  const baseWeekStart = new Date(firstWeekMonday);
7414
- baseWeekStart.setDate(baseWeekStart.getDate() + (week - 1) * 7);
7415
- const targetDate = new Date(baseWeekStart);
7416
- targetDate.setDate(baseWeekStart.getDate() + jsWeekdayIndex);
7415
+ baseWeekStart.setDate(firstWeekMonday.getDate() + (week - 1) * 7);
7416
+ let targetDate = new Date(baseWeekStart);
7417
+ targetDate.setDate(targetDate.getDate() + jsWeekdayIndex);
7417
7418
  if (targetDate < today) {
7418
7419
  year += 1;
7419
7420
  const jan4Next = new Date(year, 0, 4);
@@ -7422,14 +7423,19 @@ class InputTextComponent extends BaseInputComponent {
7422
7423
  const firstWeekMondayNext = new Date(jan4Next);
7423
7424
  firstWeekMondayNext.setDate(jan4Next.getDate() - diffToMondayNext);
7424
7425
  const baseWeekStartNext = new Date(firstWeekMondayNext);
7425
- baseWeekStartNext.setDate(baseWeekStartNext.getDate() + (week - 1) * 7);
7426
- targetDate.setFullYear(year);
7427
- targetDate.setMonth(baseWeekStartNext.getMonth());
7428
- targetDate.setDate(baseWeekStartNext.getDate() + jsWeekdayIndex);
7426
+ baseWeekStartNext.setDate(firstWeekMondayNext.getDate() + (week - 1) * 7);
7427
+ targetDate = new Date(baseWeekStartNext);
7428
+ targetDate.setDate(targetDate.getDate() + jsWeekdayIndex);
7429
7429
  }
7430
- this.model = targetDate.toISOString().substring(0, 10);
7430
+ this.model = this.formatDateLocal(targetDate);
7431
7431
  this.modelChange.emit(this.model);
7432
7432
  }
7433
+ formatDateLocal(date) {
7434
+ const year = date.getFullYear();
7435
+ const month = String(date.getMonth() + 1).padStart(2, '0');
7436
+ const day = String(date.getDate()).padStart(2, '0');
7437
+ return `${year}-${month}-${day}`;
7438
+ }
7433
7439
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputTextComponent, deps: [{ token: FormComponent, optional: true }, { token: i0.ChangeDetectorRef }, { token: OverlayService }, { token: FormInputUserModelChangeListenerService }, { token: NgZoneWrapperService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
7434
7440
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: InputTextComponent, isStandalone: false, selector: "co-input-text", inputs: { useContent: "useContent", placeholder: "placeholder", align: "align", type: "type", formatPipe: "formatPipe", min: "min", max: "max", pattern: "pattern", digitsOnly: "digitsOnly", excludePlusMinus: "excludePlusMinus", showClearButton: "showClearButton", keyDownWhiteList: "keyDownWhiteList", showPlaceholderOnFocus: "showPlaceholderOnFocus", leftIcon: "leftIcon", rightIcon: "rightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", selectOnFocus: "selectOnFocus", emptyPlace: "emptyPlace", firstDayOfWeek: "firstDayOfWeek", noStyle: "noStyle", hideArrowButtons: "hideArrowButtons", model: "model" }, outputs: { leftIconClick: "leftIconClick", leftIconMouseDown: "leftIconMouseDown", leftIconMouseUp: "leftIconMouseUp", rightIconClick: "rightIconClick", rightIconMouseDown: "rightIconMouseDown", rightIconMouseUp: "rightIconMouseUp", clearIconClick: "clearIconClick", isFocused: "isFocused" }, host: { listeners: { "document:pointerup": "handleDocumentPointerUp($event)", "document:pointercancel": "handleDocumentPointerUp($event)" }, properties: { "class.no-style": "this.noStyle", "class.hide-arrows": "this.hideArrowButtons", "class.isDate": "this.isDate", "class.co-input-text": "this.showClass", "class.has-left-icon": "this.hasLeftIcon", "class.has-right-icon": "this.hasRightIcon", "class.has-own-label": "this.hasOwnLabel" } }, providers: [
7435
7441
  OverlayService, {
@@ -9584,6 +9590,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
9584
9590
 
9585
9591
  class InputSearchComponent extends BaseInputComponent {
9586
9592
  searchIcon = CoreComponentsIcon.Magnifier;
9593
+ inputSearchText;
9587
9594
  placeholder;
9588
9595
  handleKeydown = true;
9589
9596
  search = new EventEmitter();
@@ -9615,14 +9622,18 @@ class InputSearchComponent extends BaseInputComponent {
9615
9622
  this.model = model;
9616
9623
  this.modelChange.next(this.model);
9617
9624
  }
9625
+ requestFocus() {
9626
+ this.inputSearchText.requestFocus();
9627
+ }
9618
9628
  isMobileDevice() {
9619
9629
  return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
9620
9630
  }
9621
9631
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: InputSearchComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
9622
9632
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: InputSearchComponent, isStandalone: false, selector: "co-input-search", inputs: { placeholder: "placeholder", handleKeydown: "handleKeydown", useLeftIcon: "useLeftIcon", useRightIcon: "useRightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", centerLabel: "centerLabel" }, outputs: { search: "search", isFocused: "isFocused", leftIconClick: "leftIconClick", rightIconClick: "rightIconClick" }, host: { properties: { "class.center-label": "this.centerLabel", "class.co-input-search": "this.showClass" } }, providers: [
9623
9633
  OverlayService
9624
- ], usesInheritance: true, ngImport: i0, template: `
9634
+ ], viewQueries: [{ propertyName: "inputSearchText", first: true, predicate: ["inputText"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
9625
9635
  <co-input-text
9636
+ #inputText
9626
9637
  [ngClass]="customCssClass"
9627
9638
  [model]="model"
9628
9639
  [leftIcon]="useLeftIcon ? searchIcon : null"
@@ -9652,6 +9663,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
9652
9663
  selector: 'co-input-search',
9653
9664
  template: `
9654
9665
  <co-input-text
9666
+ #inputText
9655
9667
  [ngClass]="customCssClass"
9656
9668
  [model]="model"
9657
9669
  [leftIcon]="useLeftIcon ? searchIcon : null"
@@ -9675,7 +9687,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
9675
9687
  encapsulation: ViewEncapsulation.None,
9676
9688
  standalone: false
9677
9689
  }]
9678
- }], propDecorators: { placeholder: [{
9690
+ }], propDecorators: { inputSearchText: [{
9691
+ type: ViewChild,
9692
+ args: ['inputText']
9693
+ }], placeholder: [{
9679
9694
  type: Input
9680
9695
  }], handleKeydown: [{
9681
9696
  type: Input
@@ -16905,6 +16920,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
16905
16920
 
16906
16921
  class InputScannerComponent {
16907
16922
  _scannerService;
16923
+ inputSearch;
16908
16924
  model;
16909
16925
  placeholder;
16910
16926
  centerLabel = false;
@@ -16955,6 +16971,9 @@ class InputScannerComponent {
16955
16971
  this.barCodeScanned.next(this.model);
16956
16972
  this._blockEnterKeydown = false;
16957
16973
  }
16974
+ requestFocus() {
16975
+ this.inputSearch.requestFocus();
16976
+ }
16958
16977
  _clearTimeout() {
16959
16978
  clearTimeout(this._keyDownTimeout);
16960
16979
  this._keyDownTimeout = undefined;
@@ -16963,8 +16982,9 @@ class InputScannerComponent {
16963
16982
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: InputScannerComponent, isStandalone: false, selector: "co-input-scanner", inputs: { model: "model", placeholder: "placeholder", centerLabel: "centerLabel", useLeftIcon: "useLeftIcon", useRightIcon: "useRightIcon", leftIconData: "leftIconData", rightIconData: "rightIconData", customCssClass: "customCssClass", scannerDisabled: "scannerDisabled" }, outputs: { modelChange: "modelChange", leftIconClick: "leftIconClick", rightIconClick: "rightIconClick", search: "search", isFocused: "isFocused", barCodeScanned: "barCodeScanned" }, host: { listeners: { "keydown": "handleKeyDown($event)" }, properties: { "class.co-input-scanner": "this.showClass" } }, providers: [
16964
16983
  ScannerService,
16965
16984
  OverlayService
16966
- ], ngImport: i0, template: `
16985
+ ], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true }], ngImport: i0, template: `
16967
16986
  <co-input-search
16987
+ #inputSearch
16968
16988
  [(model)]="model"
16969
16989
  [handleKeydown]="false"
16970
16990
  [customCssClass]="customCssClass"
@@ -16986,6 +17006,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
16986
17006
  selector: 'co-input-scanner',
16987
17007
  template: `
16988
17008
  <co-input-search
17009
+ #inputSearch
16989
17010
  [(model)]="model"
16990
17011
  [handleKeydown]="false"
16991
17012
  [customCssClass]="customCssClass"
@@ -17007,7 +17028,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
17007
17028
  encapsulation: ViewEncapsulation.None,
17008
17029
  standalone: false
17009
17030
  }]
17010
- }], ctorParameters: () => [{ type: ScannerService }], propDecorators: { model: [{
17031
+ }], ctorParameters: () => [{ type: ScannerService }], propDecorators: { inputSearch: [{
17032
+ type: ViewChild,
17033
+ args: ['inputSearch']
17034
+ }], model: [{
17011
17035
  type: Input
17012
17036
  }], placeholder: [{
17013
17037
  type: Input