chrv-components 1.12.174 → 1.12.175

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.
Binary file
@@ -1134,7 +1134,11 @@ function getSyncValidators(rules) {
1134
1134
  validators.push(minFileSize(validation.value));
1135
1135
  }
1136
1136
  if (rule == 'maxFileNameLength') {
1137
- validation.display = `Le nom du fichier (ou son nom d'affichage) est trop long !`;
1137
+ validation.display = `Le nom du fichier est trop long !`;
1138
+ validators.push(maxFileNameLength(validation.value));
1139
+ }
1140
+ if (rule == 'minFileNameLength') {
1141
+ validation.display = `Le nom du fichier est trop long !`;
1138
1142
  validators.push(maxFileNameLength(validation.value));
1139
1143
  }
1140
1144
  }
@@ -1152,7 +1156,8 @@ const BaseErrorDisplays = {
1152
1156
  maxdate: `Cette date est trop grande !`,
1153
1157
  maxfilesize: `Ce fichier est trop grand !`,
1154
1158
  minfilesize: `Ce fichier est trop petit !`,
1155
- maxfilenamelength: `Le nom du fichier (ou son nom d'affichage) est trop long !`,
1159
+ maxfilenamelength: `Le nom du fichier est trop long !`,
1160
+ minfilenamelength: `Le nom du fichier est trop court !`,
1156
1161
  };
1157
1162
 
1158
1163
  class AutofocusDirective {
@@ -8853,6 +8858,79 @@ class AnonymousTable extends BaseTable {
8853
8858
  }
8854
8859
  }
8855
8860
 
8861
+ class MinFileNameLengthValidator {
8862
+ constructor() {
8863
+ this.max = input(0, /* @ts-ignore */
8864
+ ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
8865
+ }
8866
+ validate(control) {
8867
+ const max = this.max();
8868
+ return max ? minFileNameLength(max)(control) : null;
8869
+ }
8870
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: MinFileNameLengthValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
8871
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: MinFileNameLengthValidator, isStandalone: true, selector: "[app-max-file-size]", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
8872
+ {
8873
+ provide: NG_VALIDATORS,
8874
+ useExisting: MinFileNameLengthValidator,
8875
+ multi: true,
8876
+ },
8877
+ ], ngImport: i0 }); }
8878
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: MinFileNameLengthValidator, providedIn: 'root' }); }
8879
+ }
8880
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: MinFileNameLengthValidator, decorators: [{
8881
+ type: Injectable,
8882
+ args: [{ providedIn: 'root' }]
8883
+ }, {
8884
+ type: Directive,
8885
+ args: [{
8886
+ selector: '[app-max-file-size]',
8887
+ providers: [
8888
+ {
8889
+ provide: NG_VALIDATORS,
8890
+ useExisting: MinFileNameLengthValidator,
8891
+ multi: true,
8892
+ },
8893
+ ],
8894
+ standalone: true,
8895
+ }]
8896
+ }], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }] } });
8897
+ function minFileNameLength(maxLength) {
8898
+ return (control) => {
8899
+ const value = control.value;
8900
+ const errors = {};
8901
+ let isSizeCompliant = true;
8902
+ let fileSize = null;
8903
+ if (value === null)
8904
+ return null;
8905
+ if (Array.isArray(value)) {
8906
+ for (let i = 0; i < value.length; i++) {
8907
+ const fileNameLength = value[i].name?.length;
8908
+ if (fileNameLength === undefined)
8909
+ continue;
8910
+ if (fileNameLength <= maxLength) {
8911
+ errors[i] = true;
8912
+ isSizeCompliant = false;
8913
+ fileSize = value[i].name.length;
8914
+ }
8915
+ }
8916
+ }
8917
+ else {
8918
+ isSizeCompliant =
8919
+ value?.name?.length === undefined || value.name.length >= maxLength;
8920
+ }
8921
+ return isSizeCompliant == false
8922
+ ? {
8923
+ minFileNameLength: {
8924
+ maxFileNameLength: maxLength,
8925
+ actual: fileSize,
8926
+ indexes: errors,
8927
+ },
8928
+ indexes: errors,
8929
+ }
8930
+ : null;
8931
+ };
8932
+ }
8933
+
8856
8934
  class AutoDataTable extends BaseTable {
8857
8935
  get columnMetadatas() {
8858
8936
  return this._columnMetadatas.sort((a, b) => a.ordinalPosition - b.ordinalPosition);
@@ -9341,5 +9419,5 @@ const provideDebounceEventPlugin = () => [
9341
9419
  * Generated bundle index. Do not edit.
9342
9420
  */
9343
9421
 
9344
- export { Aligments, AnonymousTable, AutoDataSource, AutoDataTable, AutofocusDirective, BaseErrorDisplays, BaseTable, BreadcrumbComponent, ButtonComponent, CHR_DEACTIVATION_MODAL, CHR_DEBOUNCE_DEFAULTS, CHR_MODAL_DATA, CHR_MODAL_REF, CacheService, CachingInterceptor, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrButtonLegacyComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrContextMenuComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDeactivationGuard, ChrDebounceDirective, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrDropdownComponent, ChrFile, ChrFileInputComponent, ChrFormComponent, ChrHoverDirective, ChrHoverTitleComponent, ChrHoverTitleDirective, ChrInputComponent, ChrInputData, ChrInputDataOverlay, ChrInputIndicators, ChrLegacyFileInputComponent, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrPasswordInputComponent, ChrPopoverDirective, ChrPreventReloadDirective, ChrSearchSelectComponent, ChrSearchSelectInputComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTagSelectInputComponent, ChrTextAreaInputComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, ColorsVariables, ColumnFilter, ColumnGroup, ColumnMetadata, ContextMenuDirective, ControlClickDirective, CookiesService, CrossCellNavigationDirective, DEFAULTLIVEUPDATEMESSAGE, DEFAULT_TOAST_CONFIG, DGFilterMode, DGGroupAggregationEnum, DataExporterService, DataFormatterService, DataGrid, DataListComponent, DataService, DebounceDefaults, DebounceEventPlugin, DecimalValidatorDirective, DefaultLiveUpdateMessage, DropdownContent, DropdownTitle, ENABLE_CACHE, ENABLE_PROGRESS, EditableCell, FileService, HUBURL, INVALIDATE_CACHE, InlineSvgComponent, LegacyToastService, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileNameLengthValidator, MaxFileSizeValidator, MaxLengthValidatorDirective, MessageBanner, MinFileSizeValidator, MinLengthValidatorDirective, ModalRef, ModalService, OldSpinnerInterceptor, OutsideClickAwareDirective, ProgressInterceptor, ProgressService, RequiredValidatorDirective, SHOW_SPINNER, SKIP_SPINNER, ScrollIntoViewDirective, Spinner, SpinnerInterceptor, SpinnerService, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, TableConstraint, TableConstraintColumn, TableConstraintReference, ToastComponent, ToastDefaults, ToastRef, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, getVariableColor, getVariableContrastColor, maxDate, maxFileNameLength, maxFileSize, maxLength, minFileSize, minLength, provideDebounceEventPlugin, provideXsrfHttpClient, required, type };
9422
+ export { Aligments, AnonymousTable, AutoDataSource, AutoDataTable, AutofocusDirective, BaseErrorDisplays, BaseTable, BreadcrumbComponent, ButtonComponent, CHR_DEACTIVATION_MODAL, CHR_DEBOUNCE_DEFAULTS, CHR_MODAL_DATA, CHR_MODAL_REF, CacheService, CachingInterceptor, CarouselComponent, ChrBaseInputComponent, ChrButtonComponent, ChrButtonLegacyComponent, ChrCheckboxComponent, ChrColorInputComponent, ChrContextMenuComponent, ChrDataTable, ChrDateInputComponent, ChrDatetimeInputComponent, ChrDeactivationGuard, ChrDebounceDirective, ChrDefaultModalComponent, ChrDeleteModalComponent, ChrDropdownComponent, ChrFile, ChrFileInputComponent, ChrFormComponent, ChrHoverDirective, ChrHoverTitleComponent, ChrHoverTitleDirective, ChrInputComponent, ChrInputData, ChrInputDataOverlay, ChrInputIndicators, ChrLegacyFileInputComponent, ChrModalComponent, ChrNiceFileInputComponent, ChrPaginatorComponent, ChrPasswordInputComponent, ChrPopoverDirective, ChrPreventReloadDirective, ChrSearchSelectComponent, ChrSearchSelectInputComponent, ChrSearchbarComponent, ChrSeparatorComponent, ChrSpinnerComponent, ChrTableComponent, ChrTableHeaderCellComponent, ChrTagSelectComponent, ChrTagSelectInputComponent, ChrTextAreaInputComponent, ChrTextareaInputComponent, ChrToastComponent, ChrToggleInputComponent, Colors, ColorsVariables, ColumnFilter, ColumnGroup, ColumnMetadata, ContextMenuDirective, ControlClickDirective, CookiesService, CrossCellNavigationDirective, DEFAULTLIVEUPDATEMESSAGE, DEFAULT_TOAST_CONFIG, DGFilterMode, DGGroupAggregationEnum, DataExporterService, DataFormatterService, DataGrid, DataListComponent, DataService, DebounceDefaults, DebounceEventPlugin, DecimalValidatorDirective, DefaultLiveUpdateMessage, DropdownContent, DropdownTitle, ENABLE_CACHE, ENABLE_PROGRESS, EditableCell, FileService, HUBURL, INVALIDATE_CACHE, InlineSvgComponent, LegacyToastService, LiveUpdateService, LiveUpdateStatus, LoaderService, MaxDateValidatorDirective, MaxFileNameLengthValidator, MaxFileSizeValidator, MaxLengthValidatorDirective, MessageBanner, MinFileNameLengthValidator, MinFileSizeValidator, MinLengthValidatorDirective, ModalRef, ModalService, OldSpinnerInterceptor, OutsideClickAwareDirective, ProgressInterceptor, ProgressService, RequiredValidatorDirective, SHOW_SPINNER, SKIP_SPINNER, ScrollIntoViewDirective, Spinner, SpinnerInterceptor, SpinnerService, SyncValidatorToAsync, TabComponent, TabGroupComponent, TabToEnterHandlerDirective, TabToInputHandlerDirective, TableConstraint, TableConstraintColumn, TableConstraintReference, ToastComponent, ToastDefaults, ToastRef, ToastService, TypeValidatorDirective, WaitAndStoreXsrfToken, XSRFCOOKIENAME, XSRFHEADERNAME, XsrfInterceptor, decimal, getAsyncValidators, getBackgroundColor, getBorderColor, getContrastBackgroundColor, getContrastBorderColor, getContrastTextColor, getSyncValidators, getTextColor, getValidators, getVariableColor, getVariableContrastColor, maxDate, maxFileNameLength, maxFileSize, maxLength, minFileNameLength, minFileSize, minLength, provideDebounceEventPlugin, provideXsrfHttpClient, required, type };
9345
9423
  //# sourceMappingURL=chrv-components.mjs.map