@sumaris-net/ngx-components 18.22.17 → 18.22.19

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "18.22.17",
4
+ "version": "18.22.19",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
@@ -1,7 +1,7 @@
1
1
  import { AbstractControl } from '@angular/forms';
2
2
  import { filterNumberInput, selectInputContent, selectInputContentFromEvent } from '../../shared/inputs';
3
3
  import { WaitForOptions } from '../../shared/observables';
4
- import { addValueInArray, clearValueInArray, copyEntity2Form, disableAndClearControl, disableAndClearControls, disableControl, disableControls, enableControl, enableControls, filterFormErrors, filterFormErrorsByPath, filterFormErrorsByPrefix, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, setControlEnabled, setControlsEnabled, setControlRequired, setFormErrors, updateValueAndValidity, waitIdle, waitWhilePending } from '../../shared/forms';
4
+ import { addValueInArray, clearValueInArray, copyEntity2Form, disableAndClearControl, disableAndClearControls, disableControl, disableControls, enableControl, enableControls, filterFormErrors, filterFormErrorsByPath, filterFormErrorsByPrefix, getControlFromPath, getFormErrors, getFormValueFromEntity, logFormErrors, markAllAsTouched, markAsUntouched, removeValueInArray, resizeArray, setControlEnabled, setControlsEnabled, setControlRequired, setFormErrors, updateValueAndValidity, waitIdle, waitWhilePending, adaptValueToControl } from '../../shared/forms';
5
5
  export type IAppFormGetter = () => IAppForm;
6
6
  export declare interface OnReady {
7
7
  ngOnReady(): any;
@@ -219,6 +219,7 @@ export declare class AppFormProvider<F extends IAppForm = IAppForm> implements I
219
219
  export declare class AppFormUtils {
220
220
  static copyEntity2Form: typeof copyEntity2Form;
221
221
  static getFormValueFromEntity: typeof getFormValueFromEntity;
222
+ static getControlValueFromEntity: typeof adaptValueToControl;
222
223
  /**
223
224
  * Retrieves a control from the provided form/control structure using a dot-separated path.
224
225
  *
@@ -218,12 +218,33 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
218
218
  confirmAndAdd(event?: Event, row?: AsyncTableElement<T>, opts?: {
219
219
  focusColumn?: string;
220
220
  }): Promise<boolean>;
221
+ /**
222
+ * Same as confirmAndUp(), but using the next focused row. Should be call by the action column components
223
+ * @param event
224
+ * @param row
225
+ * @param opts
226
+ */
221
227
  confirmAndBackward(event?: Event, row?: AsyncTableElement<T>, opts?: {
222
228
  focusColumn?: string;
223
- }): Promise<boolean>;
229
+ } & WaitForOptions): Promise<boolean>;
224
230
  confirmAndForward(event: Event | undefined, row?: AsyncTableElement<T>, opts?: {
225
231
  focusColumn?: string;
226
232
  }): Promise<boolean>;
233
+ /**
234
+ * Confirms the current row and moves the focus to the upper row.
235
+ * Typical usage is inside a <input type="number">, with `(keyup.arrowUp)="confirmAndUp(event, row, {focusColumn: columnName})"`
236
+ * Same as confirmAndBackward, but on the current row.
237
+ *
238
+ *
239
+ * @param {Event} [event] - The event associated with the confirmation and update action.
240
+ * @param {AsyncTableElement} [row] - The current row object.
241
+ * @param {Object} [opts] - Options.
242
+ * @param {string} [opts.focusColumn] - The column to focus on the upper row; defaults to the current focus column
243
+ * @return {Promise<boolean>} A promise that resolves to a boolean indicating the success of the navigation.
244
+ */
245
+ confirmAndUp(event?: Event, row?: AsyncTableElement<T>, opts?: {
246
+ focusColumn?: string;
247
+ } & WaitForOptions): Promise<boolean>;
227
248
  /**
228
249
  * Confirm the creation of the given row, or if not specified the currently edited row
229
250
  *
@@ -390,7 +411,7 @@ export declare abstract class AppAsyncTable<T extends IEntity<T, ID>, F = any, I
390
411
  */
391
412
  protected initPermanentSelection(): void;
392
413
  private listenSortAndPaginationEvents;
393
- private editRowById;
414
+ private editOrAddRowById;
394
415
  private setLoading;
395
416
  private deleteNewRow;
396
417
  private deleteExistingRow;
@@ -395,7 +395,7 @@ export declare abstract class AppTable<T extends IEntity<T, ID>, F = any, ID = n
395
395
  */
396
396
  protected initPermanentSelection(): void;
397
397
  private listenSortAndPaginationEvents;
398
- private editRowById;
398
+ private editOrAddRowById;
399
399
  private setLoading;
400
400
  private deleteNewRow;
401
401
  private deleteExistingRow;
@@ -17,7 +17,7 @@ export interface InputElement extends FocusableElement {
17
17
  }
18
18
  export declare function isInputElement(object: any): object is InputElement;
19
19
  export declare function asInputElement<T = any>(object: ElementRef<T>): InputElement | undefined;
20
- export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
20
+ export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | 0 | -1;
21
21
  export interface CanGainFocusOptions {
22
22
  minTabindex?: number;
23
23
  maxTabindex?: number;
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "18.22.17",
5
+ "version": "18.22.19",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{