@ecodev/natural 64.0.2 → 65.0.1
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/fesm2022/ecodev-natural.mjs +522 -314
- package/fesm2022/ecodev-natural.mjs.map +1 -1
- package/index.d.ts +93 -19
- package/package.json +1 -5
- package/fesm2022/ecodev-natural-vanilla.mjs +0 -1218
- package/fesm2022/ecodev-natural-vanilla.mjs.map +0 -1
- package/vanilla/index.d.ts +0 -420
- package/vanilla/package.json +0 -3
package/index.d.ts
CHANGED
|
@@ -1678,8 +1678,8 @@ declare function validateAllFormControls(control: AbstractControl<unknown>): voi
|
|
|
1678
1678
|
/**
|
|
1679
1679
|
* Emits exactly 0 or 1 time:
|
|
1680
1680
|
*
|
|
1681
|
-
* - if the form is VALID
|
|
1682
|
-
* - if the form is PENDING emits if it changes from PENDING to VALID
|
|
1681
|
+
* - if the form is `VALID`, emits immediately
|
|
1682
|
+
* - if the form is `PENDING` emits if it changes from `PENDING` to `VALID`
|
|
1683
1683
|
* - any other cases will **never** emit
|
|
1684
1684
|
*/
|
|
1685
1685
|
declare function ifValid(control: AbstractControl): Observable<'VALID'>;
|
|
@@ -1689,23 +1689,21 @@ declare function ifValid(control: AbstractControl): Observable<'VALID'>;
|
|
|
1689
1689
|
* This is meant to replace **all** usages of Angular too permissive `Validators.email`
|
|
1690
1690
|
*/
|
|
1691
1691
|
declare function deliverableEmail(control: AbstractControl): ValidationErrors | null;
|
|
1692
|
+
declare const urlPattern: string;
|
|
1692
1693
|
/**
|
|
1693
1694
|
* Naive URL validator for "normal" web links, that is a bit too permissive
|
|
1694
1695
|
*
|
|
1695
|
-
* It enforces:
|
|
1696
|
-
*
|
|
1696
|
+
* - It enforces:
|
|
1697
1697
|
* - http/https protocol
|
|
1698
1698
|
* - one domain
|
|
1699
1699
|
* - one tld
|
|
1700
|
-
*
|
|
1701
|
-
* It allows:
|
|
1702
|
-
*
|
|
1700
|
+
* - It allows:
|
|
1703
1701
|
* - any number of subdomains
|
|
1704
1702
|
* - any parameters
|
|
1705
1703
|
* - any fragments
|
|
1706
1704
|
* - any characters for any parts (does not conform to rfc1738)
|
|
1707
1705
|
*/
|
|
1708
|
-
declare const
|
|
1706
|
+
declare const url: ValidatorFn;
|
|
1709
1707
|
/**
|
|
1710
1708
|
* Validates that the value is an integer (non-float)
|
|
1711
1709
|
*/
|
|
@@ -1721,6 +1719,26 @@ declare function decimal(scale: number): ValidatorFn;
|
|
|
1721
1719
|
* Validate that the value is an amount of money, meaning a number with at most 2 decimals
|
|
1722
1720
|
*/
|
|
1723
1721
|
declare function money(control: AbstractControl): ValidationErrors | null;
|
|
1722
|
+
/**
|
|
1723
|
+
* Validate that the number is strictly greater than given one.
|
|
1724
|
+
*
|
|
1725
|
+
* `Validators.min()` is "greater than or equal", but this one is strictly
|
|
1726
|
+
* "greater than".
|
|
1727
|
+
*
|
|
1728
|
+
* **SHOULD NOT USE IT**, instead consider using Angular's native `Validators.min()`.
|
|
1729
|
+
* Because you should also apply `[attr.min]="123"` in the template to have the browser
|
|
1730
|
+
* help the user. And that attribute spec defines that it is "greater or equal", which
|
|
1731
|
+
* contradicts this validator. So we cannot use this validator and have the best UX.
|
|
1732
|
+
*/
|
|
1733
|
+
declare function greaterThan(min: number): ValidatorFn;
|
|
1734
|
+
/**
|
|
1735
|
+
* Validate a 32 bits MiFare hexadecimal CSN
|
|
1736
|
+
*/
|
|
1737
|
+
declare function nfcCardHex(control: AbstractControl): ValidationErrors | null;
|
|
1738
|
+
/**
|
|
1739
|
+
* Validate a time similar to "14h35", "14:35" or "14h".
|
|
1740
|
+
*/
|
|
1741
|
+
declare function time(control: AbstractControl): ValidationErrors | null;
|
|
1724
1742
|
|
|
1725
1743
|
type ProgressBar = {
|
|
1726
1744
|
start: () => void;
|
|
@@ -1926,6 +1944,64 @@ declare class NaturalEnumPipe implements PipeTransform {
|
|
|
1926
1944
|
static ɵpipe: i0.ɵɵPipeDeclaration<NaturalEnumPipe, "enum", true>;
|
|
1927
1945
|
}
|
|
1928
1946
|
|
|
1947
|
+
/**
|
|
1948
|
+
* Return a single error message for the first found error, if any.
|
|
1949
|
+
*
|
|
1950
|
+
* Typical usage is without `@if`:
|
|
1951
|
+
*
|
|
1952
|
+
* ```html
|
|
1953
|
+
* <mat-form-field>
|
|
1954
|
+
* <input matInput formControlName="name" />
|
|
1955
|
+
* <mat-label i18n>Nom</mat-label>
|
|
1956
|
+
* <mat-error>{{ form.get('name')?.errors | errorMessage }}</mat-error>
|
|
1957
|
+
* </mat-form-field>
|
|
1958
|
+
* ```
|
|
1959
|
+
*
|
|
1960
|
+
* If you need custom error messages, you can override, or defined new ones like that:
|
|
1961
|
+
*
|
|
1962
|
+
* ```html
|
|
1963
|
+
* <mat-form-field>
|
|
1964
|
+
* <input matInput formControlName="name" />
|
|
1965
|
+
* <mat-label i18n>Nom</mat-label>
|
|
1966
|
+
* @if (form.get('name')?.hasError('required')) {
|
|
1967
|
+
* <mat-error>Ce champ est requis parce qu'il est vraiment très important</mat-error>
|
|
1968
|
+
* } @else {
|
|
1969
|
+
* <mat-error>{{ form.get('name')?.errors | errorMessage }}</mat-error>
|
|
1970
|
+
* }
|
|
1971
|
+
* </mat-form-field>
|
|
1972
|
+
* ```
|
|
1973
|
+
*
|
|
1974
|
+
* Supported validators are:
|
|
1975
|
+
*
|
|
1976
|
+
* - Angular
|
|
1977
|
+
* - `Validators.max`
|
|
1978
|
+
* - `Validators.maxlength`
|
|
1979
|
+
* - `Validators.min`
|
|
1980
|
+
* - `Validators.minlength`
|
|
1981
|
+
* - `Validators.required`
|
|
1982
|
+
* - Natural
|
|
1983
|
+
* - `available`
|
|
1984
|
+
* - `decimal`
|
|
1985
|
+
* - `deliverableEmail`
|
|
1986
|
+
* - `greaterThan`
|
|
1987
|
+
* - `integer`
|
|
1988
|
+
* - `money`
|
|
1989
|
+
* - `nfcCardHex`
|
|
1990
|
+
* - `time`
|
|
1991
|
+
* - `unique`
|
|
1992
|
+
* - `url`
|
|
1993
|
+
* - Others, that live in individual projects, but we exceptionally support here
|
|
1994
|
+
* - `iban`
|
|
1995
|
+
* - `validateCity`
|
|
1996
|
+
*
|
|
1997
|
+
* @param unit is used to build the message for the following validators: `min`, `max`, `greaterThan`
|
|
1998
|
+
*/
|
|
1999
|
+
declare class NaturalErrorMessagePipe implements PipeTransform {
|
|
2000
|
+
transform(errors: ValidationErrors | null | undefined, unit?: string): string;
|
|
2001
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NaturalErrorMessagePipe, never>;
|
|
2002
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<NaturalErrorMessagePipe, "errorMessage", true>;
|
|
2003
|
+
}
|
|
2004
|
+
|
|
1929
2005
|
/**
|
|
1930
2006
|
* Returns a string to approximately describe the date.
|
|
1931
2007
|
*
|
|
@@ -2672,13 +2748,6 @@ declare class TypeDateRangeComponent<D = any> implements DropdownComponent {
|
|
|
2672
2748
|
static ɵcmp: i0.ɵɵComponentDeclaration<TypeDateRangeComponent<any>, "ng-component", never, {}, {}, never, never, true, never>;
|
|
2673
2749
|
}
|
|
2674
2750
|
|
|
2675
|
-
type NaturalDropdownData<C = any> = {
|
|
2676
|
-
condition: FilterGroupConditionField | null;
|
|
2677
|
-
configuration: C;
|
|
2678
|
-
title?: string;
|
|
2679
|
-
};
|
|
2680
|
-
declare const NATURAL_DROPDOWN_DATA: InjectionToken<NaturalDropdownData<any>>;
|
|
2681
|
-
|
|
2682
2751
|
type TypeOption = {
|
|
2683
2752
|
display: string;
|
|
2684
2753
|
condition: Literal;
|
|
@@ -2687,13 +2756,12 @@ type TypeOptionsConfiguration = {
|
|
|
2687
2756
|
options: TypeOption[];
|
|
2688
2757
|
};
|
|
2689
2758
|
declare class TypeOptionsComponent implements DropdownComponent {
|
|
2690
|
-
readonly data: NaturalDropdownData<TypeOptionsConfiguration>;
|
|
2691
2759
|
readonly renderedValue: BehaviorSubject<string>;
|
|
2692
2760
|
readonly formControl: FormControl<TypeOption>;
|
|
2693
2761
|
readonly configuration: Required<TypeOptionsConfiguration>;
|
|
2694
2762
|
private readonly defaults;
|
|
2695
2763
|
protected readonly dropdownRef: NaturalDropdownRef;
|
|
2696
|
-
constructor(
|
|
2764
|
+
constructor();
|
|
2697
2765
|
getCondition(): FilterGroupConditionField;
|
|
2698
2766
|
isValid(): boolean;
|
|
2699
2767
|
isDirty(): boolean;
|
|
@@ -2706,7 +2774,6 @@ type TypeBooleanConfiguration = {
|
|
|
2706
2774
|
displayWhenInactive: string;
|
|
2707
2775
|
};
|
|
2708
2776
|
declare class TypeBooleanComponent extends TypeOptionsComponent implements DropdownComponent {
|
|
2709
|
-
constructor();
|
|
2710
2777
|
static ɵfac: i0.ɵɵFactoryDeclaration<TypeBooleanComponent, never>;
|
|
2711
2778
|
static ɵcmp: i0.ɵɵComponentDeclaration<TypeBooleanComponent, "ng-component", never, {}, {}, never, never, true, never>;
|
|
2712
2779
|
}
|
|
@@ -3298,6 +3365,13 @@ declare class NaturalRelationsComponent<TService extends NaturalAbstractModelSer
|
|
|
3298
3365
|
static ɵcmp: i0.ɵɵComponentDeclaration<NaturalRelationsComponent<any>, "natural-relations", never, { "service": { "alias": "service"; "required": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "autocompleteSelectorFilter": { "alias": "autocompleteSelectorFilter"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; "main": { "alias": "main"; "required": true; }; "hierarchicSelectorFilters": { "alias": "hierarchicSelectorFilters"; "required": false; "isSignal": true; }; "hierarchicSelectorConfig": { "alias": "hierarchicSelectorConfig"; "required": false; "isSignal": true; }; "otherName": { "alias": "otherName"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "sorting": { "alias": "sorting"; "required": false; }; }, { "selectionChange": "selectionChange"; }, ["itemTemplate"], never, true, never>;
|
|
3299
3366
|
}
|
|
3300
3367
|
|
|
3368
|
+
type NaturalDropdownData<C = any> = {
|
|
3369
|
+
condition: FilterGroupConditionField | null;
|
|
3370
|
+
configuration: C;
|
|
3371
|
+
title?: string;
|
|
3372
|
+
};
|
|
3373
|
+
declare const NATURAL_DROPDOWN_DATA: InjectionToken<NaturalDropdownData<any>>;
|
|
3374
|
+
|
|
3301
3375
|
declare function toGraphQLDoctrineFilter(facets: NaturalSearchFacets | null, selections: NaturalSearchSelections | null): Filter;
|
|
3302
3376
|
|
|
3303
3377
|
/**
|
|
@@ -4194,5 +4268,5 @@ declare const naturalProviders: ApplicationConfig['providers'];
|
|
|
4194
4268
|
*/
|
|
4195
4269
|
declare function graphqlQuerySigner(key: string): HttpInterceptorFn;
|
|
4196
4270
|
|
|
4197
|
-
export { AvatarService, InvalidWithValueStateMatcher$1 as InvalidWithValueStateMatcher, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_ICONS_CONFIG, NATURAL_PERSISTENCE_VALIDATOR, NATURAL_SEO_CONFIG, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertService, NaturalAvatarComponent, NaturalBackgroundDensityDirective, NaturalCapitalizePipe, NaturalColumnsPickerComponent, NaturalConfirmComponent, NaturalDataSource, NaturalDebounceService, NaturalDetailHeaderComponent, NaturalDialogTriggerComponent, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalErrorHandler, NaturalFileComponent, NaturalFileDropDirective, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconDirective, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalSearchComponent, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalTimeAgoPipe, NetworkActivityService, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeBooleanComponent, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeOptionsComponent, TypeSelectComponent, TypeTextComponent, activityInterceptor, available, cancellableTimeout, cloneDeepButSkipFile, collectErrors, commonImageMimeTypes, copyToClipboard, createHttpLink, debug, decimal, deepFreeze, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, graphqlQuerySigner, hasFilesAndProcessDate, ifValid, integer, isFile, localStorageFactory, localStorageProvider, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, naturalProviders, onHistoryEvent, possibleComparableOperators, provideErrorHandler, provideIcons, providePanels, provideSeo, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, rgbToHex, sessionStorageFactory, sessionStorageProvider, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter,
|
|
4271
|
+
export { AvatarService, InvalidWithValueStateMatcher$1 as InvalidWithValueStateMatcher, LOCAL_STORAGE, NATURAL_DROPDOWN_DATA, NATURAL_ICONS_CONFIG, NATURAL_PERSISTENCE_VALIDATOR, NATURAL_SEO_CONFIG, NaturalAbstractDetail, NaturalAbstractEditableList, NaturalAbstractList, NaturalAbstractModelService, NaturalAbstractNavigableList, NaturalAbstractPanel, NaturalAlertService, NaturalAvatarComponent, NaturalBackgroundDensityDirective, NaturalCapitalizePipe, NaturalColumnsPickerComponent, NaturalConfirmComponent, NaturalDataSource, NaturalDebounceService, NaturalDetailHeaderComponent, NaturalDialogTriggerComponent, NaturalDropdownRef, NaturalEllipsisPipe, NaturalEnumPipe, NaturalEnumService, NaturalErrorHandler, NaturalErrorMessagePipe, NaturalFileComponent, NaturalFileDropDirective, NaturalFileSelectDirective, NaturalFileService, NaturalFixedButtonComponent, NaturalFixedButtonDetailComponent, NaturalHierarchicSelectorComponent, NaturalHierarchicSelectorDialogComponent, NaturalHierarchicSelectorDialogService, NaturalHierarchicSelectorService, NaturalHttpPrefixDirective, NaturalIconDirective, NaturalLinkMutationService, NaturalLinkableTabDirective, NaturalLoggerConfigExtra, NaturalLoggerConfigUrl, NaturalMatomoService, NaturalMemoryStorage, NaturalPanelsComponent, NaturalPanelsService, NaturalPersistenceService, NaturalQueryVariablesManager, NaturalRelationsComponent, NaturalSearchComponent, NaturalSelectComponent, NaturalSelectEnumComponent, NaturalSelectHierarchicComponent, NaturalSeoService, NaturalSidenavComponent, NaturalSidenavContainerComponent, NaturalSidenavContentComponent, NaturalSidenavService, NaturalSidenavStackService, NaturalSrcDensityDirective, NaturalStampComponent, NaturalSwissParsingDateAdapter, NaturalTableButtonComponent, NaturalTimeAgoPipe, NetworkActivityService, PanelsHooksConfig, SESSION_STORAGE, SortingOrder, TypeBooleanComponent, TypeDateComponent, TypeDateRangeComponent, TypeHierarchicSelectorComponent, TypeNaturalSelectComponent, TypeNumberComponent, TypeOptionsComponent, TypeSelectComponent, TypeTextComponent, activityInterceptor, available, cancellableTimeout, cloneDeepButSkipFile, collectErrors, commonImageMimeTypes, copyToClipboard, createHttpLink, debug, decimal, deepFreeze, deliverableEmail, ensureHttpPrefix, fallbackIfNoOpenedPanels, formatIsoDate, formatIsoDateTime, fromUrl, getForegroundColor, graphqlQuerySigner, greaterThan, hasFilesAndProcessDate, ifValid, integer, isFile, localStorageFactory, localStorageProvider, makePlural, memoryLocalStorageProvider, memorySessionStorageProvider, mergeOverrideArray, money, naturalPanelsUrlMatcher, naturalProviders, nfcCardHex, onHistoryEvent, possibleComparableOperators, provideErrorHandler, provideIcons, providePanels, provideSeo, relationsToIds, replaceObjectKeepingReference, replaceOperatorByField, replaceOperatorByName, rgbToHex, sessionStorageFactory, sessionStorageProvider, time, toGraphQLDoctrineFilter, toNavigationParameters, toUrl, unique, upperCaseFirstLetter, url, urlPattern, validTlds, validateAllFormControls, validateColumns, validatePagination, validateSorting, wrapLike, wrapPrefix, wrapSuffix };
|
|
4198
4272
|
export type { AvailableColumn, Button, DropdownComponent, DropdownFacet, ExtractResolve, ExtractTall, ExtractTallOne, ExtractTcreate, ExtractTdelete, ExtractTone, ExtractTupdate, ExtractVall, ExtractVcreate, ExtractVdelete, ExtractVone, ExtractVupdate, Facet, FileModel, FileSelection, Filter, FilterGroupConditionField, FlagFacet, FormAsyncValidators, FormControls, FormValidators, HierarchicDialogConfig, HierarchicDialogResult, HierarchicFilterConfiguration$1 as HierarchicFilterConfiguration, HierarchicFiltersConfiguration$1 as HierarchicFiltersConfiguration, IEnum, InvalidFile, LinkableObject, Literal, NameOrFullName, NaturalConfirmData, NaturalDialogTriggerProvidedData, NaturalDialogTriggerRedirectionValues, NaturalDialogTriggerRoutingData, NaturalDropdownData, NaturalHierarchicConfiguration, NaturalIconConfig, NaturalIconsConfig, NaturalLoggerExtra, NaturalLoggerType, NaturalPanelConfig, NaturalPanelData, NaturalPanelResolves, NaturalPanelsBeforeOpenPanel, NaturalPanelsHooksConfig, NaturalPanelsRouteConfig, NaturalPanelsRouterRule, NaturalPanelsRoutesConfig, NaturalSearchFacets, NaturalSearchSelection, NaturalSearchSelections, NaturalSeo, NaturalSeoBasic, NaturalSeoCallback, NaturalSeoConfig, NaturalSeoResolve, NaturalSeoResolveData, NaturalStorage, NavigableItem, OrganizedModelSelection, PaginatedData, PaginationInput, PersistenceValidator, PossibleComparableOpertorKeys, QueryVariables, ResolvedData, Sorting, SubButton, TypeBooleanConfiguration, TypeDateConfiguration, TypeDateRangeConfiguration, TypeHierarchicSelectorConfiguration, TypeNumberConfiguration, TypeOption, TypeOptionsConfiguration, TypeSelectConfiguration, TypeSelectItem, TypeSelectNaturalConfiguration, VariablesWithInput, WithId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecodev/natural",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "65.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "github:Ecodev/natural",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"./package.json": {
|
|
14
14
|
"default": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"./vanilla": {
|
|
17
|
-
"types": "./vanilla/index.d.ts",
|
|
18
|
-
"default": "./fesm2022/ecodev-natural-vanilla.mjs"
|
|
19
15
|
}
|
|
20
16
|
},
|
|
21
17
|
"dependencies": {
|