@tsi-developpement/tsi-shared-ui 1.10.0 → 1.10.3

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.
@@ -3,4 +3,4 @@ import { FormStateService } from "../services/form/form-state.service";
3
3
  import { PresentationDesignerBaseService } from "../services/presentation-setting/presentation-designer-base.service";
4
4
  import { GenericValidationStateService } from "../services/validation/generic-validation-state.service";
5
5
  import { InputRegistryService } from "../services/validation/input-registry.service";
6
- export declare const appProviders: (typeof PresentationDesignerBaseService | typeof GenericValidationStateService | typeof InputRegistryService | typeof DynamicFormService | typeof FormStateService)[];
6
+ export declare const appProviders: (typeof GenericValidationStateService | typeof DynamicFormService | typeof InputRegistryService | typeof PresentationDesignerBaseService | typeof FormStateService)[];
@@ -1,3 +1,4 @@
1
1
  export * from './array.functions';
2
2
  export * from './library-initializer';
3
3
  export * from './common.functions';
4
+ export * from './number.functions';
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Numeric helpers that avoid IEEE 754 floating-point accumulation errors.
3
+ *
4
+ * JavaScript's `number` is an IEEE 754 double, so decimal fractions such as
5
+ * `0.1` or `0.2` have no exact binary representation. Summing them naively
6
+ * (`a + b + c ...`) lets each rounding error compound, producing artifacts like
7
+ * `0.1 + 0.2 === 0.30000000000000004`.
8
+ *
9
+ * These helpers use integer scaling: every value is scaled up to an integer by
10
+ * the largest number of decimal places present, the addition is performed in the
11
+ * (exact) integer domain, then the result is scaled back down. No third-party
12
+ * dependency is required.
13
+ *
14
+ * Boundary: integer scaling can exceed `Number.MAX_SAFE_INTEGER` when summing
15
+ * very large numbers at high decimal precision (e.g. 6-decimal values totalling
16
+ * into the billions). For currency (2 decimals) the safe headroom is ~9e13, so
17
+ * this is a non-issue in practice.
18
+ */
19
+ /**
20
+ * Sums an array of numbers without IEEE 754 accumulation error.
21
+ *
22
+ * Uses integer scaling for an exact decimal result. `null`, `undefined` and
23
+ * non-finite entries (`NaN`, `Infinity`) are ignored (contribute `0`) so a
24
+ * single missing/invalid cell cannot poison the whole total. An empty,
25
+ * `null` or `undefined` input returns `0`.
26
+ *
27
+ * @param values - The values to sum (may contain gaps).
28
+ * @returns The precise sum, or `0` when there is nothing to add.
29
+ *
30
+ * @example
31
+ * preciseSum([0.1, 0.2]); // 0.3 (not 0.30000000000000004)
32
+ * preciseSum([1.005, 2.5, 3]); // 6.505
33
+ * preciseSum([10, null, undefined]); // 10
34
+ * preciseSum([]); // 0
35
+ */
36
+ export declare function preciseSum(values: ReadonlyArray<number | null | undefined> | null | undefined): number;
37
+ /**
38
+ * Adds two numbers without IEEE 754 accumulation error.
39
+ *
40
+ * `null`, `undefined` and non-finite operands are treated as `0`.
41
+ *
42
+ * @param a - First operand.
43
+ * @param b - Second operand.
44
+ * @returns The precise sum of `a` and `b`.
45
+ *
46
+ * @example
47
+ * preciseAdd(0.1, 0.2); // 0.3 (not 0.30000000000000004)
48
+ */
49
+ export declare function preciseAdd(a: number | null | undefined, b: number | null | undefined): number;
@@ -60,5 +60,6 @@ export interface ISortMeta {
60
60
  }
61
61
  export interface ICustomColumnSchema {
62
62
  columnName: string;
63
+ columnLibelle: string;
63
64
  type: 'date' | 'numeric' | 'boolean' | 'text';
64
65
  }
@@ -9,13 +9,14 @@ export declare class ColonnePersonnalisee {
9
9
  groupe: string;
10
10
  ordre: number;
11
11
  nom: string;
12
+ libelle: string;
12
13
  type: string;
13
14
  longueur: number;
14
15
  data: ColonnePersonnaliseeData;
15
16
  observation?: string | undefined;
16
17
  formule?: string | undefined;
17
18
  requete?: string | undefined;
18
- constructor(uid: string, classe: string, groupe: string, ordre: number, nom: string, type: string, longueur: number, data: ColonnePersonnaliseeData, observation?: string | undefined, formule?: string | undefined, requete?: string | undefined);
19
+ constructor(uid: string, classe: string, groupe: string, ordre: number, nom: string, libelle: string, type: string, longueur: number, data: ColonnePersonnaliseeData, observation?: string | undefined, formule?: string | undefined, requete?: string | undefined);
19
20
  }
20
21
  export declare class ColonnePersonnaliseeData {
21
22
  uid?: string | undefined;
@@ -2,7 +2,7 @@ import { DynamicDialogConfig, DynamicDialogRef } from "primeng/dynamicdialog";
2
2
  import { TabView } from "primeng/tabview";
3
3
  import { JwtHelperService } from "@auth0/angular-jwt";
4
4
  import { ConfirmationService, MessageService } from "primeng/api";
5
- export declare const SharedUiTsiProviders: (typeof TabView | typeof DynamicDialogRef | typeof DynamicDialogConfig | typeof JwtHelperService | typeof MessageService | typeof ConfirmationService | {
5
+ export declare const SharedUiTsiProviders: (typeof DynamicDialogRef | typeof DynamicDialogConfig | typeof JwtHelperService | typeof TabView | typeof MessageService | typeof ConfirmationService | {
6
6
  provide: import("@angular/core").InjectionToken<unknown>;
7
7
  useValue: import("@angular/core").InjectionToken<unknown>;
8
8
  })[];
@@ -12,7 +12,6 @@ import { EntityInfo } from '../../models/entity-info/entity-info';
12
12
  import { PresentationSetting } from '../../models/presentation-settings/presentation-settings';
13
13
  import { LocalizePipe } from '../../pipes/localize.pipe';
14
14
  import { CrudBaseService } from '../../services/base/crud-base.service';
15
- import { DiscriminatorService } from '../../services/configuration/discriminator.service';
16
15
  import { EntityConfigurationService } from '../../services/configuration/entity-configuration.service';
17
16
  import { DialogDataService } from '../../services/dialog-data.service';
18
17
  import { FichierUploadService } from '../../services/fichier/fichier-upload.service';
@@ -22,6 +21,8 @@ import { TsiNotificationService } from '../../services/notification/tsi-notifica
22
21
  import { RecordInfoPopupService } from '../../services/record-info-popup.service';
23
22
  import { WorkflowConfigurationService } from '../../services/workflow/workflow-configuration.service';
24
23
  import { TsiGenericGridComponent } from '../output-components/tsi-generic-grid/tsi-generic-grid.component';
24
+ import { DiscriminatorService } from '../../services/configuration/discriminator.service';
25
+ import { ColonnePersonnaliseeService } from '../../services/dynamic-form/colonne-personnalisee.service';
25
26
  import * as i0 from "@angular/core";
26
27
  export declare class TsiGenericCrudComponent implements OnInit, AfterContentChecked {
27
28
  private _messageService;
@@ -37,6 +38,7 @@ export declare class TsiGenericCrudComponent implements OnInit, AfterContentChec
37
38
  private notesService;
38
39
  private _injector;
39
40
  private _discriminatorService;
41
+ private _colonnePersonnaliseeService;
40
42
  private _dialogRef?;
41
43
  private _formEndpoint;
42
44
  protected filterIcon: string;
@@ -121,7 +123,7 @@ export declare class TsiGenericCrudComponent implements OnInit, AfterContentChec
121
123
  currentTooltip: string;
122
124
  viewOptions: MenuItem[];
123
125
  page$: BehaviorSubject<any>;
124
- constructor(_messageService: TsiNotificationService, msgService: MessageService, _tsiModalService: TsiModalService, _cdRef: ChangeDetectorRef, localize: LocalizePipe, dialogDataService: DialogDataService, fichierService: FichierUploadService, recordInfoPopupService: RecordInfoPopupService, _workflowConfigurationService: WorkflowConfigurationService, _entityConfigService: EntityConfigurationService, notesService: NoteService, _injector: EnvironmentInjector, _discriminatorService: DiscriminatorService);
126
+ constructor(_messageService: TsiNotificationService, msgService: MessageService, _tsiModalService: TsiModalService, _cdRef: ChangeDetectorRef, localize: LocalizePipe, dialogDataService: DialogDataService, fichierService: FichierUploadService, recordInfoPopupService: RecordInfoPopupService, _workflowConfigurationService: WorkflowConfigurationService, _entityConfigService: EntityConfigurationService, notesService: NoteService, _injector: EnvironmentInjector, _discriminatorService: DiscriminatorService, _colonnePersonnaliseeService: ColonnePersonnaliseeService);
125
127
  ngAfterContentChecked(): void;
126
128
  getState(): import("primeng/api").TableState | null | undefined;
127
129
  restoreState(configuration: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsi-developpement/tsi-shared-ui",
3
- "version": "1.10.0",
3
+ "version": "1.10.3",
4
4
  "author": "TSI",
5
5
  "license": "MIT",
6
6
  "peerDependencies": {