@linagora/linid-im-front-corelib 0.0.76 → 0.0.77
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/README.md +2 -2
- package/dist/core-lib.es.js +3042 -2978
- package/dist/core-lib.umd.js +20 -20
- package/dist/package.json +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/src/filters/linidFilter.d.ts +8 -7
- package/dist/types/src/filters/linidFilterSet.d.ts +50 -0
- package/dist/types/src/filters/linidFilterValue.d.ts +5 -0
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/types/linidFilter.d.ts +1 -1
- package/package.json +1 -1
|
@@ -37,14 +37,15 @@ export declare class LinidFilter<T = Record<string, unknown>> {
|
|
|
37
37
|
constructor(name: string, type: LinidFilterType, options: T, values: LinidFilterValue[]);
|
|
38
38
|
/**
|
|
39
39
|
* Parses a value expression (e.g. `paris|not_lk_lyon`, as produced by
|
|
40
|
-
* {@link LinidFilterValue.toString}) into a new {@link LinidFilter} instance
|
|
41
|
-
* bare value expression only
|
|
42
|
-
*
|
|
40
|
+
* {@link LinidFilterValue.toString}) into a new {@link LinidFilter} instance — `input` is the
|
|
41
|
+
* bare value expression only, never the `name=` query parameter prefix produced by
|
|
42
|
+
* {@link LinidFilter.toString}.
|
|
43
43
|
*
|
|
44
|
-
* `type
|
|
45
|
-
*
|
|
46
|
-
* as for any
|
|
47
|
-
*
|
|
44
|
+
* `type`/`options` aren't derivable from `input`, so the result gets a placeholder `'text'`
|
|
45
|
+
* `type` and empty `options` (callers tracking a `LinidFilter` definition should only use the
|
|
46
|
+
* parsed `values`); `id` is auto generated as for any instance. A non-string `input` at runtime
|
|
47
|
+
* (this class is exported across Module Federation boundaries, where TypeScript cannot enforce
|
|
48
|
+
* the contract) is treated like an empty string: an empty `values` array, rather than throwing.
|
|
48
49
|
* @param name - Identifier of the filter.
|
|
49
50
|
* @param input - The value expression, with values separated by `|`.
|
|
50
51
|
* @returns The parsed filter instance.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { LinidFilter } from './linidFilter';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a saved filter set (favorite search), combining a user-defined label with the list
|
|
4
|
+
* of `LinidFilter` it is made of. It converts to and parses from a `&`-separated list of
|
|
5
|
+
* `name=value` query parameter pairs — the same URL filter representation produced by
|
|
6
|
+
* `LinidFilter.toString` — so it can be stored as-is in user preferences and reused directly as
|
|
7
|
+
* a query string against APIs powered by
|
|
8
|
+
* [`spring-query-filter`](https://github.com/Zorin95670/spring-query-filter).
|
|
9
|
+
*/
|
|
10
|
+
export declare class LinidFilterSet {
|
|
11
|
+
/**
|
|
12
|
+
* User-friendly name of the favorite search (e.g. "My Active Projects").
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Collection of filters composing the favorite search.
|
|
17
|
+
*/
|
|
18
|
+
filters: LinidFilter[];
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new filter set.
|
|
21
|
+
* @param label - User-friendly name of the favorite search.
|
|
22
|
+
* @param filters - Collection of filters composing the favorite search.
|
|
23
|
+
*/
|
|
24
|
+
constructor(label: string, filters: LinidFilter[]);
|
|
25
|
+
/**
|
|
26
|
+
* Parses a string representation of a filter set, as produced by {@link LinidFilterSet.toString},
|
|
27
|
+
* into a new {@link LinidFilterSet} instance.
|
|
28
|
+
*
|
|
29
|
+
* Each `&`-separated segment containing the `=` separator is parsed as a `name=value` pair via
|
|
30
|
+
* {@link LinidFilter.fromString} (which in turn uses `LinidFilterValue.fromString`); segments
|
|
31
|
+
* without `=` are silently dropped instead of producing a filter with a guessed name. Since
|
|
32
|
+
* `type`/`options` aren't derivable from the string, parsed filters get placeholder values —
|
|
33
|
+
* match them back to known definitions by `name`.
|
|
34
|
+
*
|
|
35
|
+
* `value` tolerates `null`/`undefined`/any non-string at runtime (e.g. `localStorage.getItem(...)`,
|
|
36
|
+
* or across a Module Federation boundary): like an empty string, it produces an empty `filters`
|
|
37
|
+
* array instead of throwing.
|
|
38
|
+
* @param label - User-friendly name of the favorite search.
|
|
39
|
+
* @param value - The `&`-separated string of `name=value` pairs, as produced by `toString()`.
|
|
40
|
+
* @returns The parsed filter set.
|
|
41
|
+
*/
|
|
42
|
+
static fromString(label: string, value: string | null | undefined): LinidFilterSet;
|
|
43
|
+
/**
|
|
44
|
+
* Reconstructs the filter set as a `&`-separated string of `name=value` pairs, one per filter,
|
|
45
|
+
* ready to use with APIs powered by `spring-query-filter` or to store in user preferences.
|
|
46
|
+
* @returns The string representation of the filter set, e.g.
|
|
47
|
+
* `status=active|pending&createdAt=gt_2026-01-01`.
|
|
48
|
+
*/
|
|
49
|
+
toString(): string;
|
|
50
|
+
}
|
|
@@ -26,6 +26,11 @@ export declare class LinidFilterValue {
|
|
|
26
26
|
constructor(isNegation: boolean, operator: LinidFilterOperator, value: string);
|
|
27
27
|
/**
|
|
28
28
|
* Parses a filter value expression (e.g. `not_lk_paris`) into a {@link LinidFilterValue}.
|
|
29
|
+
*
|
|
30
|
+
* If `input` is not actually a string at runtime (this class is exported across Module
|
|
31
|
+
* Federation boundaries, where TypeScript cannot enforce the contract), the negation marker and
|
|
32
|
+
* operator prefix can't be looked up, so this returns the same neutral result as for an empty
|
|
33
|
+
* string: no negation, no operator, empty value.
|
|
29
34
|
* @param input - The filter value expression to parse.
|
|
30
35
|
* @returns The parsed filter value.
|
|
31
36
|
*/
|
|
@@ -29,6 +29,7 @@ export { getPiniaStore, setPiniaStore } from './services/piniaStoreService';
|
|
|
29
29
|
export { getUiDesign, setUiDesign } from './services/uiDesignService';
|
|
30
30
|
export { uiEventSubject } from './services/uiEventService';
|
|
31
31
|
export { LinidFilter } from './filters/linidFilter';
|
|
32
|
+
export { LinidFilterSet } from './filters/linidFilterSet';
|
|
32
33
|
export { LinidFilterValue } from './filters/linidFilterValue';
|
|
33
34
|
export { LINID_FILTER_NEGATION_PREFIX, LINID_FILTER_OR_SEPARATOR, } from './types/linidFilter';
|
|
34
35
|
export type { LinidZoneEntry } from './types/linidZone';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/linid-im-front-corelib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.77",
|
|
4
4
|
"description": "Core library of the LinID Identity Manager project. Provides shared types, services, components, and utilities for front-end and plugin, enabling consistent integration across the LinID ecosystem.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|