coer-elements 1.1.27 → 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.
@@ -9,7 +9,7 @@ export declare class CoerButton implements OnInit, OnDestroy {
9
9
  color: import("@angular/core").InputSignal<"default" | "primary" | "secondary" | "success" | "warning" | "danger" | "navigation" | "dark">;
10
10
  type: import("@angular/core").InputSignal<"filled" | "outline" | "icon" | "icon-outline" | "icon-no-border">;
11
11
  icon: import("@angular/core").InputSignal<string>;
12
- iconPosition: import("@angular/core").InputSignal<"right" | "left">;
12
+ iconPosition: import("@angular/core").InputSignal<"left" | "right">;
13
13
  path: import("@angular/core").InputSignal<string | (string | number)[]>;
14
14
  animation: import("@angular/core").InputSignal<boolean>;
15
15
  isLoading: import("@angular/core").InputSignal<boolean>;
@@ -25,7 +25,7 @@ export declare class CoerButton implements OnInit, OnDestroy {
25
25
  marginRight: import("@angular/core").InputSignal<string>;
26
26
  marginBottom: import("@angular/core").InputSignal<string>;
27
27
  marginLeft: import("@angular/core").InputSignal<string>;
28
- tooltipPosition: import("@angular/core").InputSignal<"top" | "right" | "bottom" | "left">;
28
+ tooltipPosition: import("@angular/core").InputSignal<"left" | "right" | "top" | "bottom">;
29
29
  set tooltip(value: string);
30
30
  onClick: import("@angular/core").OutputEmitterRef<void>;
31
31
  protected _isEnable: import("@angular/core").Signal<boolean>;
@@ -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<"center" | "right" | "left">;
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>;
@@ -30,7 +30,7 @@ export declare class CoerDropdown<T> extends ControlValue implements OnInit {
30
30
  marginBottom: import("@angular/core").InputSignal<string>;
31
31
  marginLeft: import("@angular/core").InputSignal<string>;
32
32
  tooltip: import("@angular/core").InputSignal<string>;
33
- tooltipPosition: import("@angular/core").InputSignal<"top" | "right" | "bottom" | "left">;
33
+ tooltipPosition: import("@angular/core").InputSignal<"left" | "right" | "top" | "bottom">;
34
34
  onSelected: import("@angular/core").OutputEmitterRef<T>;
35
35
  onUnselect: import("@angular/core").OutputEmitterRef<null>;
36
36
  ngOnInit(): void;
@@ -23,7 +23,9 @@ export declare class CoerGrid<T> extends CoerGridExtension<T> {
23
23
  /** */
24
24
  private __NextInput;
25
25
  /** */
26
- FocusInput(indexRow?: number, indexColumn?: number): void;
26
+ FocusInput(indexRow?: number, indexColumn?: number, onlyFocus?: boolean): void;
27
+ /** */
28
+ FocusLastInput(onlyFocus?: boolean): void;
27
29
  /** */
28
30
  FocusRow(callback: (row: T) => boolean): void;
29
31
  /** */
@@ -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 */
@@ -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<"center" | "right" | "left">;
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<"center" | "right" | "left">;
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
  /** */
@@ -16,7 +16,7 @@ export declare class CoerSwitch extends ControlValue implements OnInit, OnDestro
16
16
  isDisabled: import("@angular/core").InputSignal<boolean>;
17
17
  isReadonly: import("@angular/core").InputSignal<boolean>;
18
18
  isInvisible: import("@angular/core").InputSignal<boolean>;
19
- tooltipPosition: import("@angular/core").InputSignal<"top" | "right" | "bottom" | "left">;
19
+ tooltipPosition: import("@angular/core").InputSignal<"left" | "right" | "top" | "bottom">;
20
20
  set tooltip(value: string);
21
21
  onChange: import("@angular/core").OutputEmitterRef<boolean>;
22
22
  ngOnInit(): void;
@@ -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<"center" | "right" | "left">;
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<"center" | "right" | "left">;
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,20 +1556,7 @@ class CoerTextBox extends ControlValue {
1568
1556
  });
1569
1557
  }
1570
1558
  /** */
1571
- Focus(delay = 0) {
1572
- if (this._isLoadingEvent())
1573
- return;
1574
- else
1575
- this._isLoadingEvent.set(true);
1576
- Tools.Sleep(delay).then(() => {
1577
- if (this._isEnable()) {
1578
- this.element.focus();
1579
- }
1580
- this._isLoadingEvent.set(false);
1581
- });
1582
- }
1583
- /** */
1584
- Select(delay = 0) {
1559
+ Focus(select = false, delay = 0) {
1585
1560
  if (this._isLoadingEvent())
1586
1561
  return;
1587
1562
  else
@@ -1589,7 +1564,8 @@ class CoerTextBox extends ControlValue {
1589
1564
  Tools.Sleep(delay).then(() => {
1590
1565
  if (this._isEnable()) {
1591
1566
  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()) {
@@ -2447,7 +2429,7 @@ class CoerGrid extends CoerGridExtension {
2447
2429
  }
2448
2430
  }
2449
2431
  /** */
2450
- FocusInput(indexRow = -1, indexColumn = -1) {
2432
+ FocusInput(indexRow = -1, indexColumn = -1, onlyFocus = false) {
2451
2433
  Tools.Sleep(0, 'FocusInput').then(() => {
2452
2434
  if (this._isDisabled())
2453
2435
  return;
@@ -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,25 +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
- element.Select();
2471
+ element.Focus(!onlyFocus);
2490
2472
  return;
2491
2473
  }
2492
2474
  //Focus Numberbox
2493
2475
  element = this.coerNumberboxList().find(x => x.id == id);
2494
2476
  if (element) {
2495
- element.Select();
2477
+ element.Focus(!onlyFocus);
2496
2478
  return;
2497
2479
  }
2498
2480
  //Focus Selectbox
2499
2481
  element = this.coerSelectboxList().find(x => x.id == id);
2500
2482
  if (element) {
2501
- Tools.Sleep(100).then(_ => element.Focus());
2483
+ Tools.Sleep(100).then(_ => element.Focus(!onlyFocus));
2502
2484
  return;
2503
2485
  }
2504
2486
  }
2505
2487
  });
2506
2488
  }
2507
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
+ /** */
2508
2524
  FocusRow(callback) {
2509
2525
  Tools.Sleep().then(_ => {
2510
2526
  if (this._value.length > 0) {
@@ -2656,20 +2672,20 @@ class CoerGrid extends CoerGridExtension {
2656
2672
  this.onClickRow.emit(row);
2657
2673
  }
2658
2674
  /** Inserts new elements at the start */
2659
- Unshift(row, focus = true) {
2675
+ Unshift(row, focus = true, onlyFocus = false) {
2660
2676
  const dataSource = Tools.BreakReference(this._value);
2661
2677
  dataSource.unshift(row);
2662
2678
  this.SetValue(dataSource);
2663
2679
  if (focus)
2664
- this.FocusInput();
2680
+ this.FocusInput(-1, -1, onlyFocus);
2665
2681
  }
2666
2682
  /** Appends new elements to the end */
2667
- Push(row, focus = true) {
2683
+ Push(row, focus = true, onlyFocus = false) {
2668
2684
  const dataSource = Tools.BreakReference(this._value);
2669
2685
  dataSource.push(row);
2670
2686
  this.SetValue(dataSource);
2671
2687
  if (focus)
2672
- this.FocusInput();
2688
+ this.FocusLastInput(onlyFocus);
2673
2689
  }
2674
2690
  /** Delete Row By index */
2675
2691
  async DeleteRow(indexRow) {
@@ -3009,7 +3025,7 @@ class CoerSecretBox extends ControlValue {
3009
3025
  if (!this._isEnable())
3010
3026
  this.Blur();
3011
3027
  else if (this.selectOnFocus())
3012
- this.Select();
3028
+ this.Focus(true);
3013
3029
  });
3014
3030
  this.element.addEventListener('keyup', (event) => {
3015
3031
  if (this._isEnable()) {
@@ -3038,7 +3054,7 @@ class CoerSecretBox extends ControlValue {
3038
3054
  });
3039
3055
  }
3040
3056
  /** */
3041
- Focus(delay = 0) {
3057
+ Focus(select = false, delay = 0) {
3042
3058
  if (this._isLoadingEvent())
3043
3059
  return;
3044
3060
  else
@@ -3046,20 +3062,8 @@ class CoerSecretBox extends ControlValue {
3046
3062
  Tools.Sleep(delay).then(() => {
3047
3063
  if (this._isEnable()) {
3048
3064
  this.element.focus();
3049
- }
3050
- this._isLoadingEvent.set(false);
3051
- });
3052
- }
3053
- /** */
3054
- Select(delay = 0) {
3055
- if (this._isLoadingEvent())
3056
- return;
3057
- else
3058
- this._isLoadingEvent.set(true);
3059
- Tools.Sleep(delay).then(() => {
3060
- if (this._isEnable()) {
3061
- this.element.focus();
3062
- this.element.select();
3065
+ if (select)
3066
+ this.element.select();
3063
3067
  }
3064
3068
  this._isLoadingEvent.set(false);
3065
3069
  });
@@ -3901,20 +3905,7 @@ class CoerTextarea extends ControlValue {
3901
3905
  });
3902
3906
  }
3903
3907
  /** */
3904
- Focus(delay = 0) {
3905
- if (this._isLoadingEvent())
3906
- return;
3907
- else
3908
- this._isLoadingEvent.set(true);
3909
- Tools.Sleep(delay).then(() => {
3910
- if (this._isEnable()) {
3911
- this.element.focus();
3912
- }
3913
- this._isLoadingEvent.set(false);
3914
- });
3915
- }
3916
- /** */
3917
- Select(delay = 0) {
3908
+ Focus(select = false, delay = 0) {
3918
3909
  if (this._isLoadingEvent())
3919
3910
  return;
3920
3911
  else
@@ -3922,7 +3913,8 @@ class CoerTextarea extends ControlValue {
3922
3913
  Tools.Sleep(delay).then(() => {
3923
3914
  if (this._isEnable()) {
3924
3915
  this.element.focus();
3925
- this.element.select();
3916
+ if (select)
3917
+ this.element.select();
3926
3918
  }
3927
3919
  this._isLoadingEvent.set(false);
3928
3920
  });