coer-elements 1.1.28 → 1.1.29

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.
@@ -17,7 +17,7 @@ export declare class CoerDateBox extends ControlValue implements OnInit {
17
17
  id: string;
18
18
  label: import("@angular/core").InputSignal<string>;
19
19
  placeholder: import("@angular/core").InputSignal<string>;
20
- textPosition: import("@angular/core").InputSignal<"left" | "center" | "right">;
20
+ textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
21
21
  isInvalid: import("@angular/core").InputSignal<boolean>;
22
22
  isValid: import("@angular/core").InputSignal<boolean>;
23
23
  isLoading: import("@angular/core").InputSignal<boolean>;
@@ -25,6 +25,8 @@ export declare class CoerGrid<T> extends CoerGridExtension<T> {
25
25
  /** */
26
26
  FocusInput(indexRow?: number, indexColumn?: number, onlyFocus?: boolean): void;
27
27
  /** */
28
+ FocusLastInput(onlyFocus?: boolean): void;
29
+ /** */
28
30
  FocusRow(callback: (row: T) => boolean): void;
29
31
  /** */
30
32
  Sort(columnName: string): Promise<void>;
@@ -41,9 +43,9 @@ export declare class CoerGrid<T> extends CoerGridExtension<T> {
41
43
  /** */
42
44
  protected ClickOnRow(row: T): void;
43
45
  /** Inserts new elements at the start */
44
- Unshift(row: T, focus?: boolean): void;
46
+ Unshift(row: T, focus?: boolean, onlyFocus?: boolean): void;
45
47
  /** Appends new elements to the end */
46
- Push(row: T, focus?: boolean): void;
48
+ Push(row: T, focus?: boolean, onlyFocus?: boolean): void;
47
49
  /** Delete Row By index */
48
50
  DeleteRow(indexRow: number): Promise<void>;
49
51
  /** Delete row list by callback */
@@ -13,7 +13,7 @@ export declare class CoerModal implements OnInit {
13
13
  title: import("@angular/core").InputSignal<string>;
14
14
  icon: import("@angular/core").InputSignal<string>;
15
15
  showCloseButton: import("@angular/core").InputSignal<boolean>;
16
- width: import("@angular/core").InputSignal<"small" | "auto" | "full">;
16
+ width: import("@angular/core").InputSignal<"auto" | "small" | "full">;
17
17
  height: import("@angular/core").InputSignal<string>;
18
18
  maxHeight: import("@angular/core").InputSignal<string>;
19
19
  get isOpen(): boolean;
@@ -14,7 +14,7 @@ export declare class CoerNumberBox extends ControlValue implements OnInit {
14
14
  id: string;
15
15
  label: import("@angular/core").InputSignal<string>;
16
16
  placeholder: import("@angular/core").InputSignal<string>;
17
- textPosition: import("@angular/core").InputSignal<"left" | "center" | "right">;
17
+ textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
18
18
  min: import("@angular/core").InputSignal<number>;
19
19
  max: import("@angular/core").InputSignal<number>;
20
20
  isInvalid: import("@angular/core").InputSignal<boolean>;
@@ -46,9 +46,7 @@ export declare class CoerNumberBox extends ControlValue implements OnInit {
46
46
  /** */
47
47
  private ValidateRangeValue;
48
48
  /** */
49
- Focus(delay?: number): void;
50
- /** */
51
- Select(delay?: number): void;
49
+ Focus(select?: boolean, delay?: number): void;
52
50
  /** */
53
51
  Blur(): void;
54
52
  static ɵfac: i0.ɵɵFactoryDeclaration<CoerNumberBox, never>;
@@ -13,7 +13,7 @@ export declare class CoerSecretBox extends ControlValue implements OnInit {
13
13
  id: string;
14
14
  label: import("@angular/core").InputSignal<string>;
15
15
  placeholder: import("@angular/core").InputSignal<string>;
16
- textPosition: import("@angular/core").InputSignal<"left" | "center" | "right">;
16
+ textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
17
17
  minLength: import("@angular/core").InputSignal<string | number>;
18
18
  maxLength: import("@angular/core").InputSignal<string | number>;
19
19
  isInvalid: import("@angular/core").InputSignal<boolean>;
@@ -46,9 +46,7 @@ export declare class CoerSecretBox extends ControlValue implements OnInit {
46
46
  /** */
47
47
  private SetEvents;
48
48
  /** */
49
- Focus(delay?: number): void;
50
- /** */
51
- Select(delay?: number): void;
49
+ Focus(select?: boolean, delay?: number): void;
52
50
  /** */
53
51
  Blur(): void;
54
52
  static ɵfac: i0.ɵɵFactoryDeclaration<CoerSecretBox, never>;
@@ -65,7 +65,7 @@ export declare class CoerSelectbox<T> extends ControlValue implements OnInit {
65
65
  /** */
66
66
  Unselect(): void;
67
67
  /** */
68
- Focus(delay?: number, open?: boolean): void;
68
+ Focus(open?: boolean, delay?: number): void;
69
69
  /** */
70
70
  Blur(): void;
71
71
  /** */
@@ -12,7 +12,7 @@ export declare class CoerTextarea extends ControlValue implements OnInit {
12
12
  id: string;
13
13
  label: import("@angular/core").InputSignal<string>;
14
14
  placeholder: import("@angular/core").InputSignal<string>;
15
- textPosition: import("@angular/core").InputSignal<"left" | "center" | "right">;
15
+ textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
16
16
  minLength: import("@angular/core").InputSignal<string | number>;
17
17
  maxLength: import("@angular/core").InputSignal<string | number>;
18
18
  isInvalid: import("@angular/core").InputSignal<boolean>;
@@ -40,9 +40,7 @@ export declare class CoerTextarea extends ControlValue implements OnInit {
40
40
  /** */
41
41
  private SetEvents;
42
42
  /** */
43
- Focus(delay?: number): void;
44
- /** */
45
- Select(delay?: number): void;
43
+ Focus(select?: boolean, delay?: number): void;
46
44
  /** */
47
45
  Blur(): void;
48
46
  /** */
@@ -13,7 +13,7 @@ export declare class CoerTextBox extends ControlValue implements OnInit {
13
13
  id: string;
14
14
  label: import("@angular/core").InputSignal<string>;
15
15
  placeholder: import("@angular/core").InputSignal<string>;
16
- textPosition: import("@angular/core").InputSignal<"left" | "center" | "right">;
16
+ textPosition: import("@angular/core").InputSignal<"left" | "right" | "center">;
17
17
  minLength: import("@angular/core").InputSignal<string | number>;
18
18
  maxLength: import("@angular/core").InputSignal<string | number>;
19
19
  isInvalid: import("@angular/core").InputSignal<boolean>;
@@ -52,9 +52,7 @@ export declare class CoerTextBox extends ControlValue implements OnInit {
52
52
  /** */
53
53
  private SetEvents;
54
54
  /** */
55
- Focus(delay?: number): void;
56
- /** */
57
- Select(delay?: number): void;
55
+ Focus(select?: boolean, delay?: number): void;
58
56
  /** */
59
57
  Blur(): void;
60
58
  /** */
@@ -889,7 +889,7 @@ class CoerNumberBox extends ControlValue {
889
889
  if (!this._isEnable())
890
890
  this.Blur();
891
891
  else if (this.selectOnFocus())
892
- this.Select();
892
+ this.Focus(true);
893
893
  });
894
894
  this.element.addEventListener('blur', () => this.Blur());
895
895
  this.element.addEventListener('keyup', (event) => {
@@ -1021,7 +1021,7 @@ class CoerNumberBox extends ControlValue {
1021
1021
  return String(value);
1022
1022
  }
1023
1023
  /** */
1024
- Focus(delay = 0) {
1024
+ Focus(select = false, delay = 0) {
1025
1025
  if (this._isLoadingEvent())
1026
1026
  return;
1027
1027
  else
@@ -1029,20 +1029,8 @@ class CoerNumberBox extends ControlValue {
1029
1029
  Tools.Sleep(delay).then(() => {
1030
1030
  if (this._isEnable()) {
1031
1031
  this.element.focus();
1032
- }
1033
- this._isLoadingEvent.set(false);
1034
- });
1035
- }
1036
- /** */
1037
- Select(delay = 0) {
1038
- if (this._isLoadingEvent())
1039
- return;
1040
- else
1041
- this._isLoadingEvent.set(true);
1042
- Tools.Sleep(delay).then(() => {
1043
- if (this._isEnable()) {
1044
- this.element.focus();
1045
- this.element.select();
1032
+ if (select)
1033
+ this.element.select();
1046
1034
  }
1047
1035
  this._isLoadingEvent.set(false);
1048
1036
  });
@@ -1342,7 +1330,7 @@ class CoerSelectbox extends ControlValue {
1342
1330
  this.Blur();
1343
1331
  }
1344
1332
  /** */
1345
- Focus(delay = 0, open = true) {
1333
+ Focus(open = true, delay = 0) {
1346
1334
  if (this._isLoadingEvent())
1347
1335
  return;
1348
1336
  else
@@ -1539,7 +1527,7 @@ class CoerTextBox extends ControlValue {
1539
1527
  if (!this._isEnable())
1540
1528
  this.Blur();
1541
1529
  else if (this.selectOnFocus())
1542
- this.Select();
1530
+ this.Focus(true);
1543
1531
  });
1544
1532
  this.element.addEventListener('keyup', (event) => {
1545
1533
  if (this._isEnable()) {
@@ -1568,7 +1556,7 @@ class CoerTextBox extends ControlValue {
1568
1556
  });
1569
1557
  }
1570
1558
  /** */
1571
- Focus(delay = 0) {
1559
+ Focus(select = false, delay = 0) {
1572
1560
  if (this._isLoadingEvent())
1573
1561
  return;
1574
1562
  else
@@ -1576,20 +1564,8 @@ class CoerTextBox extends ControlValue {
1576
1564
  Tools.Sleep(delay).then(() => {
1577
1565
  if (this._isEnable()) {
1578
1566
  this.element.focus();
1579
- }
1580
- this._isLoadingEvent.set(false);
1581
- });
1582
- }
1583
- /** */
1584
- Select(delay = 0) {
1585
- if (this._isLoadingEvent())
1586
- return;
1587
- else
1588
- this._isLoadingEvent.set(true);
1589
- Tools.Sleep(delay).then(() => {
1590
- if (this._isEnable()) {
1591
- this.element.focus();
1592
- this.element.select();
1567
+ if (select)
1568
+ this.element.select();
1593
1569
  }
1594
1570
  this._isLoadingEvent.set(false);
1595
1571
  });
@@ -2248,7 +2224,7 @@ class CoerGrid extends CoerGridExtension {
2248
2224
  SelectSearch() {
2249
2225
  Tools.Sleep(0).then(() => {
2250
2226
  if (this.inputSearch)
2251
- this.inputSearch().Select();
2227
+ this.inputSearch().Focus(true);
2252
2228
  });
2253
2229
  }
2254
2230
  /** */
@@ -2298,8 +2274,14 @@ class CoerGrid extends CoerGridExtension {
2298
2274
  let item = {};
2299
2275
  this._isLoading.set(true);
2300
2276
  const FILE_NAME = (this.exportButton?.fileName || 'COER Report') + '.xlsx';
2301
- let ROW_DATA_SOURCE = (this.exportButton.hasOwnProperty('onlyRowFiltered') && !this.exportButton.onlyRowFiltered)
2302
- ? this.value_signal() : this.gridDataSourceFiltered();
2277
+ let ROW_DATA_SOURCE = [];
2278
+ if (this.exportButton.hasOwnProperty('onlySelectedItem') && this.exportButton.onlySelectedItem) {
2279
+ ROW_DATA_SOURCE = this.selectedItems();
2280
+ }
2281
+ else {
2282
+ ROW_DATA_SOURCE = (this.exportButton.hasOwnProperty('onlyRowFiltered') && !this.exportButton.onlyRowFiltered)
2283
+ ? this.value_signal() : this.gridDataSourceFiltered();
2284
+ }
2303
2285
  const COLUMN_DATA_SOURCE = new Set();
2304
2286
  if (this.exportButton.hasOwnProperty('onlyColumnFiltered') && !this.exportButton.onlyColumnFiltered) {
2305
2287
  for (const row of this.value_signal()) {
@@ -2475,7 +2457,7 @@ class CoerGrid extends CoerGridExtension {
2475
2457
  if (this.gridLength().dataSourceFiltered > 0) {
2476
2458
  const FIRST_INPUT_COLUMN = COLUMNS.find(x => ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(x.type));
2477
2459
  if (Tools.IsNotNull(FIRST_INPUT_COLUMN)) {
2478
- this.FocusInput(0, FIRST_INPUT_COLUMN.indexColumn);
2460
+ this.FocusInput(0, FIRST_INPUT_COLUMN.indexColumn, onlyFocus);
2479
2461
  }
2480
2462
  }
2481
2463
  }
@@ -2486,36 +2468,59 @@ class CoerGrid extends CoerGridExtension {
2486
2468
  //Focus Textbox
2487
2469
  element = this.coerTextboxList().find(x => x.id == id);
2488
2470
  if (element) {
2489
- if (onlyFocus)
2490
- element.Focus();
2491
- else
2492
- element.Select();
2471
+ element.Focus(!onlyFocus);
2493
2472
  return;
2494
2473
  }
2495
2474
  //Focus Numberbox
2496
2475
  element = this.coerNumberboxList().find(x => x.id == id);
2497
2476
  if (element) {
2498
- if (onlyFocus)
2499
- element.Focus();
2500
- else
2501
- element.Select();
2477
+ element.Focus(!onlyFocus);
2502
2478
  return;
2503
2479
  }
2504
2480
  //Focus Selectbox
2505
2481
  element = this.coerSelectboxList().find(x => x.id == id);
2506
2482
  if (element) {
2507
- Tools.Sleep(100).then(_ => {
2508
- if (onlyFocus)
2509
- element.Focus(0, false);
2510
- else
2511
- element.Focus();
2512
- });
2483
+ Tools.Sleep(100).then(_ => element.Focus(!onlyFocus));
2513
2484
  return;
2514
2485
  }
2515
2486
  }
2516
2487
  });
2517
2488
  }
2518
2489
  /** */
2490
+ FocusLastInput(onlyFocus = false) {
2491
+ Tools.Sleep(0, 'FocusInput').then(() => {
2492
+ if (this._isDisabled())
2493
+ return;
2494
+ const INPUT_TEXT = this.columns().filter(x => Tools.IsNotNull(x.coerTextbox)).map(x => x.property);
2495
+ const INPUT_NUMBER = this.columns().filter(x => Tools.IsNotNull(x.coerNumberbox)).map(x => x.property);
2496
+ const INPUT_SELECT = this.columns().filter(x => Tools.IsNotNull(x.coerSelectbox)).map(x => x.property);
2497
+ let index = 0;
2498
+ const COLUMNS = [];
2499
+ for (const { columnName } of this.gridColumns()) {
2500
+ if (INPUT_TEXT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2501
+ COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerTextbox' });
2502
+ }
2503
+ else if (INPUT_NUMBER.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2504
+ COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerNumberbox' });
2505
+ }
2506
+ else if (INPUT_SELECT.some(property => property.toUpperCase() == columnName.toUpperCase())) {
2507
+ COLUMNS.push({ indexColumn: index, property: columnName, type: 'coerSelectbox' });
2508
+ }
2509
+ else {
2510
+ COLUMNS.push({ indexColumn: index, property: columnName, type: 'default-cell' });
2511
+ }
2512
+ ++index;
2513
+ }
2514
+ if (this.gridLength().dataSourceFiltered > 0) {
2515
+ const INPUT_COLUMNS = COLUMNS.filter(x => ['coerTextbox', 'coerNumberbox', 'coerSelectbox'].includes(x.type));
2516
+ const LAST_INPUT_COLUMN = INPUT_COLUMNS.pop();
2517
+ if (Tools.IsNotNull(LAST_INPUT_COLUMN)) {
2518
+ this.FocusInput(0, LAST_INPUT_COLUMN.indexColumn, onlyFocus);
2519
+ }
2520
+ }
2521
+ });
2522
+ }
2523
+ /** */
2519
2524
  FocusRow(callback) {
2520
2525
  Tools.Sleep().then(_ => {
2521
2526
  if (this._value.length > 0) {
@@ -2667,20 +2672,20 @@ class CoerGrid extends CoerGridExtension {
2667
2672
  this.onClickRow.emit(row);
2668
2673
  }
2669
2674
  /** Inserts new elements at the start */
2670
- Unshift(row, focus = true) {
2675
+ Unshift(row, focus = true, onlyFocus = false) {
2671
2676
  const dataSource = Tools.BreakReference(this._value);
2672
2677
  dataSource.unshift(row);
2673
2678
  this.SetValue(dataSource);
2674
2679
  if (focus)
2675
- this.FocusInput();
2680
+ this.FocusInput(-1, -1, onlyFocus);
2676
2681
  }
2677
2682
  /** Appends new elements to the end */
2678
- Push(row, focus = true) {
2683
+ Push(row, focus = true, onlyFocus = false) {
2679
2684
  const dataSource = Tools.BreakReference(this._value);
2680
2685
  dataSource.push(row);
2681
2686
  this.SetValue(dataSource);
2682
2687
  if (focus)
2683
- this.FocusInput();
2688
+ this.FocusLastInput(onlyFocus);
2684
2689
  }
2685
2690
  /** Delete Row By index */
2686
2691
  async DeleteRow(indexRow) {
@@ -3020,7 +3025,7 @@ class CoerSecretBox extends ControlValue {
3020
3025
  if (!this._isEnable())
3021
3026
  this.Blur();
3022
3027
  else if (this.selectOnFocus())
3023
- this.Select();
3028
+ this.Focus(true);
3024
3029
  });
3025
3030
  this.element.addEventListener('keyup', (event) => {
3026
3031
  if (this._isEnable()) {
@@ -3049,20 +3054,7 @@ class CoerSecretBox extends ControlValue {
3049
3054
  });
3050
3055
  }
3051
3056
  /** */
3052
- Focus(delay = 0) {
3053
- if (this._isLoadingEvent())
3054
- return;
3055
- else
3056
- this._isLoadingEvent.set(true);
3057
- Tools.Sleep(delay).then(() => {
3058
- if (this._isEnable()) {
3059
- this.element.focus();
3060
- }
3061
- this._isLoadingEvent.set(false);
3062
- });
3063
- }
3064
- /** */
3065
- Select(delay = 0) {
3057
+ Focus(select = false, delay = 0) {
3066
3058
  if (this._isLoadingEvent())
3067
3059
  return;
3068
3060
  else
@@ -3070,7 +3062,8 @@ class CoerSecretBox extends ControlValue {
3070
3062
  Tools.Sleep(delay).then(() => {
3071
3063
  if (this._isEnable()) {
3072
3064
  this.element.focus();
3073
- this.element.select();
3065
+ if (select)
3066
+ this.element.select();
3074
3067
  }
3075
3068
  this._isLoadingEvent.set(false);
3076
3069
  });
@@ -3912,20 +3905,7 @@ class CoerTextarea extends ControlValue {
3912
3905
  });
3913
3906
  }
3914
3907
  /** */
3915
- Focus(delay = 0) {
3916
- if (this._isLoadingEvent())
3917
- return;
3918
- else
3919
- this._isLoadingEvent.set(true);
3920
- Tools.Sleep(delay).then(() => {
3921
- if (this._isEnable()) {
3922
- this.element.focus();
3923
- }
3924
- this._isLoadingEvent.set(false);
3925
- });
3926
- }
3927
- /** */
3928
- Select(delay = 0) {
3908
+ Focus(select = false, delay = 0) {
3929
3909
  if (this._isLoadingEvent())
3930
3910
  return;
3931
3911
  else
@@ -3933,7 +3913,8 @@ class CoerTextarea extends ControlValue {
3933
3913
  Tools.Sleep(delay).then(() => {
3934
3914
  if (this._isEnable()) {
3935
3915
  this.element.focus();
3936
- this.element.select();
3916
+ if (select)
3917
+ this.element.select();
3937
3918
  }
3938
3919
  this._isLoadingEvent.set(false);
3939
3920
  });